import { FocusMonitor } from '@angular/cdk/a11y'; import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { CanColor, CanDisable, HasTabIndex, MixinElementRefBase, ThemePalette } from '@ngx-simple/core/common-behaviors'; import { OnChangeType, OnTouchedType } from '@ngx-simple/core/types'; /** * 标签显示的位置 */ export declare type SwitchLabelPosition = 'before' | 'after'; /** 更改SimSwitch发出的事件对象 */ export declare class SimSwitchChange { /** 事件的源 */ source: SimSwitchComponent; /** 新`checked`值 */ checked: boolean; constructor( /** 事件的源 */ source: SimSwitchComponent, /** 新`checked`值 */ checked: boolean); } declare const _SimSwitchMixinBase: import("../../../dist/libs/core/common-behaviors/constructor").Constructor & import("../../../dist/libs/core/common-behaviors/constructor").Constructor & import("../../../dist/libs/core/common-behaviors/constructor").Constructor & typeof MixinElementRefBase; export declare class SimSwitchComponent extends _SimSwitchMixinBase implements OnDestroy, AfterContentInit, ControlValueAccessor, CanDisable, CanColor, HasTabIndex { private _focusMonitor; protected _changeDetectorRef: ChangeDetectorRef; /** switch是否必填 */ required: boolean; /** 切换动作是否在switch中触发值变化。 */ disableToggleValue: boolean; /** 切换动作是否触发加载中动画 */ loading: boolean; /** switch滑块 */ slider: boolean; /** switch是否选中 */ get checked(): boolean; set checked(value: boolean); private _checked; disabled: boolean; color: ThemePalette; /** switch的唯一id。如果没有提供,它将自动生成。 */ id: string; /** Name值将应用于 */ name: string | null; /** * 标签文本应该显示在switch按钮after还是before。默认: after */ labelPosition: SwitchLabelPosition; /** 每次switch切换其值时都会调用change事件 */ readonly change: EventEmitter; /** * 每当switch的元素被切换时,就会分配一个事件。 * 此事件总是在用户切换switch时发出,但这并不意味着switch的值已经改变。 */ readonly toggleChange: EventEmitter; /** 对的引用 */ _inputElement: ElementRef; /** * Implemented as part of ControlValueAccessor */ _onTouched: OnTouchedType; /** * Implemented as part of ControlValueAccessor */ private _controlValueAccessorChangeFn; /** 返回视觉隐藏input的唯一ID */ get inputId(): string; /** 自动生成唯一id */ protected _uniqueId: string; constructor(_elementRef: ElementRef, _focusMonitor: FocusMonitor, _changeDetectorRef: ChangeDetectorRef, tabIndex: string); ngAfterContentInit(): void; ngOnDestroy(): void; /** * Implemented as part of ControlVueAccessor */ writeValue(value: boolean): void; /** * Implemented as part of ControlVueAccessor */ registerOnChange(fn: OnChangeType): void; /** * Implemented as part of ControlVueAccessor */ registerOnTouched(fn: OnTouchedType): void; /** * Implemented as part of ControlVueAccessor */ setDisabledState(isDisabled: boolean): void; onChangeEvent(event: Event): void; onInputClick(event: Event): void; /** 聚焦 */ focus(options?: FocusOptions): void; toggle(): void; /** * 在“change”输出上发出更改事件。并通知FormControl有关更改的信息。 */ private _emitChangeEvent; } export declare class SimSlideToggleComponent extends SimSwitchComponent { /** 返回视觉隐藏input的唯一ID */ get inputId(): string; _uniqueId: string; /** 每当标签文本更改时调用 */ _onLabelTextChange(): void; } export {};