secure-action
Version:
Secure Action 是一个基于行为的验证码组件,适用于 Vue 3。
112 lines (111 loc) • 2.65 kB
TypeScript
import { type ExtractPropTypes, PropType, type Ref } from 'vue';
export type RequestFnOptions = {
loading: Ref<boolean>;
onError: (message?: string) => void;
onSuccess: (image: string, thumbnail: string) => void;
};
export type RequestFn = (options: RequestFnOptions) => void;
export type VerifyOptions = {
loading: Ref<boolean>;
points: number[] | [number, number][];
onSuccess: (message?: string) => void;
onError: (message?: string) => void;
};
export type VerifyFn = (options: VerifyOptions) => void;
export declare const definePropType: <T>(val: any) => PropType<T>;
export declare const secureActionProps: {
title: {
type: StringConstructor;
default: string;
};
request: {
type: PropType<RequestFn>;
required: boolean;
};
verify: {
type: PropType<VerifyFn>;
required: boolean;
};
loadingText: {
type: StringConstructor;
default: string;
};
validatingText: {
type: StringConstructor;
default: string;
};
successText: {
type: StringConstructor;
default: string;
};
failText: {
type: StringConstructor;
default: string;
};
flat: {
type: BooleanConstructor;
default: boolean;
};
errorRefreshWait: {
type: NumberConstructor;
default: number;
};
successCloseWait: {
type: NumberConstructor;
default: number;
};
maskClosable: {
type: BooleanConstructor;
default: boolean;
};
hideCancel: {
type: BooleanConstructor;
default: boolean;
};
closable: {
type: BooleanConstructor;
default: boolean;
};
keyboard: {
type: BooleanConstructor;
default: boolean;
};
okText: {
type: StringConstructor;
default: string;
};
class: {
type: StringConstructor;
default: string;
};
maskClass: {
type: StringConstructor;
default: string;
};
cancelText: {
type: StringConstructor;
default: string;
};
maxPoint: {
type: NumberConstructor;
default: number;
};
r: {
type: NumberConstructor;
default: number;
};
fallbackBg: {
type: StringConstructor;
default: string;
};
fallbackText: {
type: StringConstructor;
default: string;
};
footerAlign: {
type: StringConstructor;
values: string[];
default: string;
};
};
export type SecureActionProps = ExtractPropTypes<typeof secureActionProps>;