index.js 1.2 KB

123456789101112131415161718192021222324252627
  1. // Register the JSX namespace on `h`.
  2. /**
  3. * @typedef {import('./jsx-classic.js').Element} h.JSX.Element
  4. * @typedef {import('./jsx-classic.js').ElementChildrenAttribute} h.JSX.ElementChildrenAttribute
  5. * @typedef {import('./jsx-classic.js').IntrinsicAttributes} h.JSX.IntrinsicAttributes
  6. * @typedef {import('./jsx-classic.js').IntrinsicElements} h.JSX.IntrinsicElements
  7. */
  8. // Register the JSX namespace on `s`.
  9. /**
  10. * @typedef {import('./jsx-classic.js').Element} s.JSX.Element
  11. * @typedef {import('./jsx-classic.js').ElementChildrenAttribute} s.JSX.ElementChildrenAttribute
  12. * @typedef {import('./jsx-classic.js').IntrinsicAttributes} s.JSX.IntrinsicAttributes
  13. * @typedef {import('./jsx-classic.js').IntrinsicElements} s.JSX.IntrinsicElements
  14. */
  15. import {html, svg} from 'property-information'
  16. import {createH} from './create-h.js'
  17. import {svgCaseSensitiveTagNames} from './svg-case-sensitive-tag-names.js'
  18. // Note: this explicit type is needed, otherwise TS creates broken types.
  19. /** @type {ReturnType<createH>} */
  20. export const h = createH(html, 'div')
  21. // Note: this explicit type is needed, otherwise TS creates broken types.
  22. /** @type {ReturnType<createH>} */
  23. export const s = createH(svg, 'g', svgCaseSensitiveTagNames)