jsx-automatic.d.ts 948 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import type {Child, Properties, Result} from './create-h.js'
  2. export namespace JSX {
  3. /**
  4. * Define the return value of JSX syntax.
  5. */
  6. type Element = Result
  7. /**
  8. * Key of this interface defines as what prop children are passed.
  9. */
  10. interface ElementChildrenAttribute {
  11. /**
  12. * Only the key matters, not the value.
  13. */
  14. children?: never
  15. }
  16. /**
  17. * Disallow the use of functional components.
  18. */
  19. type IntrinsicAttributes = never
  20. /**
  21. * Define the prop types for known elements.
  22. *
  23. * For `hastscript` this defines any string may be used in combination with
  24. * `hast` `Properties`.
  25. *
  26. * This **must** be an interface.
  27. */
  28. type IntrinsicElements = Record<
  29. string,
  30. | Properties
  31. | {
  32. /**
  33. * The prop that matches `ElementChildrenAttribute` key defines the
  34. * type of JSX children, defines the children type.
  35. */
  36. children?: Child
  37. }
  38. >
  39. }