UNPKG

es-promise-ext

Version:

Native promise extensions for javascript and typescript.

34 lines (33 loc) 852 B
declare global { interface Promise<T> { /** * Resolve the value in the promise chain. * * @return {Promise<void>} * A value which pass through within a promise * * @example * Promise.resolve() * .resolve() * .then(doSomething) */ resolve(): Promise<void>; /** * Resolve the value in the promise chain. * * @param {U} [value] * - the value pass through * * @return {Promise<U>} * A value which pass through within a promise * * @example * Promise.resolve() * .resolve('a') * .then(doSomething) * // return 'a' in the subsequent promise */ resolve<U>(value?: U): Promise<U>; } } export {};