AnyPromiseFunction | 任意类型的异步函数 | type AnyPromiseFunction = (...args: any[]) => PromiseLike<any>; |
AnyNormalFunction | 任意类型的普通函数 | type AnyNormalFunction = (...args: any[]) => any; |
AnyFunction | 任意类型的函数(包括异步和普通) | `type AnyFunction = AnyNormalFunction |
Nullable<T> | 允许 T 类型或 null | `type Nullable = T |
NonNullable<T> | 排除了 null 和 undefined 的 T 类型 | `type NonNullable = T extends null |
Recordable<T> | 字符串键的对象,值为 T 类型 | type Recordable<T> = Record<string, T>; |
ReadonlyRecordable<T> | 只读的字符串键的对象,值为 T 类型 | interface ReadonlyRecordable<T = any> { readonly [key: string]: T; } |
TimeoutHandle | setTimeout 的返回类型 | type TimeoutHandle = ReturnType<typeof setTimeout>; |
IntervalHandle | setInterval 的返回类型 | type IntervalHandle = ReturnType<typeof setInterval>; |