export type SwitchValue = boolean | string | number; export interface SwitchProps { modelValue?: SwitchValue; disabled?: boolean; loading?: boolean; /** * 大小 */ size?: 'large' | 'default' | 'small'; /** * switch 打开时的文字描述 */ activeText?: string; /** * switch 关闭时的文字描述 */ inactiveText?: string; } export type ZiSwitchProps = SwitchProps; export interface SwitchEmits { /** * 需要手动定义 不然类型推导会报错 */ (e: 'update:modelValue', value: SwitchValue): void; /** * switch 状态发生变化时的回调函数 * @param e * @param value */ (e: 'change', value: SwitchValue): void; } export interface SwitchExposes { /** * 组件聚焦方法 */ focus: () => void; } export type SwitchSlots = { /** * 自定义 active 行为 */ 'active-action': () => any; /** * 自定义 inactive 行为 */ 'inactive-action': () => any; };