0.0.1 • Published 1 year ago
@voya-kit/ts-tools v0.0.1
@voya-kit/ts-tools
类型别名 | 描述 | 定义 |
---|---|---|
AnyPromiseFunction | 任意类型的异步函数 | type AnyPromiseFunction = (...args: any[]) => PromiseLike<any>; |
AnyNormalFunction | 任意类型的普通函数 | type AnyNormalFunction = (...args: any[]) => any; |
AnyFunction | 任意类型的函数(包括异步和普通) | type AnyFunction = AnyNormalFunction | AnyPromiseFunction; |
Nullable<T> | 允许 T 类型或 null | type Nullable<T> = T | null; |
NonNullable<T> | 排除了 null 和 undefined 的 T 类型 | type NonNullable<T> = T extends null | undefined ? never : T; |
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>; |
0.0.1
1 year ago