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