| | |
| | | /** |
| | | * 任意类型的函数 |
| | | */ |
| | | type AnyFunction = AnyNormalFunction | AnyPromiseFunction; |
| | | |
| | | /** |
| | | * 任意类型的异步函数 |
| | | */ |
| | | type AnyPromiseFunction = (...arg: any) => PromiseLike<any>; |
| | | type AnyPromiseFunction = (...arg: any[]) => PromiseLike<any>; |
| | | |
| | | /** |
| | | * 任意类型的普通函数 |
| | | */ |
| | | type AnyNormalFunction = (...arg: any) => any; |
| | | type AnyNormalFunction = (...arg: any[]) => any; |
| | | |
| | | /** |
| | | * 任意类型的函数 |
| | | */ |
| | | type AnyFunction = AnyNormalFunction | AnyPromiseFunction; |
| | | |
| | | /** |
| | | * T | null 包装 |
| | |
| | | /** |
| | | * 字符串类型对象 |
| | | */ |
| | | type Recordable<T> = Record<string, T>; |
| | | type Recordable<T = any> = Record<string, T>; |
| | | |
| | | /** |
| | | * 字符串类型对象(只读) |
| | | */ |
| | | type ReadonlyRecordable<T = any> = { |
| | | interface ReadonlyRecordable<T = any> { |
| | | readonly [key: string]: T; |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * setTimeout 返回值类型 |
| | | */ |
| | | type TimeoutHandle = ReturnType<typeof setTimeout>; |
| | | |
| | | /** |
| | | * setInterval 返回值类型 |
| | | */ |
| | | type IntervalHandle = ReturnType<typeof setInterval>; |
| | | |
| | | export { |
| | | type AnyFunction, |
| | | type AnyPromiseFunction, |
| | | type AnyNormalFunction, |
| | | type Nullable, |
| | | type AnyPromiseFunction, |
| | | type IntervalHandle, |
| | | type NonNullable, |
| | | type Recordable, |
| | | type Nullable, |
| | | type ReadonlyRecordable, |
| | | type Recordable, |
| | | type TimeoutHandle, |
| | | }; |