/** * JSX Type Definitions for 0x1 Framework * Provides React 19+ compatible JSX types */ // Base JSX node type export type JSXNode = | string | number | boolean | null | undefined | JSXElement | JSXNode[]; // JSX Element interface export interface JSXElement { type: string | React.ComponentType; props: Record; key?: string | number | null; } // HTML Attributes with proper generic support export interface HTMLAttributes { // React-compatible HTML attributes className?: string; id?: string; style?: React.CSSProperties | string; // Event handlers onClick?: (event: React.MouseEvent) => void; onChange?: (event: React.ChangeEvent) => void; onSubmit?: (event: React.FormEvent) => void; // Common HTML attributes [key: string]: any; } // JSX Attributes that extend HTML attributes export interface JSXAttributes extends HTMLAttributes { children?: JSXNode; key?: string | number | null; ref?: React.Ref; } // JSX namespace for TypeScript declare global { namespace JSX { type Element = JSXNode; interface IntrinsicElements { // Document elements html: JSXAttributes; head: JSXAttributes; body: JSXAttributes; title: JSXAttributes; meta: JSXAttributes; link: JSXAttributes; script: JSXAttributes; style: JSXAttributes; // Layout elements div: JSXAttributes; span: JSXAttributes; section: JSXAttributes; article: JSXAttributes; aside: JSXAttributes; header: JSXAttributes; footer: JSXAttributes; main: JSXAttributes; nav: JSXAttributes; // Text content p: JSXAttributes; h1: JSXAttributes; h2: JSXAttributes; h3: JSXAttributes; h4: JSXAttributes; h5: JSXAttributes; h6: JSXAttributes; ul: JSXAttributes; ol: JSXAttributes; li: JSXAttributes; // Form elements form: JSXAttributes; input: JSXAttributes & { type?: string }; button: JSXAttributes & { type?: 'button' | 'submit' | 'reset' }; textarea: JSXAttributes; select: JSXAttributes; option: JSXAttributes; label: JSXAttributes; // Media elements img: JSXAttributes & { src: string; alt: string }; a: JSXAttributes & { href?: string; target?: string }; } } } export { };