Skip to content

Commit 9903108

Browse files
committed
fix: Address most type errors, RTS will need patch
1 parent 600d155 commit 9903108

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

compat/src/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ declare namespace preact {
100100
}
101101

102102
// export default React;
103-
export = React;
103+
export default React;
104104
export as namespace React;
105105
declare namespace React {
106106
// Export JSX

compat/src/internal.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {
1+
import type {
22
Component as PreactComponent,
33
VNode as PreactVNode,
44
FunctionComponent as PreactFunctionComponent,
55
PreactElement
6-
} from '../../src/internal';
7-
import { SuspenseProps } from './suspense';
6+
} from '../../src/internal.d.ts';
7+
import type { SuspenseProps } from './suspense.d.ts';
88

9-
export { ComponentChildren } from '../..';
9+
export type { ComponentChildren } from 'preact';
1010

1111
export { PreactElement };
1212

hooks/src/internal.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {
1+
import type {
22
Options as PreactOptions,
33
Component as PreactComponent,
44
VNode as PreactVNode,
55
PreactContext,
66
HookType,
77
ErrorInfo
8-
} from '../../src/internal';
9-
import { Reducer, StateUpdater } from '.';
8+
} from '../../src/internal.d.ts';
9+
import type { Reducer, StateUpdater } from './index.d.ts';
1010

1111
export { PreactContext };
1212

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"moduleResolution": "node",
1010
"resolveJsonModule": true,
1111
"paths": {
12-
"preact": ["."],
12+
"preact": ["./src/index.d.ts"],
1313
"preact/*": ["./*"]
1414
},
1515
"target": "es5",

src/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export as namespace preact;
22

3-
import { JSXInternal } from './jsx.js';
4-
import { DOMAttributes, HTMLAttributes, SVGAttributes } from './dom.js';
3+
import type { JSXInternal } from './jsx.d.ts';
4+
import type { DOMAttributes, HTMLAttributes, SVGAttributes } from './dom.d.ts';
55

6-
export import JSX = JSXInternal;
7-
export * from './dom.js';
6+
export { JSXInternal as JSX }
7+
export type * from './dom.d.ts';
88

99
//
1010
// Preact Virtual DOM
@@ -230,7 +230,7 @@ export function createElement<P>(
230230
...children: ComponentChildren[]
231231
): VNode<P>;
232232
export namespace createElement {
233-
export import JSX = JSXInternal;
233+
export { JSXInternal as JSX };
234234
}
235235

236236
export function h(
@@ -280,7 +280,7 @@ export function h<P>(
280280
...children: ComponentChildren[]
281281
): VNode<Attributes & P>;
282282
export namespace h {
283-
export import JSX = JSXInternal;
283+
export { JSXInternal as JSX };
284284
}
285285

286286
//

0 commit comments

Comments
 (0)