Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav authored and github-actions[bot] committed Jan 15, 2023
1 parent 626b46a commit 4417fc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/refs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ function getResolvedElements(value: unknown): HTMLElement | HTMLElement[] | null
* refs() // T: HTMLElement[]
*/
export function elements<S>(fn: Accessor<Many<S>>): Accessor<ExtractIfPossible<S, Element>[]>;
export function elements<S, T extends typeof Element[]>(
export function elements<S, T extends (typeof Element)[]>(
fn: Accessor<Many<S>>,
...types: T
): Accessor<ExtractIfPossible<S, InstanceType<ItemsOf<T>>>[]>;
export function elements(fn: Accessor<any>, ...types: typeof Element[]): Accessor<Element[]> {
export function elements(fn: Accessor<any>, ...types: (typeof Element)[]): Accessor<Element[]> {
return createMemo(() => filterInstance(asArray(fn()), ...(types.length ? types : [Element])));
}

Expand All @@ -187,7 +187,7 @@ export function refs<S>(
added: Accessor<ExtractIfPossible<S, Element>[]>,
removed: Accessor<ExtractIfPossible<S, Element>[]>
];
export function refs<S, T extends typeof Element[]>(
export function refs<S, T extends (typeof Element)[]>(
fn: Accessor<Many<S>>,
...types: T
): [
Expand All @@ -197,7 +197,7 @@ export function refs<S, T extends typeof Element[]>(
];
export function refs(
fn: Accessor<any>,
...types: typeof Element[]
...types: (typeof Element)[]
): [refs: Accessor<Element[]>, added: Accessor<Element[]>, removed: Accessor<Element[]>] {
const resolved = elements(fn, ...types);
let prev: readonly Element[] = [];
Expand Down

0 comments on commit 4417fc6

Please sign in to comment.