import React from "react"; import type { XOR } from "ts-xor"; interface CommonCheckboxProps { /** * Label to be displayed beside the checkbox */ readonly label?: string; /** * Default value for when the checkbox is uncontrolled */ readonly defaultChecked?: boolean; /** * When true, the checkbox is shown as indeterminate */ readonly indeterminate?: boolean; /** * Checkbox is disabled */ readonly disabled?: boolean; /** * Assistive Text, shown under label */ readonly assistiveText?: string; /** * Accessibility Label for the checkbox. Defaults to label */ readonly accessibilityLabel?: string; /** * Press handler */ onChange?(value: boolean): void; /** * If the checkbox is checked. This should be set when this is intended as a controlled component */ readonly checked?: boolean; /** * Name of the checkbox; this is important when using in a form component */ readonly name?: string; } interface ControlledCheckboxProps extends CommonCheckboxProps { /** * Press handler */ onChange(value: boolean): void; /** * If the checkbox is checked. This should be set when this is intended as a controlled component */ readonly checked: boolean; } interface UncontrolledCheckboxProps extends CommonCheckboxProps { /** * Name of the checkbox; this is important when using in a form component */ readonly name: string; } export type CheckboxProps = XOR; export declare function Checkbox(props: CheckboxProps): React.JSX.Element; export {};