/** * 字符串类型对象 */ declare type Recordable = Record; /** * 字符串类型对象(只读) */ declare type ReadonlyRecordable = { readonly [key: string]: T; }; /** * T | null 包装 */ declare type Nullable = T | null; /** * T | Not null 包装 */ declare type NonNullable = T extends null | undefined ? never : T; declare type Indexable = { [key: string]: T; }; declare type DeepPartial = { [P in keyof T]?: DeepPartial; }; /** * 任意类型的异步函数 */ declare type AnyPromiseFunction = (...arg: any[]) => PromiseLike; /** * 任意类型的普通函数 */ declare type AnyNormalFunction = (...arg: any[]) => any; /** * 任意类型的函数 */ declare type AnyFunction = AnyNormalFunction | AnyPromiseFunction; /** * setTimeout 返回值类型 */ type TimeoutHandle = ReturnType; /** * setInterval 返回值类型 */ type IntervalHandle = ReturnType; declare type FormType = 'create' | 'update'