import type { ReactNode } from "react"; import type { DOMChangeEvent, DOMClickEvent, DOMImageErrorEvent, DOMImageLoadEvent, DOMInputEvent, DOMKeyEvent } from "./events"; /** the aria roles an author may set, excluding the abstract roles */ export type AriaRole = "alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "document" | "emphasis" | "feed" | "figure" | "form" | "grid" | "gridcell" | "group" | "heading" | "img" | "input" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "meter" | "navigation" | "none" | "note" | "option" | "paragraph" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem"; /** the autofill hints web and react native both understand */ export type AutoComplete = "additional-name" | "address-line1" | "address-line2" | "birthdate-day" | "birthdate-full" | "birthdate-month" | "birthdate-year" | "cc-csc" | "cc-exp" | "cc-exp-day" | "cc-exp-month" | "cc-exp-year" | "cc-number" | "cc-name" | "cc-given-name" | "cc-middle-name" | "cc-family-name" | "cc-type" | "country" | "current-password" | "email" | "family-name" | "gender" | "given-name" | "honorific-prefix" | "honorific-suffix" | "name" | "name-family" | "name-given" | "name-middle" | "name-middle-initial" | "name-prefix" | "name-suffix" | "new-password" | "nickname" | "on" | "one-time-code" | "organization" | "organization-title" | "password" | "password-new" | "postal-address" | "postal-address-country" | "postal-address-extended" | "postal-address-extended-postal-code" | "postal-address-locality" | "postal-address-region" | "postal-code" | "street-address" | "sms-otp" | "tel" | "tel-country-code" | "tel-national" | "tel-device" | "url" | "username" | "username-new" | "off"; /** every html input type; the ones native cannot render are a native build error */ export type InputType = "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "month" | "number" | "password" | "radio" | "range" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week"; /** * `data-*` passthrough. Only `data-testid` reaches native, as `testID`; the * rest are web attributes. */ export interface StrictDOMDataProps { [key: `data-${string}`]: string | number | boolean | undefined; } /** * Everything every tag accepts. Element interfaces extend this rather than * restating it, so a tag costs one interface to instantiate. */ export interface StrictDOMPropsBase extends StrictDOMDataProps { /** @platform web */ "aria-activedescendant"?: string; /** @platform web */ "aria-atomic"?: boolean; /** @platform web */ "aria-autocomplete"?: "none" | "inline" | "list" | "both"; "aria-busy"?: boolean; "aria-checked"?: boolean | "mixed"; /** @platform web */ "aria-colcount"?: number; /** @platform web */ "aria-colindex"?: number; /** @platform web */ "aria-colindextext"?: string; /** @platform web */ "aria-colspan"?: number; /** @platform web */ "aria-controls"?: string; /** @platform web */ "aria-current"?: boolean | "page" | "step" | "location" | "date" | "time"; /** * react native has no described-by relationship; put the description in aria-label instead * @platform web */ "aria-describedby"?: string; /** @platform web */ "aria-details"?: string; "aria-disabled"?: boolean; /** @platform web */ "aria-errormessage"?: string; "aria-expanded"?: boolean; /** @platform web */ "aria-flowto"?: string; /** @platform web */ "aria-haspopup"?: "menu" | "listbox" | "tree" | "grid" | "dialog"; /** also sets importantForAccessibility on android so descendants are hidden */ "aria-hidden"?: boolean; /** @platform web */ "aria-invalid"?: boolean | "grammar" | "spelling"; /** @platform web */ "aria-keyshortcuts"?: string; "aria-label"?: string; "aria-labelledby"?: string; /** @platform web */ "aria-level"?: number; "aria-live"?: "off" | "assertive" | "polite"; "aria-modal"?: boolean; /** @platform web */ "aria-multiline"?: boolean; /** @platform web */ "aria-multiselectable"?: boolean; /** @platform web */ "aria-orientation"?: "horizontal" | "vertical"; /** @platform web */ "aria-owns"?: string; /** @platform web */ "aria-placeholder"?: string; /** @platform web */ "aria-posinset"?: number; /** @platform web */ "aria-pressed"?: boolean | "mixed"; /** @platform web */ "aria-readonly"?: boolean; /** @platform web */ "aria-required"?: boolean; /** @platform web */ "aria-roledescription"?: string; /** @platform web */ "aria-rowcount"?: number; /** @platform web */ "aria-rowindex"?: number; /** @platform web */ "aria-rowindextext"?: string; /** @platform web */ "aria-rowspan"?: number; "aria-selected"?: boolean; /** @platform web */ "aria-setsize"?: number; /** @platform web */ "aria-sort"?: "none" | "ascending" | "descending" | "other"; "aria-valuemax"?: number; "aria-valuemin"?: number; "aria-valuenow"?: number; "aria-valuetext"?: string; /** * focus a native element through a ref in an effect instead * @platform web */ autoFocus?: boolean; dir?: "auto" | "ltr" | "rtl"; /** * element timing is a browser performance api * @platform web */ elementTiming?: string; /** native applies display none and has no until-found reveal */ hidden?: true | "hidden" | "until-found"; id?: string; /** @platform web */ inert?: boolean; /** @platform web */ lang?: string; role?: AriaRole; tabIndex?: 0 | -1; /** @platform web */ suppressHydrationWarning?: boolean; "data-testid"?: string; onPointerCancel?: (event: unknown) => void; onPointerDown?: (event: unknown) => void; onPointerEnter?: (event: unknown) => void; onPointerLeave?: (event: unknown) => void; onPointerMove?: (event: unknown) => void; onPointerOut?: (event: unknown) => void; onPointerOver?: (event: unknown) => void; onPointerUp?: (event: unknown) => void; onGotPointerCapture?: (event: unknown) => void; onLostPointerCapture?: (event: unknown) => void; onTouchCancel?: (event: unknown) => void; onTouchEnd?: (event: unknown) => void; onTouchMove?: (event: unknown) => void; onTouchStart?: (event: unknown) => void; /** native builds the click payload from the press event; preventDefault and stopPropagation are no-ops because there is nothing to cancel */ onClick?: (event: DOMClickEvent) => void; /** * native has no secondary pointer button * @platform web */ onAuxClick?: (event: unknown) => void; /** * native has no context menu event; use a long press * @platform web */ onContextMenu?: (event: unknown) => void; /** native focus events only fire on elements that can hold focus, which is text entry and pressable elements */ onBlur?: (event: unknown) => void; /** native focus events only fire on elements that can hold focus, which is text entry and pressable elements */ onFocus?: (event: unknown) => void; /** * native has no bubbling focus event; use onFocus * @platform web */ onFocusIn?: (event: unknown) => void; /** * native has no bubbling blur event; use onBlur * @platform web */ onFocusOut?: (event: unknown) => void; /** native only reports key presses inside a text-entry control, and reports the submit key as Enter */ onKeyDown?: (event: DOMKeyEvent) => void; /** * react native reports key presses, not key releases * @platform web */ onKeyUp?: (event: unknown) => void; /** * native has no clipboard events * @platform web */ onCopy?: (event: unknown) => void; /** * native has no clipboard events * @platform web */ onCut?: (event: unknown) => void; /** * native has no clipboard events * @platform web */ onPaste?: (event: unknown) => void; /** * fullscreen is a browser api * @platform web */ onFullscreenChange?: (event: unknown) => void; /** * fullscreen is a browser api * @platform web */ onFullscreenError?: (event: unknown) => void; onScroll?: (event: unknown) => void; /** * native has no wheel input * @platform web */ onWheel?: (event: unknown) => void; onMouseDown?: (event: unknown) => void; onMouseEnter?: (event: unknown) => void; onMouseLeave?: (event: unknown) => void; /** * use onPointerMove for cross-platform pointer input * @platform web */ onMouseMove?: (event: unknown) => void; onMouseOut?: (event: unknown) => void; onMouseOver?: (event: unknown) => void; onMouseUp?: (event: unknown) => void; } export interface StrictDOMAnchorProps extends StrictDOMPropsBase { /** @platform web */ download?: string; /** * native has no navigation; handle onClick and call your router or Linking * @platform web */ href?: string; /** native honours it for image requests only */ referrerPolicy?: "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"; /** @platform web */ rel?: string; /** @platform web */ target?: "_self" | "_blank" | "_parent" | "_top"; children?: ReactNode; } export interface StrictDOMProps extends StrictDOMPropsBase { children?: ReactNode; } /** the common interface for a tag that takes no children: br and hr */ export interface StrictDOMVoidProps extends StrictDOMPropsBase { children?: never; } export interface StrictDOMButtonProps extends StrictDOMPropsBase { /** native also clears focusable, and editable on a text-entry control */ disabled?: boolean; type?: "button" | "submit"; children?: ReactNode; } export interface StrictDOMImageProps extends StrictDOMPropsBase { alt?: string; crossOrigin?: "anonymous" | "use-credentials"; /** @platform web */ decoding?: "async" | "auto" | "sync"; /** @platform web */ draggable?: boolean; /** @platform web */ fetchPriority?: "high" | "low" | "auto"; height?: number; /** @platform web */ loading?: "eager" | "lazy"; /** native honours it for image requests only */ referrerPolicy?: "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"; src?: string; srcSet?: string; width?: number; onError?: (event: DOMImageErrorEvent) => void; /** native reports naturalWidth and naturalHeight from the decoded source */ onLoad?: (event: DOMImageLoadEvent) => void; children?: never; } export interface StrictDOMInputProps extends StrictDOMPropsBase { autoCapitalize?: "none" | "sentences" | "words" | "characters"; autoComplete?: AutoComplete; /** * checkbox and radio inputs have no native rendering * @platform web */ checked?: boolean | "mixed"; /** * checkbox and radio inputs have no native rendering * @platform web */ defaultChecked?: boolean; defaultValue?: string; /** native also clears focusable, and editable on a text-entry control */ disabled?: boolean; enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send"; inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; /** @platform web */ max?: string | number; maxLength?: number; /** @platform web */ min?: string | number; /** @platform web */ minLength?: number; /** @platform web */ multiple?: boolean; /** * form field names only matter to a form submission, which native does not have * @platform web */ name?: string; placeholder?: string; readOnly?: boolean; /** * native has no form validation * @platform web */ required?: boolean; /** ios only on native */ spellCheck?: boolean; /** @platform web */ step?: number | "any"; /** on native the type selects the keyboard and secure entry rather than reaching one prop, and the types with no text-entry control are a build error */ type?: InputType; value?: string; /** * native text entry reports changes only after they are applied * @platform web */ onBeforeInput?: (event: unknown) => void; /** native fires on every keystroke like onInput, because there is no commit-on-blur change event */ onChange?: (event: DOMChangeEvent) => void; onInput?: (event: DOMInputEvent) => void; /** * native has no form validation * @platform web */ onInvalid?: (event: unknown) => void; /** * read the selection through the element ref instead * @platform web */ onSelect?: (event: unknown) => void; children?: never; } export interface StrictDOMLabelProps extends StrictDOMPropsBase { /** * native has no label association; wrap the control or drive it from your own state * @platform web */ for?: string; children?: ReactNode; } export interface StrictDOMListItemProps extends StrictDOMPropsBase { /** the list counter is not rendered on either platform, matching the list-style reset */ value?: number; children?: ReactNode; } export interface StrictDOMOptionGroupProps extends StrictDOMPropsBase { /** native also clears focusable, and editable on a text-entry control */ disabled?: boolean; /** @platform web */ label?: string; children?: ReactNode; } export interface StrictDOMOptionProps extends StrictDOMPropsBase { /** native also clears focusable, and editable on a text-entry control */ disabled?: boolean; /** @platform web */ label?: string; value?: string; children?: string | number; } export interface StrictDOMSelectProps extends StrictDOMPropsBase { autoComplete?: AutoComplete; defaultValue?: string | readonly string[]; /** @platform web */ multiple?: boolean; /** * form field names only matter to a form submission, which native does not have * @platform web */ name?: string; /** * native has no form validation * @platform web */ required?: boolean; value?: string | readonly string[]; /** * native text entry reports changes only after they are applied * @platform web */ onBeforeInput?: (event: unknown) => void; /** native fires on every keystroke like onInput, because there is no commit-on-blur change event */ onChange?: (event: DOMChangeEvent) => void; onInput?: (event: DOMInputEvent) => void; /** * native has no form validation * @platform web */ onInvalid?: (event: unknown) => void; /** * read the selection through the element ref instead * @platform web */ onSelect?: (event: unknown) => void; children?: ReactNode; } export interface StrictDOMTextAreaProps extends StrictDOMPropsBase { autoCapitalize?: "none" | "sentences" | "words" | "characters"; autoComplete?: AutoComplete; defaultValue?: string; /** native also clears focusable, and editable on a text-entry control */ disabled?: boolean; enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send"; inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search"; maxLength?: number; /** @platform web */ minLength?: number; /** * form field names only matter to a form submission, which native does not have * @platform web */ name?: string; placeholder?: string; readOnly?: boolean; /** * native has no form validation * @platform web */ required?: boolean; rows?: number; /** ios only on native */ spellCheck?: boolean; value?: string; /** * native text entry reports changes only after they are applied * @platform web */ onBeforeInput?: (event: unknown) => void; /** native fires on every keystroke like onInput, because there is no commit-on-blur change event */ onChange?: (event: DOMChangeEvent) => void; onInput?: (event: DOMInputEvent) => void; /** * native has no form validation * @platform web */ onInvalid?: (event: unknown) => void; /** * read the selection through the element ref instead * @platform web */ onSelect?: (event: unknown) => void; children?: never; } /** the props interface for each tag in the DOM contract */ export type StrictDOMPropsByTag = { a: StrictDOMAnchorProps; article: StrictDOMProps; aside: StrictDOMProps; b: StrictDOMProps; bdi: StrictDOMProps; bdo: StrictDOMProps; blockquote: StrictDOMProps; br: StrictDOMVoidProps; button: StrictDOMButtonProps; code: StrictDOMProps; del: StrictDOMProps; div: StrictDOMProps; em: StrictDOMProps; fieldset: StrictDOMProps; footer: StrictDOMProps; form: StrictDOMProps; h1: StrictDOMProps; h2: StrictDOMProps; h3: StrictDOMProps; h4: StrictDOMProps; h5: StrictDOMProps; h6: StrictDOMProps; header: StrictDOMProps; hr: StrictDOMVoidProps; i: StrictDOMProps; img: StrictDOMImageProps; input: StrictDOMInputProps; ins: StrictDOMProps; kbd: StrictDOMProps; label: StrictDOMLabelProps; li: StrictDOMListItemProps; main: StrictDOMProps; mark: StrictDOMProps; nav: StrictDOMProps; ol: StrictDOMProps; optgroup: StrictDOMOptionGroupProps; option: StrictDOMOptionProps; p: StrictDOMProps; pre: StrictDOMProps; s: StrictDOMProps; section: StrictDOMProps; select: StrictDOMSelectProps; span: StrictDOMProps; strong: StrictDOMProps; sub: StrictDOMProps; sup: StrictDOMProps; textarea: StrictDOMTextAreaProps; u: StrictDOMProps; ul: StrictDOMProps; }; //# sourceMappingURL=props.d.ts.map