import type * as dom from './dom.d.ts'; import type { Handle, RenderFn } from './component.ts'; /** * Any valid element type accepted by JSX or {@link import('./create-element.ts').createElement}. * - `string` for host elements (e.g., 'div') * - `Function` for user components */ export type ElementType = string | Function; /** * Generic bag of props passed to elements/components. * Consumers should define specific prop types on their components; this is the * renderer's normalized shape used throughout reconciler/SSR code. */ export type ElementProps = Record; /** * A virtual element produced by JSX or {@link import('./create-element.ts').createElement} * describing UI. Carries a `$rmx` brand used to distinguish it from plain objects at runtime. */ export interface RemixElement { /** Host tag or component function for the element. */ type: ElementType; /** Normalized props for the element. */ props: ElementProps; /** Optional reconciliation key. */ key?: any; /** Internal brand used to distinguish Remix elements at runtime. */ $rmx: true; } /** * Any single value Remix can render. Booleans render as empty text. */ export type Renderable = RemixElement | string | number | bigint | boolean | null | undefined; /** * Anything that Remix can render, including nested arrays of renderable values. * This mirrors how JSX spreads children into arrays (e.g. when using `map`) * and how our reconciler flattens children at runtime. * * Particularly useful for `props.children`. * * ```tsx * function MyComponent(handle: Handle<{ children: RemixNode }>) {} * ``` */ export type RemixNode = Renderable | RemixNode[]; type PreviousMixDepth = [0, 0, 1, 2, 3, 4]; type FalsyMixValue = false | 0 | 0n | '' | null | undefined; type NullableMixValue = mix | FalsyMixValue; type MixLeaf = mix extends ReadonlyArray ? MixLeaf : mix; type NormalizeMixLeaf = Exclude, FalsyMixValue>; type NestedMixValue = depth extends 0 ? NullableMixValue | ReadonlyArray> : NullableMixValue | ReadonlyArray>; type NormalizeMixProp = props extends { mix?: infer mix; } ? Omit & { mix?: Array>; } : props; type ExpandMixProp = props extends { mix?: infer mix; } ? Omit & { mix?: NestedMixValue>; } : props; type MixinElementType = ((handle: { update(): Promise; }, setup: unknown) => (props: any) => RemixElement) & { __rmxMixinElementType: string; }; /** * Get the props for a specific element type. * * @example * interface MyButtonProps extends Props<"button"> { * size: "sm" | "md" | "lg" * } */ export type Props = NormalizeMixProp; /** * Creates a Remix virtual element. * * @param type Host tag or component function. * @param props Element props. * @param key Optional reconciliation key. * @returns A Remix virtual element. */ export declare function jsx(type: ElementType, props: ElementProps, key?: string): RemixElement; export { jsx as jsxDEV, jsx as jsxs }; declare global { namespace JSX { interface IntrinsicAttributes { key?: any; } type Element = RemixElement; type ElementType = keyof IntrinsicElements | ((handle: Handle) => RenderFn) | MixinElementType; type ElementChildrenAttribute = { children: any; }; interface ElementAttributesProperty { props: any; } type LibraryManagedAttributes = component extends MixinElementType ? ExpandMixProp>[0]> : component extends () => RenderFn ? ExpandMixProp> : component extends (handle: Handle) => RenderFn ? ExpandMixProp

: ExpandMixProp; interface IntrinsicSVGElements { svg: dom.SVGProps; animate: dom.SVGProps; circle: dom.SVGProps; animateMotion: dom.SVGProps; animateTransform: dom.SVGProps; clipPath: dom.SVGProps; defs: dom.SVGProps; desc: dom.SVGProps; ellipse: dom.SVGProps; feBlend: dom.SVGProps; feColorMatrix: dom.SVGProps; feComponentTransfer: dom.SVGProps; feComposite: dom.SVGProps; feConvolveMatrix: dom.SVGProps; feDiffuseLighting: dom.SVGProps; feDisplacementMap: dom.SVGProps; feDistantLight: dom.SVGProps; feDropShadow: dom.SVGProps; feFlood: dom.SVGProps; feFuncA: dom.SVGProps; feFuncB: dom.SVGProps; feFuncG: dom.SVGProps; feFuncR: dom.SVGProps; feGaussianBlur: dom.SVGProps; feImage: dom.SVGProps; feMerge: dom.SVGProps; feMergeNode: dom.SVGProps; feMorphology: dom.SVGProps; feOffset: dom.SVGProps; fePointLight: dom.SVGProps; feSpecularLighting: dom.SVGProps; feSpotLight: dom.SVGProps; feTile: dom.SVGProps; feTurbulence: dom.SVGProps; filter: dom.SVGProps; foreignObject: dom.SVGProps; g: dom.SVGProps; image: dom.SVGProps; line: dom.SVGProps; linearGradient: dom.SVGProps; marker: dom.SVGProps; mask: dom.SVGProps; metadata: dom.SVGProps; mpath: dom.SVGProps; path: dom.SVGProps; pattern: dom.SVGProps; polygon: dom.SVGProps; polyline: dom.SVGProps; radialGradient: dom.SVGProps; rect: dom.SVGProps; set: dom.SVGProps; stop: dom.SVGProps; switch: dom.SVGProps; symbol: dom.SVGProps; text: dom.SVGProps; textPath: dom.SVGProps; tspan: dom.SVGProps; use: dom.SVGProps; view: dom.SVGProps; } interface IntrinsicMathMLElements { annotation: dom.AnnotationMathMLProps; 'annotation-xml': dom.AnnotationXmlMathMLProps; /** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maction */ maction: dom.MActionMathMLProps; math: dom.MathMathMLProps; /** This feature is non-standard. See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose */ menclose: dom.MEncloseMathMLProps; merror: dom.MErrorMathMLProps; /** @deprecated See https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced */ mfenced: dom.MFencedMathMLProps; mfrac: dom.MFracMathMLProps; mi: dom.MiMathMLProps; mmultiscripts: dom.MmultiScriptsMathMLProps; mn: dom.MNMathMLProps; mo: dom.MOMathMLProps; mover: dom.MOverMathMLProps; mpadded: dom.MPaddedMathMLProps; mphantom: dom.MPhantomMathMLProps; mprescripts: dom.MPrescriptsMathMLProps; mroot: dom.MRootMathMLProps; mrow: dom.MRowMathMLProps; ms: dom.MSMathMLProps; mspace: dom.MSpaceMathMLProps; msqrt: dom.MSqrtMathMLProps; mstyle: dom.MStyleMathMLProps; msub: dom.MSubMathMLProps; msubsup: dom.MSubsupMathMLProps; msup: dom.MSupMathMLProps; mtable: dom.MTableMathMLProps; mtd: dom.MTdMathMLProps; mtext: dom.MTextMathMLProps; mtr: dom.MTrMathMLProps; munder: dom.MUnderMathMLProps; munderover: dom.MUnderMathMLProps; semantics: dom.SemanticsMathMLProps; } interface IntrinsicHTMLElements { a: dom.AccessibleAnchorHTMLProps; abbr: dom.HTMLProps; address: dom.HTMLProps; area: dom.AccessibleAreaHTMLProps; article: dom.ArticleHTMLProps; aside: dom.AsideHTMLProps; audio: dom.AudioHTMLProps; b: dom.HTMLProps; base: dom.BaseHTMLProps; bdi: dom.HTMLProps; bdo: dom.HTMLProps; big: dom.HTMLProps; blockquote: dom.BlockquoteHTMLProps; body: dom.HTMLProps; br: dom.BrHTMLProps; button: dom.ButtonHTMLProps; canvas: dom.CanvasHTMLProps; caption: dom.CaptionHTMLProps; cite: dom.HTMLProps; code: dom.HTMLProps; col: dom.ColHTMLProps; colgroup: dom.ColgroupHTMLProps; data: dom.DataHTMLProps; datalist: dom.DataListHTMLProps; dd: dom.DdHTMLProps; del: dom.DelHTMLProps; details: dom.DetailsHTMLProps; dfn: dom.HTMLProps; dialog: dom.DialogHTMLProps; div: dom.HTMLProps; dl: dom.DlHTMLProps; dt: dom.DtHTMLProps; em: dom.HTMLProps; embed: dom.EmbedHTMLProps; fieldset: dom.FieldsetHTMLProps; figcaption: dom.FigcaptionHTMLProps; figure: dom.HTMLProps; footer: dom.FooterHTMLProps; form: dom.FormHTMLProps; h1: dom.HeadingHTMLProps; h2: dom.HeadingHTMLProps; h3: dom.HeadingHTMLProps; h4: dom.HeadingHTMLProps; h5: dom.HeadingHTMLProps; h6: dom.HeadingHTMLProps; head: dom.HeadHTMLProps; header: dom.HeaderHTMLProps; hgroup: dom.HTMLProps; hr: dom.HrHTMLProps; html: dom.HtmlHTMLProps; i: dom.HTMLProps; iframe: dom.IframeHTMLProps; img: dom.AccessibleImgHTMLProps; input: dom.AccessibleInputHTMLProps; ins: dom.InsHTMLProps; kbd: dom.HTMLProps; keygen: dom.KeygenHTMLProps; label: dom.LabelHTMLProps; legend: dom.LegendHTMLProps; li: dom.LiHTMLProps; link: dom.LinkHTMLProps; main: dom.MainHTMLProps; map: dom.MapHTMLProps; mark: dom.HTMLProps; marquee: dom.MarqueeHTMLProps; menu: dom.MenuHTMLProps; menuitem: dom.HTMLProps; meta: dom.MetaHTMLProps; meter: dom.MeterHTMLProps; nav: dom.NavHTMLProps; noscript: dom.NoScriptHTMLProps; object: dom.ObjectHTMLProps; ol: dom.OlHTMLProps; optgroup: dom.OptgroupHTMLProps; option: dom.OptionHTMLProps; output: dom.OutputHTMLProps; p: dom.HTMLProps; param: dom.ParamHTMLProps; picture: dom.PictureHTMLProps; pre: dom.HTMLProps; progress: dom.ProgressHTMLProps; q: dom.QuoteHTMLProps; rp: dom.HTMLProps; rt: dom.HTMLProps; ruby: dom.HTMLProps; s: dom.HTMLProps; samp: dom.HTMLProps; script: dom.ScriptHTMLProps; search: dom.SearchHTMLProps; section: dom.HTMLProps; select: dom.AccessibleSelectHTMLProps; slot: dom.SlotHTMLProps; small: dom.HTMLProps; source: dom.SourceHTMLProps; span: dom.HTMLProps; strong: dom.HTMLProps; style: dom.StyleHTMLProps; sub: dom.HTMLProps; summary: dom.HTMLProps; sup: dom.HTMLProps; table: dom.TableHTMLProps; tbody: dom.HTMLProps; td: dom.TdHTMLProps; template: dom.TemplateHTMLProps; textarea: dom.TextareaHTMLProps; tfoot: dom.HTMLProps; th: dom.ThHTMLProps; thead: dom.HTMLProps; time: dom.TimeHTMLProps; title: dom.TitleHTMLProps; tr: dom.HTMLProps; track: dom.TrackHTMLProps; u: dom.UlHTMLProps; ul: dom.HTMLProps; var: dom.HTMLProps; video: dom.VideoHTMLProps; wbr: dom.WbrHTMLProps; } interface IntrinsicElements extends IntrinsicSVGElements, IntrinsicMathMLElements, IntrinsicHTMLElements { } } }