2020-09-28 20:19:10 +08:00
|
|
|
declare interface Fn<T = any> {
|
|
|
|
|
(...arg: T[]): T;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 任意对象
|
|
|
|
|
declare interface IObj<T = any> {
|
|
|
|
|
[key: string]: T;
|
|
|
|
|
[key: number]: T;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare function parseInt(s: string | number, radix?: number): number;
|
2020-10-30 21:32:05 +08:00
|
|
|
|
2020-09-28 20:19:10 +08:00
|
|
|
declare function parseFloat(string: string | number): number;
|
|
|
|
|
|
|
|
|
|
declare type Dictionary<T> = Record<string, T>;
|
|
|
|
|
|
|
|
|
|
declare type Nullable<T> = T | null;
|
|
|
|
|
|
|
|
|
|
declare type RefInstanceType<T> = {
|
|
|
|
|
$: T;
|
|
|
|
|
} | null;
|
|
|
|
|
|
|
|
|
|
declare type RefType<T> = T | null;
|
|
|
|
|
|
|
|
|
|
declare type CustomizedHTMLElement<T> = HTMLElement & T;
|
|
|
|
|
|
2020-10-30 00:56:11 +08:00
|
|
|
declare type Indexable<T = any> = {
|
2020-09-28 20:19:10 +08:00
|
|
|
[key: string]: T;
|
|
|
|
|
};
|
2020-10-30 21:32:05 +08:00
|
|
|
|
2020-10-30 00:56:11 +08:00
|
|
|
declare type Hash<T> = Indexable<T>;
|
2020-09-28 20:19:10 +08:00
|
|
|
|
2020-11-10 22:45:39 +08:00
|
|
|
// declare type DeepPartial<T> = {
|
|
|
|
|
// [P in keyof T]?: T[P] extends (infer U)[]
|
|
|
|
|
// ? RecursivePartial<U>[]
|
|
|
|
|
// : T[P] extends object
|
|
|
|
|
// ? RecursivePartial<T[P]>
|
|
|
|
|
// : T[P];
|
|
|
|
|
// };
|
|
|
|
|
|
2020-10-30 00:56:11 +08:00
|
|
|
declare type DeepPartial<T> = {
|
2020-11-10 22:45:39 +08:00
|
|
|
[P in keyof T]?: DeepPartial<T[P]>;
|
2020-09-28 20:19:10 +08:00
|
|
|
};
|
|
|
|
|
|
2020-10-30 00:56:11 +08:00
|
|
|
declare type SelectOptions = {
|
2020-09-28 20:19:10 +08:00
|
|
|
label: string;
|
|
|
|
|
value: any;
|
|
|
|
|
}[];
|
|
|
|
|
|
2020-10-30 00:56:11 +08:00
|
|
|
declare type EmitType = (event: string, ...args: any[]) => void;
|
2020-09-28 20:19:10 +08:00
|
|
|
|
2020-10-30 00:56:11 +08:00
|
|
|
declare type TargetContext = '_self' | '_blank';
|