import * as _spartan_ng_brain_forms from '@spartan-ng/brain/forms'; import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms'; import * as _angular_core from '@angular/core'; import { AfterContentInit, OnDestroy, ElementRef } from '@angular/core'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import { ControlValueAccessor } from '@angular/forms'; import * as i1 from '@spartan-ng/brain/field'; declare const BRN_SWITCH_VALUE_ACCESSOR: { provide: _angular_core.InjectionToken; useExisting: _angular_core.Type; multi: boolean; }; type BrnSwitchSize = 'default' | 'sm'; declare class BrnSwitch implements AfterContentInit, OnDestroy, ControlValueAccessor { private readonly _destroyRef; private readonly _renderer; private readonly _isBrowser; private readonly _elementRef; private readonly _focusMonitor; private readonly _cdr; private readonly _document; private readonly _fieldControl; protected readonly _focusVisible: _angular_core.WritableSignal; protected readonly _focused: _angular_core.WritableSignal; /** * Whether switch is checked/toggled on. * Can be bound with [(checked)] for two-way binding. */ readonly checkedInput: _angular_core.InputSignalWithTransform; readonly checked: _angular_core.WritableSignal; /** Emits when checked state changes. */ readonly checkedChange: _angular_core.OutputEmitterRef; /** * Unique identifier for switch component. * When provided, inner button gets ID without '-switch' suffix. * Auto-generates ID if not provided. */ readonly id: _angular_core.InputSignal; /** * Form control name for switch. * When provided, inner button gets name without '-switch' suffix. */ readonly name: _angular_core.InputSignal; /** * CSS classes applied to inner button element. */ readonly class: _angular_core.InputSignal; /** * Styles applied to the host element. Bound via `[style]` so they apply through the CSSOM and are * not blocked by a strict Content-Security-Policy. */ readonly hostStyles: _angular_core.InputSignal; /** * Size of the switch. * Drives the size-keyed registry style rules via the `data-size` attribute. * @default 'default' */ readonly size: _angular_core.InputSignal; /** Whether to force the input into an invalid state. */ readonly forceInvalid: _angular_core.InputSignalWithTransform; /** * Accessibility label for screen readers. * Use when no visible label exists. */ readonly ariaLabel: _angular_core.InputSignal; /** * ID of element that labels this switch for accessibility. * Auto-set when switch is inside label element. */ readonly ariaLabelledby: _angular_core.InputSignal; readonly mutableAriaLabelledby: _angular_core.WritableSignal; /** * ID of element that describes this switch for accessibility. */ readonly ariaDescribedby: _angular_core.InputSignal; /** * Whether switch is required in a form. */ readonly requiredInput: _angular_core.InputSignalWithTransform; private readonly _hostRequired; readonly required: _angular_core.Signal; /** * Whether switch is disabled. * Disabled switches cannot be toggled and indicate disabled state with data attribute. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Keyboard tab order for switch. * @default 0 */ readonly tabIndex: _angular_core.InputSignalWithTransform; /** * Event emitted when switch is blurred (loses focus). * Used for form validation. */ readonly touched: _angular_core.OutputEmitterRef; protected _onChange: ChangeFn; private _onTouched; readonly switch: _angular_core.Signal>; protected readonly _state: _angular_core.Signal<{ disabled: _angular_core.WritableSignal; name: string | null; id: string | null; }>; readonly controlState: _angular_core.Signal<_spartan_ng_brain_forms.ControlState | null> | undefined; protected readonly _invalid: _angular_core.Signal | undefined; protected readonly _touched: _angular_core.Signal | undefined; protected readonly _dirty: _angular_core.Signal | undefined; protected readonly _spartanInvalid: _angular_core.Signal; readonly labelableId: _angular_core.Signal; constructor(); /** * Toggles switch between checked/unchecked states. * Does nothing if switch is disabled. */ protected toggle(): void; ngAfterContentInit(): void; ngOnDestroy(): void; /** * Gets proper ID for inner button element. * Removes '-switch' suffix if present in container ID. * * @param idPassedToContainer - ID applied to container element * @returns ID to use for inner button or null */ protected getSwitchButtonId(idPassedToContainer: string | null | undefined): string | null; /** * Updates internal state when control value changes from outside. * Part of ControlValueAccessor interface. * * @param value - New checked state */ writeValue(value: boolean): void; /** * Registers callback for value changes. * Part of ControlValueAccessor interface. * * @param fn - Function to call when value changes */ registerOnChange(fn: ChangeFn): void; /** * Registers callback for touched events. * Part of ControlValueAccessor interface. * * @param fn - Function to call when control is touched */ registerOnTouched(fn: TouchFn): void; /** * Updates disabled state from form control. * Part of ControlValueAccessor interface. * * @param isDisabled - Whether switch should be disabled */ setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class BrnSwitchThumb { protected readonly _switch: BrnSwitch; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare const BrnSwitchImports: readonly [typeof BrnSwitch, typeof BrnSwitchThumb]; export { BRN_SWITCH_VALUE_ACCESSOR, BrnSwitch, BrnSwitchImports, BrnSwitchThumb }; export type { BrnSwitchSize };