File tree Expand file tree Collapse file tree 11 files changed +26
-86
lines changed Expand file tree Collapse file tree 11 files changed +26
-86
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 7
7
* Result from a `h` (or `s`) call.
8
8
*/
9
9
10
- export { h } from './html.js'
11
- export { s } from './svg.js'
10
+ // Register the JSX namespace.
11
+ /**
12
+ * @typedef {import('./jsx-classic.js').Element } h.JSX.Element
13
+ * @typedef {import('./jsx-classic.js').ElementChildrenAttribute } h.JSX.ElementChildrenAttribute
14
+ * @typedef {import('./jsx-classic.js').IntrinsicAttributes } h.JSX.IntrinsicAttributes
15
+ * @typedef {import('./jsx-classic.js').IntrinsicElements } h.JSX.IntrinsicElements
16
+ *
17
+ * @typedef {import('./jsx-classic.js').Element } s.JSX.Element
18
+ * @typedef {import('./jsx-classic.js').ElementChildrenAttribute } s.JSX.ElementChildrenAttribute
19
+ * @typedef {import('./jsx-classic.js').IntrinsicAttributes } s.JSX.IntrinsicAttributes
20
+ * @typedef {import('./jsx-classic.js').IntrinsicElements } s.JSX.IntrinsicElements
21
+ */
22
+
23
+ import { html , svg } from 'property-information'
24
+ import { core } from './core.js'
25
+ import { svgCaseSensitiveTagNames } from './svg-case-sensitive-tag-names.js'
26
+
27
+ // Note: this explicit type is needed, otherwise TS creates broken types.
28
+ /** @type {ReturnType<core> } */
29
+ export const h = core ( html , 'div' )
30
+
31
+ // Note: this explicit type is needed, otherwise TS creates broken types.
32
+ /** @type {ReturnType<core> } */
33
+ export const s = core ( svg , 'g' , svgCaseSensitiveTagNames )
Original file line number Diff line number Diff line change 1
- import { h } from './html.js'
2
1
import { runtime } from './runtime.js'
2
+ import { h } from './index.js'
3
3
4
4
// Export `JSX` as a global for TypeScript.
5
5
export * from './jsx-automatic.js'
Original file line number Diff line number Diff line change 1
1
import { runtime } from './runtime.js'
2
- import { s } from './svg .js'
2
+ import { s } from './index .js'
3
3
4
4
// Export `JSX` as a global for TypeScript.
5
5
export * from './jsx-automatic.js'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33
33
"types" : " index.d.ts" ,
34
34
"exports" : {
35
35
"." : " ./index.js" ,
36
- "./index.js" : " ./index.js" ,
37
- "./html.js" : " ./html.js" ,
38
- "./svg.js" : " ./svg.js" ,
39
36
"./jsx-runtime" : " ./jsx-runtime.js" ,
40
37
"./jsx-dev-runtime" : " ./jsx-runtime.js" ,
41
38
"./html/jsx-runtime" : " ./html/jsx-runtime.js" ,
47
44
" lib/" ,
48
45
" html/" ,
49
46
" svg/" ,
50
- " html.d.ts" ,
51
- " html.js" ,
52
- " svg.d.ts" ,
53
- " svg.js" ,
54
47
" jsx-runtime.d.ts" ,
55
48
" jsx-runtime.js" ,
56
49
" index.d.ts" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import { expectType } from 'tsd'
2
2
import type { Root } from 'hast'
3
- import { h as hFromRoot } from '../html.js'
4
- import { s as sFromRoot } from '../svg.js'
5
3
import { h as hFromIndex , s as sFromIndex } from '../index.js'
6
4
7
- expectType < Root > ( hFromRoot ( ) )
8
5
expectType < Root > ( hFromIndex ( ) )
9
- expectType < Root > ( sFromRoot ( ) )
10
6
expectType < Root > ( sFromIndex ( ) )
Original file line number Diff line number Diff line change 1
1
import { expectType } from 'tsd'
2
2
import type { Root , Element } from 'hast'
3
- import { h as hFromRoot } from '../html.js'
4
3
import { h , s } from '../index.js'
5
4
import { Fragment , jsx , jsxs } from '../jsx-runtime.js'
6
- import { s as sFromRoot } from '../svg.js'
7
-
8
- // Ensure files are loadable in TS.
9
- expectType < Root > ( hFromRoot ( ) )
10
- expectType < Root > ( sFromRoot ( ) )
11
5
12
6
expectType < Root > ( h ( ) )
13
7
expectType < Root > ( s ( ) )
You can’t perform that action at this time.
0 commit comments