/** * Common call contracts: Props * * This file holds structural types shared across multiple modules. */ /** * Props accepted by components and elements. * Intentionally permissive but provides a single named type. */ interface Props { /** Optional key for keyed lists (string | number | symbol for internal frames) */ key?: string | number | symbol; /** Optional children slot */ children?: unknown; /** Allow additional arbitrary attributes (e.g., class, id, data-*) */ [attr: string]: unknown; } type ReactiveProp = T | (() => T); type BivariantHandler = { bivarianceHack(value: T): void; }['bivarianceHack']; type IntrinsicClassValue = string | null | undefined | false; type IntrinsicAriaValue = string | number | boolean | null | undefined; type IntrinsicDataValue = string | number | boolean | null | undefined; type IntrinsicBooleanValue = boolean | null | undefined; type IntrinsicNumberValue = number | null | undefined; type IntrinsicTextValue = string | null | undefined; /** Enumerated attributes where `false` renders `"false"` (see keepsFalseValue). */ type IntrinsicEnumeratedValue = string | boolean | null | undefined; type IntrinsicTextLikeValue = string | number | null | undefined; type IntrinsicStyleEntryValue = string | number | null | undefined | false; type IntrinsicStyleObject = Record; type IntrinsicStyleValue = | string | IntrinsicStyleObject | null | undefined | false; type IntrinsicFormValue = | string | number | readonly string[] | null | undefined; type IntrinsicRef = | BivariantHandler | { current: T | null; } | null | undefined; /** MathML elements that lib.dom's MathMLElementTagNameMap does not list. */ type MathMLExtraTag = 'mglyph' | 'menclose' | 'mlabeledtr' | 'none'; type IntrinsicElementForTag = Tag extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[Tag] : Tag extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[Tag] : Tag extends keyof MathMLElementTagNameMap | MathMLExtraTag ? MathMLElement : Element; interface IntrinsicEventProps { onAbort?: BivariantHandler | null; onAnimationCancel?: BivariantHandler | null; onAnimationEnd?: BivariantHandler | null; onAnimationIteration?: BivariantHandler | null; onAnimationStart?: BivariantHandler | null; onAuxClick?: BivariantHandler | null; onBeforeInput?: BivariantHandler | null; onBeforeMatch?: BivariantHandler | null; onBeforeToggle?: BivariantHandler | null; onBlur?: BivariantHandler | null; onCancel?: BivariantHandler | null; onCanPlay?: BivariantHandler | null; onCanPlayThrough?: BivariantHandler | null; onChange?: BivariantHandler | null; onClick?: BivariantHandler | null; onClose?: BivariantHandler | null; onCommand?: BivariantHandler | null; onCompositionEnd?: BivariantHandler | null; onCompositionStart?: BivariantHandler | null; onCompositionUpdate?: BivariantHandler | null; onContextLost?: BivariantHandler | null; onContextMenu?: BivariantHandler | null; onContextRestored?: BivariantHandler | null; onCopy?: BivariantHandler | null; onCueChange?: BivariantHandler | null; onCut?: BivariantHandler | null; onDblClick?: BivariantHandler | null; onDrag?: BivariantHandler | null; onDragEnd?: BivariantHandler | null; onDragEnter?: BivariantHandler | null; onDragLeave?: BivariantHandler | null; onDragOver?: BivariantHandler | null; onDragStart?: BivariantHandler | null; onDrop?: BivariantHandler | null; onDurationChange?: BivariantHandler | null; onEmptied?: BivariantHandler | null; onEnded?: BivariantHandler | null; onError?: BivariantHandler | null; onFocus?: BivariantHandler | null; onFocusIn?: BivariantHandler | null; onFocusOut?: BivariantHandler | null; onFormData?: BivariantHandler | null; onGotPointerCapture?: BivariantHandler | null; onInput?: BivariantHandler | null; onInvalid?: BivariantHandler | null; onKeyDown?: BivariantHandler | null; onKeyPress?: BivariantHandler | null; onKeyUp?: BivariantHandler | null; onLoad?: BivariantHandler | null; onLoadedData?: BivariantHandler | null; onLoadedMetadata?: BivariantHandler | null; onLoadStart?: BivariantHandler | null; onLostPointerCapture?: BivariantHandler | null; onMouseDown?: BivariantHandler | null; onMouseEnter?: BivariantHandler | null; onMouseLeave?: BivariantHandler | null; onMouseMove?: BivariantHandler | null; onMouseOut?: BivariantHandler | null; onMouseOver?: BivariantHandler | null; onMouseUp?: BivariantHandler | null; onPaste?: BivariantHandler | null; onPause?: BivariantHandler | null; onPlay?: BivariantHandler | null; onPlaying?: BivariantHandler | null; onPointerCancel?: BivariantHandler | null; onPointerDown?: BivariantHandler | null; onPointerEnter?: BivariantHandler | null; onPointerLeave?: BivariantHandler | null; onPointerMove?: BivariantHandler | null; onPointerOut?: BivariantHandler | null; onPointerOver?: BivariantHandler | null; onPointerRawUpdate?: BivariantHandler | null; onPointerUp?: BivariantHandler | null; onProgress?: BivariantHandler> | null; onRateChange?: BivariantHandler | null; onReset?: BivariantHandler | null; onResize?: BivariantHandler | null; onScroll?: BivariantHandler | null; onScrollEnd?: BivariantHandler | null; onSecurityPolicyViolation?: BivariantHandler | null; onSeeked?: BivariantHandler | null; onSeeking?: BivariantHandler | null; onSelect?: BivariantHandler | null; onSelectionChange?: BivariantHandler | null; onSelectStart?: BivariantHandler | null; onSlotChange?: BivariantHandler | null; onStalled?: BivariantHandler | null; onSubmit?: BivariantHandler | null; onSuspend?: BivariantHandler | null; onTimeUpdate?: BivariantHandler | null; onToggle?: BivariantHandler | null; onTouchCancel?: BivariantHandler | null; onTouchEnd?: BivariantHandler | null; onTouchMove?: BivariantHandler | null; onTouchStart?: BivariantHandler | null; onTransitionCancel?: BivariantHandler | null; onTransitionEnd?: BivariantHandler | null; onTransitionRun?: BivariantHandler | null; onTransitionStart?: BivariantHandler | null; onVolumeChange?: BivariantHandler | null; onWaiting?: BivariantHandler | null; onWebkitAnimationEnd?: BivariantHandler | null; onWebkitAnimationIteration?: BivariantHandler | null; onWebkitAnimationStart?: BivariantHandler | null; onWebkitTransitionEnd?: BivariantHandler | null; onWheel?: BivariantHandler | null; } type CapturedIntrinsicEventProps = { [ Name in keyof IntrinsicEventProps as `${Name & string}Capture` ]?: IntrinsicEventProps[Name]; }; /** * Props understood specially by intrinsic JSX elements. * * This stays separate from Props so component-level prop bags can remain * intentionally generic while JSX element usage gets stronger contracts. */ interface IntrinsicProps extends IntrinsicEventProps, CapturedIntrinsicEventProps { /** JSX keys are string or number; symbol keys stay in the generic Props bag. */ key?: string | number; children?: unknown; /** * Leaves descendant DOM ownership to an imperative widget after mount. * Askr will continue updating the host element's props, events, and ref. */ imperativeChildren?: boolean; /** Raw HTML for the element's content, written as given (not escaped). */ dangerouslySetInnerHTML?: { __html: string | null | undefined } | null; class?: ReactiveProp; className?: ReactiveProp; style?: ReactiveProp; ref?: IntrinsicRef; id?: ReactiveProp; title?: ReactiveProp; role?: ReactiveProp; tabIndex?: ReactiveProp; hidden?: ReactiveProp; dir?: ReactiveProp; lang?: ReactiveProp; contentEditable?: ReactiveProp; draggable?: ReactiveProp; enterKeyHint?: ReactiveProp; inputMode?: ReactiveProp; spellCheck?: ReactiveProp; writingSuggestions?: ReactiveProp; [attr: `aria-${string}`]: ReactiveProp; [attr: `data-${string}`]: ReactiveProp; /** * Assigns the DOM property after the prefix, verbatim (`prop:srcObject`). * Never written as an attribute, and never rendered by SSR. */ [prop: `prop:${string}`]: unknown; /** * Writes the attribute after the prefix as named, where Askr would otherwise * set a property (`attr:config` on a custom element). */ [attr: `attr:${string}`]: ReactiveProp; } /** * Fallback intrinsic props for arbitrary tag names and dynamic prop spreads. * * This keeps the generic runtime-friendly `Props` bag available where the * renderer intentionally accepts unknown attributes, while known high-use * elements can be declared more precisely in JSX.IntrinsicElements. */ type IntrinsicFallbackProps = IntrinsicProps & Props; type ForbiddenLayoutOnlyProps = { action?: never; alt?: never; abbr?: never; autoComplete?: never; autocomplete?: never; checked?: never; colSpan?: never; cols?: never; disabled?: never; form?: never; headers?: never; height?: never; href?: never; htmlFor?: never; label?: never; method?: never; maxLength?: never; maxlength?: never; minLength?: never; minlength?: never; multiple?: never; name?: never; noValidate?: never; placeholder?: never; readOnly?: never; readonly?: never; rel?: never; required?: never; rowSpan?: never; rows?: never; scope?: never; selected?: never; src?: never; target?: never; type?: never; value?: never; width?: never; }; type StructuredContentIntrinsicProps = IntrinsicFallbackProps & Omit & TAllowed; type LayoutIntrinsicProps = StructuredContentIntrinsicProps; type OrderedListIntrinsicProps = StructuredContentIntrinsicProps<{ reversed?: ReactiveProp; start?: ReactiveProp; type?: ReactiveProp; }>; type ListItemIntrinsicProps = StructuredContentIntrinsicProps<{ value?: ReactiveProp; }>; type TableCellIntrinsicAllowedProps = { colSpan?: ReactiveProp; headers?: ReactiveProp; rowSpan?: ReactiveProp; }; type TableHeaderScopeValue = | 'col' | 'colgroup' | 'row' | 'rowgroup' | null | undefined; type TableCellIntrinsicProps = StructuredContentIntrinsicProps; type TableHeaderIntrinsicProps = StructuredContentIntrinsicProps< TableCellIntrinsicAllowedProps & { abbr?: ReactiveProp; scope?: ReactiveProp; } >; interface AnchorIntrinsicProps extends IntrinsicProps { href?: ReactiveProp; rel?: ReactiveProp; target?: ReactiveProp; } interface ButtonIntrinsicProps extends IntrinsicProps { disabled?: ReactiveProp; formAction?: ReactiveProp; formEncType?: ReactiveProp; formMethod?: ReactiveProp; formNoValidate?: ReactiveProp; formTarget?: ReactiveProp; name?: ReactiveProp; type?: ReactiveProp; value?: ReactiveProp; } interface FormIntrinsicProps extends IntrinsicProps { action?: ReactiveProp; autoComplete?: ReactiveProp; autocomplete?: ReactiveProp; method?: ReactiveProp; noValidate?: ReactiveProp; } interface ImageIntrinsicProps extends IntrinsicProps { alt?: ReactiveProp; height?: ReactiveProp; src?: ReactiveProp; width?: ReactiveProp; } interface InputIntrinsicProps extends IntrinsicProps { formAction?: ReactiveProp; formEncType?: ReactiveProp; formMethod?: ReactiveProp; formNoValidate?: ReactiveProp; formTarget?: ReactiveProp; autoComplete?: ReactiveProp; autocomplete?: ReactiveProp; checked?: ReactiveProp; disabled?: ReactiveProp; /** Sets the `indeterminate` property; there is no attribute to render. */ indeterminate?: ReactiveProp; maxLength?: ReactiveProp; maxlength?: ReactiveProp; minLength?: ReactiveProp; minlength?: ReactiveProp; name?: ReactiveProp; placeholder?: ReactiveProp; readOnly?: ReactiveProp; readonly?: ReactiveProp; required?: ReactiveProp; type?: ReactiveProp; value?: ReactiveProp; } interface LabelIntrinsicProps extends IntrinsicProps { htmlFor?: ReactiveProp; } type OutputIntrinsicProps = StructuredContentIntrinsicProps<{ form?: ReactiveProp; htmlFor?: ReactiveProp; name?: ReactiveProp; }>; type SvgPresentationIntrinsicAllowedProps = { alignmentBaseline?: ReactiveProp; baselineShift?: ReactiveProp; clipPath?: ReactiveProp; clipRule?: ReactiveProp; colorInterpolation?: ReactiveProp; colorInterpolationFilters?: ReactiveProp; colorRendering?: ReactiveProp; dominantBaseline?: ReactiveProp; fill?: ReactiveProp; fillOpacity?: ReactiveProp; fillRule?: ReactiveProp; floodColor?: ReactiveProp; floodOpacity?: ReactiveProp; fontFamily?: ReactiveProp; fontSize?: ReactiveProp; fontSizeAdjust?: ReactiveProp; fontStretch?: ReactiveProp; fontStyle?: ReactiveProp; fontVariant?: ReactiveProp; fontWeight?: ReactiveProp; imageRendering?: ReactiveProp; letterSpacing?: ReactiveProp; lightingColor?: ReactiveProp; markerEnd?: ReactiveProp; markerMid?: ReactiveProp; markerStart?: ReactiveProp; maskType?: ReactiveProp; paintOrder?: ReactiveProp; pointerEvents?: ReactiveProp; shapeRendering?: ReactiveProp; stopColor?: ReactiveProp; stopOpacity?: ReactiveProp; stroke?: ReactiveProp; strokeDasharray?: ReactiveProp; strokeDashoffset?: ReactiveProp; strokeLinecap?: ReactiveProp; strokeLinejoin?: ReactiveProp; strokeMiterlimit?: ReactiveProp; strokeOpacity?: ReactiveProp; strokeWidth?: ReactiveProp; textAnchor?: ReactiveProp; textDecoration?: ReactiveProp; textOverflow?: ReactiveProp; textRendering?: ReactiveProp; transformOrigin?: ReactiveProp; unicodeBidi?: ReactiveProp; vectorEffect?: ReactiveProp; whiteSpace?: ReactiveProp; wordSpacing?: ReactiveProp; writingMode?: ReactiveProp; }; type SvgIntrinsicProps = StructuredContentIntrinsicProps< SvgPresentationIntrinsicAllowedProps & { height?: ReactiveProp; viewBox?: ReactiveProp; width?: ReactiveProp; xmlns?: ReactiveProp; } >; type SvgCircleIntrinsicProps = StructuredContentIntrinsicProps< SvgPresentationIntrinsicAllowedProps & { cx?: ReactiveProp; cy?: ReactiveProp; r?: ReactiveProp; } >; type SvgGroupIntrinsicProps = StructuredContentIntrinsicProps; type SvgPathIntrinsicProps = StructuredContentIntrinsicProps< SvgPresentationIntrinsicAllowedProps & { d?: ReactiveProp; } >; type SvgRectIntrinsicProps = StructuredContentIntrinsicProps< SvgPresentationIntrinsicAllowedProps & { height?: ReactiveProp; rx?: ReactiveProp; ry?: ReactiveProp; width?: ReactiveProp; x?: ReactiveProp; y?: ReactiveProp; } >; interface OptionIntrinsicProps extends IntrinsicProps { disabled?: ReactiveProp; label?: ReactiveProp; selected?: ReactiveProp; value?: ReactiveProp; } interface SelectIntrinsicProps extends IntrinsicProps { disabled?: ReactiveProp; multiple?: ReactiveProp; name?: ReactiveProp; required?: ReactiveProp; value?: ReactiveProp; } interface TextareaIntrinsicProps extends IntrinsicProps { autoComplete?: ReactiveProp; autocomplete?: ReactiveProp; cols?: ReactiveProp; disabled?: ReactiveProp; maxLength?: ReactiveProp; maxlength?: ReactiveProp; minLength?: ReactiveProp; minlength?: ReactiveProp; name?: ReactiveProp; placeholder?: ReactiveProp; readOnly?: ReactiveProp; readonly?: ReactiveProp; required?: ReactiveProp; rows?: ReactiveProp; value?: ReactiveProp; } interface KnownIntrinsicElementPropsBase { a: AnchorIntrinsicProps; article: LayoutIntrinsicProps; aside: LayoutIntrinsicProps; blockquote: LayoutIntrinsicProps; button: ButtonIntrinsicProps; caption: LayoutIntrinsicProps; circle: SvgCircleIntrinsicProps; code: LayoutIntrinsicProps; div: LayoutIntrinsicProps; em: LayoutIntrinsicProps; figcaption: LayoutIntrinsicProps; figure: LayoutIntrinsicProps; form: FormIntrinsicProps; footer: LayoutIntrinsicProps; g: SvgGroupIntrinsicProps; h1: LayoutIntrinsicProps; h2: LayoutIntrinsicProps; h3: LayoutIntrinsicProps; h4: LayoutIntrinsicProps; h5: LayoutIntrinsicProps; h6: LayoutIntrinsicProps; header: LayoutIntrinsicProps; img: ImageIntrinsicProps; input: InputIntrinsicProps; label: LabelIntrinsicProps; li: ListItemIntrinsicProps; main: LayoutIntrinsicProps; nav: LayoutIntrinsicProps; ol: OrderedListIntrinsicProps; option: OptionIntrinsicProps; output: OutputIntrinsicProps; p: LayoutIntrinsicProps; path: SvgPathIntrinsicProps; pre: LayoutIntrinsicProps; rect: SvgRectIntrinsicProps; section: LayoutIntrinsicProps; select: SelectIntrinsicProps; small: LayoutIntrinsicProps; span: LayoutIntrinsicProps; strong: LayoutIntrinsicProps; svg: SvgIntrinsicProps; table: LayoutIntrinsicProps; tbody: LayoutIntrinsicProps; td: TableCellIntrinsicProps; tfoot: LayoutIntrinsicProps; th: TableHeaderIntrinsicProps; thead: LayoutIntrinsicProps; textarea: TextareaIntrinsicProps; title: LayoutIntrinsicProps; tr: LayoutIntrinsicProps; ul: LayoutIntrinsicProps; } type WithElementRef = { [Key in keyof Props]: Key extends 'ref' ? IntrinsicRef : Props[Key]; }; type KnownIntrinsicElementProps = { [Tag in keyof KnownIntrinsicElementPropsBase]: WithElementRef< KnownIntrinsicElementPropsBase[Tag], IntrinsicElementForTag >; }; /** The element type marker for JSX fragments (`<>...`), groups children without a wrapper element. */ declare const Fragment: unique symbol; /** A component function accepting `TProps`, usable as a JSX element's `type`. */ type JSXComponent = { bivarianceHack(props: TProps): unknown; }['bivarianceHack']; /** Valid `type` values for a JSX element: a tag name, a component, or a symbol (e.g. `Fragment`). */ type JSXElementType = string | JSXComponent | symbol; /** The vnode shape produced by JSX/`jsx()` calls. */ interface JSXElement { /** Internal element marker */ $$typeof: symbol; /** Element type: string, component, Fragment, etc */ type: JSXElementType; /** Props bag */ props: Props; /** Optional key (normalized by runtime) */ key?: string | number | null; } export { IntrinsicFallbackProps, MathMLExtraTag, IntrinsicRef, IntrinsicElementForTag, JSXElementType, JSXComponent, KnownIntrinsicElementProps, JSXElement, Props, Fragment, };