/** * createToggle - the HEADLESS core behind , in the same spirit * as `createSvGrid`: a tiny controlled state machine (a single pressed on/off * bit + ARIA) exposed as **prop-getters** you spread onto YOUR OWN markup. No * styles, no DOM assumptions. * * ```svelte * * * ``` * * The styled is just one renderer over this core. */ /** Reactive inputs are passed as getters so the core tracks live prop changes * (the same controlled pattern used across the SvGrid UI kit). */ export type ToggleConfig = { pressed: () => boolean; onChange?: (pressed: boolean) => void; disabled?: () => boolean; id?: () => string | undefined; invalid?: () => boolean; required?: () => boolean; error?: () => string | undefined; hint?: () => string | undefined; ariaLabel?: () => string | undefined; }; export type ToggleButtonProps = { type: 'button'; id: string | undefined; 'aria-pressed': boolean; 'aria-invalid': 'true' | undefined; 'aria-required': 'true' | undefined; 'aria-describedby': string | undefined; 'aria-label': string | undefined; disabled: boolean; 'data-pressed': '' | undefined; onclick: () => void; }; export type Toggle = { /** Current pressed state. */ readonly pressed: boolean; readonly disabled: boolean; /** Flip pressed (no-op when disabled). */ toggle: () => void; /** Spread onto the button element. */ buttonProps: () => ToggleButtonProps; }; export declare function createToggle(config: ToggleConfig): Toggle;