hongluan-ui
Version:
Hongluan Component Library for Vue 3
121 lines (120 loc) • 3.47 kB
TypeScript
import type { ExtractPropTypes, PropType } from 'vue';
import type Switch from './switch.vue';
export declare const switchProps: {
ariaLabel: StringConstructor;
/**
* @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type
*/
modelValue: {
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
default: boolean;
};
/**
* @deprecated binding value ( deprecated, use `model-value / v-model` instead )
*/
value: {
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
default: boolean;
};
/**
* @description whether Switch is disabled
*/
disabled: BooleanConstructor;
type: {
type: PropType<"success" | "info" | "warning" | "danger" | "link" | "primary">;
validator: (val: string) => boolean;
};
/**
* @description size of Switch
*/
size: {
type: PropType<"xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl">;
validator: (val: string) => boolean;
};
/**
* @description width of Switch
*/
width: StringConstructor;
/**
* @deprecated background color when in `on` state
*/
activeColor: {
type: StringConstructor;
default: string;
};
/**
* @deprecated background color when in `off` state
*/
inactiveColor: {
type: StringConstructor;
default: string;
};
/**
* @deprecated border color of the switch
*/
borderColor: {
type: StringConstructor;
default: string;
};
/**
* @description switch value when in `on` state
*/
activeValue: {
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
default: boolean;
};
/**
* @description switch value when in `off` state
*/
inactiveValue: {
type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
default: boolean;
};
/**
* @description input name of Switch
*/
name: {
type: StringConstructor;
default: string;
};
/**
* @description whether to trigger form validation
*/
validateEvent: {
type: BooleanConstructor;
default: boolean;
};
/**
* @description id for input
*/
id: StringConstructor;
/**
* @description whether Switch is in loading state
*/
loading: BooleanConstructor;
/**
* @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: PropType<() => (Promise<boolean> | boolean)>;
/**
* @description tabindex for input
*/
tabindex: {
type: (StringConstructor | NumberConstructor)[];
};
/**
* @deprecated native input aria-label
*/
label: {
type: StringConstructor;
default: any;
};
};
export declare type SwitchProps = ExtractPropTypes<typeof switchProps>;
export declare const switchEmits: {
"update:modelValue": (val: boolean | string | number) => boolean;
change: (val: boolean | string | number) => boolean;
input: (val: boolean | string | number) => boolean;
};
export declare type SwitchEmits = typeof switchEmits;
export declare type SwitchInstance = InstanceType<typeof Switch>;