import type { JSX } from 'solid-js'; export interface CheckStateControlledOptions { checked: boolean | undefined; disabled?: boolean; onChange?: (state?: boolean) => void; } export interface CheckStateUncontrolledOptions { defaultChecked: boolean | undefined; disabled?: boolean; onChange?: (state?: boolean) => void; } export type CheckStateOptions = CheckStateControlledOptions | CheckStateUncontrolledOptions; export interface CheckStateProperties { checked: () => boolean | undefined; setState: (newState?: boolean) => void; disabled: () => boolean; check: () => void; uncheck: () => void; reset: () => void; toggle: () => void; } /** * Creates a tri-state checkbox value: `true`, `false`, or `undefined` for * indeterminate. Backs `Checkbox`. * * Pass `defaultChecked` for uncontrolled state or `checked` for controlled. * * @see {@link https://github.com/lxsmnsyc/terracotta/blob/main/docs/states.md#check-state} */ export declare function createCheckState(options: CheckStateOptions): CheckStateProperties; export interface CheckStateRenderProps { children?: JSX.Element | ((state: CheckStateProperties) => JSX.Element); } export interface CheckStateProviderProps extends CheckStateRenderProps { state: CheckStateProperties; } export declare function CheckStateProvider(props: CheckStateProviderProps): JSX.Element; /** * Reads the nearest check state from context. Throws when there is none. * * @see {@link https://github.com/lxsmnsyc/terracotta/blob/main/docs/states.md#check-state} */ export declare function useCheckState(): CheckStateProperties; /** * Passes the nearest check state to a render prop. A function child is treated * as a render prop only when it declares exactly one parameter. * * @see {@link https://github.com/lxsmnsyc/terracotta/blob/main/docs/states.md#check-state} */ export declare function CheckStateChild(props: CheckStateRenderProps): JSX.Element; //# sourceMappingURL=create-check-state.d.ts.map