various-ui
Version:
This is a test version of the Vue 3 component library
43 lines (42 loc) • 1.29 kB
TypeScript
import { Emitter } from "mitt";
import { InjectionKey, App, ComponentPublicInstance } from "vue";
export declare namespace UiTypes {
type size = "default" | "middle" | "large" | "small";
type type = "success" | "warning" | "info" | "error";
type align = "end" | "start" | "center";
type loading = boolean | {
is: boolean;
context?: string;
};
type direction = "top" | "left" | "right" | "bottom";
type candidate = {
label: any;
value: any;
[name: string]: any;
};
type verifyResult = {
type?: UiTypes.type;
verify: boolean;
message: string;
};
type verifyRule = {
trigger: "change" | "verify" | "blur";
verify: ((data: {
[name: string]: any;
}) => verifyResult) | ((data: {
[name: string]: any;
}) => Promise<verifyResult>);
};
}
export interface UiHTMLElement extends HTMLElement {
app?: App<Element>;
instance?: ComponentPublicInstance;
}
export declare const UiFormEmitterKey: InjectionKey<Emitter<any>>;
export declare const UiFormDataKey: InjectionKey<{
[name: string]: any;
}>;
export declare const UiFormRulesKey: InjectionKey<{
[name: string]: UiTypes.verifyRule[];
}>;
export * from "./components";