import { type EventEmitter } from "../../stencil-public-runtime"; /** * A toggle switch component for binary on/off states. * * This component is form-associated, meaning it can participate in HTML forms * just like native form controls. It supports form validation, form reset, * and browser autofill/restore functionality. * * * Code organization follows the Stencil Style Guide: * https://stenciljs.com/docs/style-guide * * 1. Own Properties (internal, not exposed) * 2. @Element (reference to host) * 3. @State (internal reactive state) * 4. @Prop (public API properties) * 5. @Event (emitted events) * 6. Lifecycle methods * 7. @Listen decorators * 8. @Method (public methods) * 9. Private methods * 10. render() * * Framework Integration: * - Vue: Supports v-model binding on the 'checked' property * - Angular: Supports [(ngModel)] and reactive forms (formControl) * - React: Standard prop binding and event handling * * Configuration in stencil.config.ts enables framework-specific bindings. */ export declare class Switch { private initialChecked; el: HTMLIfxSwitchElement; /** * Sets the checked state of the switch. * @default false */ checked: boolean; onCheckedChange(newValue: boolean, oldValue: boolean): void; /** * Disables user interaction when true. * @default false */ readonly disabled: boolean; /** * Makes the switch read-only. * @default false */ readonly readOnly: boolean; /** * Form field name. * @default "" */ readonly name: string; /** * Form field value when checked. * If not set, defaults to "on" (standard checkbox behavior). * @default "on" */ readonly value: string; internals: ElementInternals; /** * Emitted when checked state changes. */ ifxChange: EventEmitter; componentWillLoad(): void; componentDidLoad(): Promise; /** * Form-Associated Lifecycle Callbacks * ------------------------------------ * These are called by the browser to integrate with native form behavior. * See: https://stenciljs.com/docs/form-associated * * Note: formAssociatedCallback and formDisabledCallback are not implemented * as they're not needed for this component. They would only be useful if we * needed to react to form association changes or support fieldset-level disabling. */ /** * Called when the form is reset. * Resets the switch to its initial state and clears form value. */ formResetCallback(): void; /** * Called when the browser restores form state (e.g., browser autofill or back button). * @param state - The saved state to restore * @param mode - "restore" (browser restart/navigation) or "autocomplete" (autofill) */ formStateRestoreCallback(state: string | null, _mode: "restore" | "autocomplete"): void; /** * Returns the current checked state. */ isChecked(): Promise; /** * Sets the checked state. * @param checked - New checked state. */ setChecked(checked: boolean): Promise; /** * Toggles the checked state. * @returns Resolves when the toggle is complete. */ toggle(): Promise; private handleKeyDown; private toggleSwitch; /** * Updates the form value based on the current checked state. * Called whenever checked state changes to keep form data in sync. */ private updateFormValue; private toggleLabelGap; render(): any; }