greact/lib/jsx/jsx-runtime.ts
Benjamin Palko 7d41cb4315 setup
2025-04-11 18:20:43 -04:00

20 lines
585 B
TypeScript

import { renderJSX } from "./render";
import type { JSXChildren, RenderedNode } from "./types";
namespace JSX {
export type Attributes = Record<string, unknown> & JSXChildren;
// Allow any html tag
export type IntrinsicElements = Record<string, Attributes>;
// Declare the shape of JSX rendering result
// This is required so the return types of components can be inferred
export type Element = RenderedNode;
}
// Expose the main namespace
export type { JSX };
// Expose factories
export const jsx = renderJSX;
export const jsxs = renderJSX;
export const jsxDEV = renderJSX;