UNPKG

ts-type

Version:

TypeScript 類型工具庫:提供豐富的類型操作工具和重新導出的內建類型 / TypeScript type utility library: provides rich type manipulation utilities and re-exported built-in types

12 lines (11 loc) 426 B
import { ITSAnyFunction } from '../type/base'; /** * 解析類型:遞迴解析 PromiseLike 類型 * Awaited type: recursively resolve PromiseLike types */ export type ITSAwaitedLazy<T> = T extends PromiseLike<infer U> ? Awaited<U> : T; /** * 取得函數返回值的解析類型 * Get the awaited return type of a function */ export type ITSAwaitedReturnType<T extends ITSAnyFunction> = ITSAwaitedLazy<ReturnType<T>>;