export const Fragment = ({ children }: { children: render.Node[] }) => children; export function jsx( type: string | render.Component, props: Record, ): render.Element { if (typeof type !== "function" && typeof type !== "string") { throw new Error("Invalid component type: " + render.inspect(type)); } return [render.kElement, type, props]; } export function jsxDEV( type: string | render.Component, props: Record, // Unused with the clover engine _key: string, // Unused with the clover engine _isStaticChildren: boolean, source: render.SrcLoc, ): render.Element { const { fileName, lineNumber, columnNumber } = source; // Assert the component type is valid to render. if (typeof type !== "function" && typeof type !== "string") { throw new Error( `Invalid component type at ${fileName}:${lineNumber}:${columnNumber}: ` + render.inspect(type) + ". Clover SSR element must be a function or string", ); } // Construct an `ssr.Element` return [render.kElement, type, props, "", source]; } // jsxs export { jsx as jsxs }; declare global { namespace JSX { interface IntrinsicElements { [name: string]: Record; } interface ElementChildrenAttribute { children: Node; } type Element = render.Element; type ElementType = keyof IntrinsicElements | render.Component; type ElementClass = ReturnType; } } import * as render from "#engine/render";