hastx
Version:
JSX Transform emitting Rehype syntax trees (HAST)
38 lines • 1.4 kB
TypeScript
import type * as hast from "@types/hast";
import type * as html from "./html.js";
import type * as svg from "./svg.js";
export type Element = hast.Element;
export type JSXChild = string | number | boolean | JSXElement;
export type JSXChildren = JSXChild | JSXChild[];
export type JSXElement = hast.Element | hast.Root | hast.Text;
export type JSXElementProps = Record<string, string> & {
children?: JSXChildren;
};
export type JSXComponentProps = Record<string, unknown> & {
key?: string;
};
export interface JSXComponent {
(props: JSXComponentProps): JSXElement;
}
export interface JSXElementConstructor {
(...args: any[]): JSXElement;
}
declare global {
export namespace JSX {
type Element = JSXElement;
type ElementType = keyof html.HTMLElements | keyof svg.SVGElements | JSXElementConstructor;
interface IntrinsicElements extends html.HTMLElements, svg.SVGElements {
}
interface ElementChildrenAttribute {
children: {};
}
}
}
export declare function jsx(component: JSXComponent, props: JSXComponentProps): JSXElement;
export declare function jsx(element: string, props: JSXElementProps): JSXElement;
export declare const jsxs: typeof jsx;
export declare const jsxDEV: typeof jsx;
export declare function Fragment(props: {
children?: JSXChild | JSXChild[];
}): hast.Root;
//# sourceMappingURL=jsx-runtime.d.ts.map