import { type ReactNode } from "react"; import { View, type ColorTokens, type ViewStyle, type TextStyle, type TouchTargetSkin, type LayoutStyle } from "../../style/index.js"; export interface SwitchProps { /** Controlled on/off state; omit for uncontrolled use. */ checked?: boolean; /** Initial state for uncontrolled use (a bare is interactive). */ defaultChecked?: boolean; /** Fired with the next checked value when the switch is toggled (both modes). Web keyboard activation supports Space on release and Enter. */ onChange?: (next: boolean) => void; /** Alias of onChange, for parity with RN's value-style callbacks. */ onValueChange?: (next: boolean) => void; /** E2E hook forwarded to the pressable row. */ testID?: string; small?: boolean; large?: boolean; /** A compact bordered capsule with its label after the switch, for a toolbar setting. */ chip?: boolean; /** * A row of a settings list: 10 px above and below the row, so a stack of switches reads * as a list rather than a form (stack them in a `Column tight`). Pair with `divided` on * every row after the first. */ listed?: boolean; /** A hairline above the row in the `border` ink: a settings list's separator from the row before. */ divided?: boolean; disabled?: boolean; /** Optional label, rendered to the left of the track. */ children?: ReactNode; /** Optional muted description line, rendered under the label. */ description?: ReactNode; /** * Accessible name for the switch when no visible `children` label is rendered * (e.g. a switch embedded in an Action Panel whose label sits in sibling Text). * Without it, a label-less switch announces only "switch, on/off". */ accessibilityLabel?: string; /** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */ style?: LayoutStyle; } export type Size = "small" | "base" | "large"; export declare function sizeOf(p: SwitchProps): Size; export interface SwitchSkin extends TouchTargetSkin { track: (tokens: ColorTokens, dark: boolean, checked: boolean, size: Size) => ViewStyle; thumb: (tokens: ColorTokens, checked: boolean, size: Size) => ViewStyle; /** The track's look under a hovering pointer (the web's glow on an on switch); omit for none. */ hover?: (tokens: ColorTokens, checked: boolean, size: Size) => ViewStyle | null; /** Compact toolbar form, where the platform offers one. */ chip?: { root: (tokens: ColorTokens) => ViewStyle; track: (tokens: ColorTokens, checked: boolean) => ViewStyle; thumb: (tokens: ColorTokens, checked: boolean) => ViewStyle; label: (tokens: ColorTokens, checked: boolean) => TextStyle; }; } /** Build a Switch component from a platform skin. * @ref Ref to the interactive switch row, including its label. Typed as a React Native View. On web, React Native Web exposes its DOM host; focus() and blur() move browser focus. Native host behavior depends on the platform and React Native version. Calling focus() does not activate the control or call accessibility focus APIs. */ export declare function createSwitch(skin: SwitchSkin): import("react").ForwardRefExoticComponent>; //# sourceMappingURL=switch.shared.d.ts.map