jsx.d.ts 942 B

12345678910111213141516171819202122232425
  1. import { Key, VNode, VNodeData } from "./vnode";
  2. import { ArrayOrElement } from "./h";
  3. declare namespace JSXInternal {
  4. type Element = VNode;
  5. interface IntrinsicElements {
  6. [elemName: string]: VNodeData;
  7. }
  8. }
  9. export declare type JsxVNodeChild = VNode | string | number | boolean | undefined | null;
  10. export declare type JsxVNodeChildren = ArrayOrElement<JsxVNodeChild>;
  11. export declare type FunctionComponent = (props: {
  12. [prop: string]: any;
  13. } | null, children?: VNode[]) => VNode;
  14. export declare function Fragment(data: {
  15. key?: Key;
  16. } | null, ...children: JsxVNodeChildren[]): VNode;
  17. /**
  18. * jsx/tsx compatible factory function
  19. * see: https://www.typescriptlang.org/docs/handbook/jsx.html#factory-functions
  20. */
  21. export declare function jsx(tag: string | FunctionComponent, data: VNodeData | null, ...children: JsxVNodeChildren[]): VNode;
  22. export declare namespace jsx {
  23. export import JSX = JSXInternal;
  24. }
  25. export {};