import type { ComponentSize } from 'element-plus/es/constants'; import type { Component, ExtractPublicPropTypes, PropType } from 'vue'; import type Switch from './switch.vue'; export interface SwitchProps { /** * @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type */ modelValue?: boolean | string | number; /** * @description whether Switch is disabled */ disabled?: boolean; /** * @description whether Switch is in loading state */ loading?: boolean; /** * @description size of Switch */ size?: ComponentSize; /** * @description width of Switch */ width?: string | number; /** * @description whether icon or text is displayed inside dot, only the first character will be rendered for text */ inlinePrompt?: boolean; /** * @description component of the icon displayed in action when in `off` state */ inactiveActionIcon?: string | Component; /** * @description component of the icon displayed in action when in `on` state */ activeActionIcon?: string | Component; /** * @description component of the icon displayed when in `on` state, overrides `active-text` */ activeIcon?: string | Component; /** * @description component of the icon displayed when in `off` state, overrides `inactive-text` */ inactiveIcon?: string | Component; /** * @description text displayed when in `on` state */ activeText?: string; /** * @description text displayed when in `off` state */ inactiveText?: string; /** * @description switch value when in `on` state */ activeValue?: boolean | string | number; /** * @description switch value when in `off` state */ inactiveValue?: boolean | string | number; /** * @description input name of Switch */ name?: string; /** * @description whether to trigger form validation */ validateEvent?: boolean; /** * @description before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching */ beforeChange?: () => Promise | boolean; /** * @description id for input */ id?: string; /** * @description tabindex for input */ tabindex?: string | number; /** * @description native `aria-label` attribute */ ariaLabel?: string; } /** * @deprecated Removed after 3.0.0, Use `SwitchProps` instead. */ export declare const switchProps: { readonly ariaLabel: StringConstructor; readonly modelValue: import("element-plus/es/utils").EpPropFinalized; readonly disabled: import("element-plus/es/utils").EpPropFinalized; readonly loading: BooleanConstructor; readonly size: { readonly type: PropType "" | "small" | "default" | "large") | (() => "" | "small" | "default" | "large") | ((new (...args: any[]) => "" | "small" | "default" | "large") | (() => "" | "small" | "default" | "large"))[], unknown, "" | "small" | "default" | "large">>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly width: import("element-plus/es/utils").EpPropFinalized; readonly inlinePrompt: BooleanConstructor; readonly inactiveActionIcon: { readonly type: PropType (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown>>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly activeActionIcon: { readonly type: PropType (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown>>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly activeIcon: { readonly type: PropType (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown>>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly inactiveIcon: { readonly type: PropType (string | Component) & {}) | (() => string | Component) | ((new (...args: any[]) => (string | Component) & {}) | (() => string | Component))[], unknown, unknown>>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly activeText: import("element-plus/es/utils").EpPropFinalized; readonly inactiveText: import("element-plus/es/utils").EpPropFinalized; readonly activeValue: import("element-plus/es/utils").EpPropFinalized; readonly inactiveValue: import("element-plus/es/utils").EpPropFinalized; readonly name: import("element-plus/es/utils").EpPropFinalized; readonly validateEvent: import("element-plus/es/utils").EpPropFinalized; readonly beforeChange: { readonly type: PropType<() => Promise | boolean>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; readonly id: StringConstructor; readonly tabindex: { readonly type: PropType>; readonly required: false; readonly validator: ((val: unknown) => boolean) | undefined; __epPropKey: true; }; }; /** * @deprecated Removed after 3.0.0, Use `SwitchProps` instead. */ export type SwitchPropsPublic = ExtractPublicPropTypes; export declare const switchEmits: { "update:modelValue": (val: boolean | string | number) => boolean; change: (val: boolean | string | number) => boolean; input: (val: boolean | string | number) => boolean; }; export type SwitchEmits = typeof switchEmits; export type SwitchInstance = InstanceType & unknown;