UNPKG

481 BTypeScriptView Raw
1/**
2 * Create an asynchronous operation like the original `Promise` type but this
3 * one prevents promises to be wrapped within more promises (not possible).
4 * @param A
5 * @example
6 * ```ts
7 * import {A} from 'ts-toolbelt'
8 *
9 * type test0 = A.Promise<Promise<number>> // Promise<number>
10 * type test1 = Promise<Promise<number>> // Promise<Promise<number>>
11 * ```
12 */
13export declare type Promise<A extends any> = globalThis.Promise<A extends globalThis.Promise<infer X> ? X : A>;