Skip to content

Commit 91f8930

Browse files
committed
fix(core/dom): fix selector generic type
1 parent be75b54 commit 91f8930

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

packages/core/src/dom/dom-list-methods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function createMethods(list: FastjsDomList): FastjsDomListAPI {
3131
return list[key];
3232
},
3333
next<
34-
T extends FastjsDom | FastjsDomList | null =
34+
T extends FastjsDom<any> | FastjsDomList | null =
3535
| FastjsDom
3636
| FastjsDomList
3737
| null

packages/core/src/dom/dom-list-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface FastjsDomListAPI {
1717
getElement(key?: number): ElementList;
1818
getDom(key?: number): FastjsDom;
1919
next<
20-
T extends FastjsDom | FastjsDomList | null =
20+
T extends FastjsDom<any> | FastjsDomList | null =
2121
| FastjsDom
2222
| FastjsDomList
2323
| null

packages/core/src/dom/dom-methods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function createMethods<ElementType extends ElementList>(
119119
const children = () => createFastjsDomList([...dom._el.children]);
120120

121121
const next = <
122-
T extends FastjsDom | FastjsDomList | null =
122+
T extends FastjsDom<any> | FastjsDomList | null =
123123
| FastjsDom
124124
| FastjsDomList
125125
| null

packages/core/src/dom/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { FastjsDomList } from "./dom-list-types";
66

77
interface DomModule {
88
<
9-
T extends FastjsDom | FastjsDomList | null =
9+
T extends FastjsDom<any> | FastjsDomList | null =
1010
| FastjsDom
1111
| FastjsDomList
1212
| null
@@ -20,7 +20,10 @@ interface DomModule {
2020
}
2121

2222
const dom: DomModule = function <
23-
T extends FastjsDom | FastjsDomList | null = FastjsDom | FastjsDomList | null
23+
T extends FastjsDom<any> | FastjsDomList | null =
24+
| FastjsDom
25+
| FastjsDomList
26+
| null
2427
>(
2528
target: string = "body",
2629
parent: Document | HTMLElement | HTMLElement[] = document

packages/core/src/dom/selector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { createFastjsDom } from "./dom";
77
import { createFastjsDomList } from "./dom-list";
88

99
function selector<
10-
T extends FastjsDom | FastjsDomList | null = FastjsDom | FastjsDomList | null
10+
T extends FastjsDom<any> | FastjsDomList | null = FastjsDom | FastjsDomList | null
1111
>(
1212
target: string = "body",
1313
parent: Document | ElementList | ElementList[] = document

0 commit comments

Comments
 (0)