import * as React from 'react'; import { Pressable } from 'react-native'; import type { ZestUIComponentProps } from '../../types'; import { type ZestChangeEventDetails } from '../../utils/createChangeEventDetails'; import { REASONS } from '../../utils/reasons'; /** * Represents the switch itself. * Renders a ``. * * Unlike the web version there is no hidden ``: React Native has no * native form submission, so `name`/`value`/`form` props are omitted. */ export declare function SwitchRoot(componentProps: SwitchRoot.Props): React.JSX.Element; export interface SwitchRootState { /** * Whether the switch is currently active. */ checked: boolean; /** * Whether the component should ignore user interaction. */ disabled: boolean; /** * Whether the user should be unable to activate or deactivate the switch. */ readOnly: boolean; /** * Whether the user must activate the switch before submitting a form. */ required: boolean; } export interface SwitchRootProps extends Omit, 'onPress'> { /** * Whether the switch is currently active. * * To render an uncontrolled switch, use the `defaultChecked` prop instead. */ checked?: boolean | undefined; /** * Whether the switch is initially active. * * To render a controlled switch, use the `checked` prop instead. * @default false */ defaultChecked?: boolean | undefined; /** * Whether the component should ignore user interaction. * @default false */ disabled?: boolean | undefined; /** * Event handler called when the switch is activated or deactivated. */ onCheckedChange?: ((checked: boolean, eventDetails: SwitchRoot.ChangeEventDetails) => void) | undefined; /** * Whether the user should be unable to activate or deactivate the switch. * @default false */ readOnly?: boolean | undefined; /** * Whether the user must activate the switch before submitting a form. * @default false */ required?: boolean | undefined; } export type SwitchRootChangeEventReason = typeof REASONS.none; export declare namespace SwitchRoot { type State = SwitchRootState; type Props = SwitchRootProps; type ChangeEventReason = SwitchRootChangeEventReason; type ChangeEventDetails = ZestChangeEventDetails; } //# sourceMappingURL=SwitchRoot.d.ts.map