File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 77 * Result from a `h` (or `s`) call.
88 */
99
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'
21import { runtime } from './runtime.js'
2+ import { h } from './index.js'
33
44// Export `JSX` as a global for TypeScript.
55export * from './jsx-automatic.js'
Original file line number Diff line number Diff line change 11import { runtime } from './runtime.js'
2- import { s } from './svg .js'
2+ import { s } from './index .js'
33
44// Export `JSX` as a global for TypeScript.
55export * from './jsx-automatic.js'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3333 "types" : " index.d.ts" ,
3434 "exports" : {
3535 "." : " ./index.js" ,
36- "./index.js" : " ./index.js" ,
37- "./html.js" : " ./html.js" ,
38- "./svg.js" : " ./svg.js" ,
3936 "./jsx-runtime" : " ./jsx-runtime.js" ,
4037 "./jsx-dev-runtime" : " ./jsx-runtime.js" ,
4138 "./html/jsx-runtime" : " ./html/jsx-runtime.js" ,
4744 " lib/" ,
4845 " html/" ,
4946 " svg/" ,
50- " html.d.ts" ,
51- " html.js" ,
52- " svg.d.ts" ,
53- " svg.js" ,
5447 " jsx-runtime.d.ts" ,
5548 " jsx-runtime.js" ,
5649 " index.d.ts" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { expectType } from 'tsd'
22import type { Root } from 'hast'
3- import { h as hFromRoot } from '../html.js'
4- import { s as sFromRoot } from '../svg.js'
53import { h as hFromIndex , s as sFromIndex } from '../index.js'
64
7- expectType < Root > ( hFromRoot ( ) )
85expectType < Root > ( hFromIndex ( ) )
9- expectType < Root > ( sFromRoot ( ) )
106expectType < Root > ( sFromIndex ( ) )
Original file line number Diff line number Diff line change 11import { expectType } from 'tsd'
22import type { Root , Element } from 'hast'
3- import { h as hFromRoot } from '../html.js'
43import { h , s } from '../index.js'
54import { 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 ( ) )
115
126expectType < Root > ( h ( ) )
137expectType < Root > ( s ( ) )
You can’t perform that action at this time.
0 commit comments