/** @jsxImportSource react */ import type { RenderingContext } from "../../ui/RenderingContext"; import type { Instance } from "../../ui/Instance"; import { Field, FieldConfig, FieldInstance } from "./Field"; import { BooleanProp, StringProp, StyleProp } from "../../ui/Prop"; export interface SwitchConfig extends FieldConfig { /** Value indicating that switch is on. */ on?: BooleanProp; /** Value indicating that switch is off. */ off?: BooleanProp; /** Value indicating that switch is on. */ value?: BooleanProp; /** Defaults to `false`. Used to make the field read-only. */ readOnly?: BooleanProp; /** Text description. */ text?: StringProp; /** Style object to be applied on the axis range when the switch is on. */ rangeStyle?: StyleProp; /** Style object to be applied on the switch handle. */ handleStyle?: StyleProp; /** Base CSS class to be applied to the field. Defaults to `switch`. */ baseClass?: string; /** Determines if button should receive focus on mousedown event. Default is `false`. */ focusOnMouseDown?: boolean; /** Custom validation function. */ onValidate?: string | ((value: boolean, instance: Instance, validationParams: Record) => unknown); } export declare class Switch extends Field { on?: unknown; off?: unknown; value?: unknown; rangeStyle?: Record | string; handleStyle?: Record | string; focusOnMouseDown?: boolean; constructor(config?: SwitchConfig); declareData(...args: Record[]): void; isEmpty(): boolean; init(): void; prepareData(context: RenderingContext, instance: FieldInstance): void; renderInput(context: RenderingContext, instance: FieldInstance, key: string): React.ReactElement; toggle(e: React.MouseEvent | React.KeyboardEvent, instance: Instance): void; } //# sourceMappingURL=Switch.d.ts.map