flexium
Version:
A lightweight, signals-based UI framework with cross-platform renderers
79 lines (74 loc) • 1.78 kB
text/typescript
import { V as VNode } from './renderer-CWYPPHmO.cjs';
/**
* Flexium JSX Runtime
*
* This module provides the automatic JSX runtime for Flexium.
* It implements the new JSX transform introduced in React 17+.
*
* With automatic JSX runtime, you no longer need to import `h`:
*
* Before (classic):
* ```tsx
* import { h } from 'flexium/dom'
* function App() {
* return <div>Hello</div>
* }
* ```
*
* After (automatic):
* ```tsx
* function App() {
* return <div>Hello</div>
* }
* ```
*
* Usage in tsconfig.json:
* ```json
* {
* "compilerOptions": {
* "jsx": "react-jsx",
* "jsxImportSource": "flexium"
* }
* }
* ```
*/
/**
* JSX runtime function for elements with multiple children
*
* @param type - Element type (string for built-in, function for components)
* @param props - Element properties including children
* @returns Virtual node
*/
declare function jsx(type: string | Function, props: Record<string, any>): VNode;
/**
* JSX runtime function for elements with static children
* (optimization hint from the compiler)
*
* @param type - Element type
* @param props - Element properties
* @returns Virtual node
*/
declare function jsxs(type: string | Function, props: Record<string, any>): VNode;
/**
* Fragment component for JSX
* Renders children without a wrapper element
*/
declare function Fragment(props: {
children?: any[];
}): VNode;
declare namespace JSX {
interface IntrinsicElements {
[elemName: string]: any;
}
type Element = any;
interface ElementClass {
render: any;
}
interface ElementAttributesProperty {
props: any;
}
interface ElementChildrenAttribute {
children: {};
}
}
export { Fragment, JSX, jsx, jsx as jsxDEV, jsxs };