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