vue-devui
Version:
DevUI components based on Vite and Vue3
43 lines (42 loc) • 1.35 kB
TypeScript
import type { ExtractPropTypes, PropType, ComputedRef } from 'vue';
export type SwitchSize = 'sm' | 'md' | 'lg';
export declare const switchProps: {
readonly modelValue: {
readonly type: PropType<string | number | boolean>;
readonly default: false;
};
readonly size: {
readonly type: PropType<SwitchSize>;
};
readonly color: {
readonly type: StringConstructor;
readonly default: undefined;
};
readonly disabled: {
readonly type: BooleanConstructor;
readonly default: false;
};
readonly beforeChange: {
readonly type: PropType<(v: boolean) => boolean | Promise<boolean>>;
readonly default: undefined;
};
readonly change: {
readonly type: PropType<(v: boolean) => void>;
readonly default: undefined;
};
readonly activeValue: {
readonly type: PropType<string | number | boolean>;
readonly default: true;
};
readonly inactiveValue: {
readonly type: PropType<string | number | boolean>;
readonly default: false;
};
};
export type SwitchProps = ExtractPropTypes<typeof switchProps>;
export type UseSwitchFn = {
checked: ComputedRef<string | number | boolean>;
switchDisabled: ComputedRef<boolean>;
switchSize: ComputedRef<SwitchSize>;
toggle: () => void;
};