import { Throws } from './throws'; type InferErrors = T extends ThrowsPromise ? E : T extends PromiseLike ? U extends { __throws?(error: infer E): void; } ? E : never : never; interface PromiseRejectedResult { status: 'rejected'; reason: E; } type SettledResult = T extends ThrowsPromise ? PromiseFulfilledResult | PromiseRejectedResult : T extends PromiseLike ? PromiseFulfilledResult | PromiseRejectedResult : PromiseFulfilledResult | PromiseRejectedResult; export declare class ThrowsPromise extends Promise> { constructor(executor: (resolve: (value: T | PromiseLike) => void, reject: (reason: E) => void) => void); catch(onrejected?: ((reason: E) => TResult | PromiseLike) | null | undefined): ThrowsPromise; static resolve: { (): ThrowsPromise; (value: V): ThrowsPromise, never>; }; static reject(reason: E): ThrowsPromise; static all(values: T): ThrowsPromise<{ -readonly [P in keyof T]: Awaited; }, InferErrors>; static allSettled(values: T): ThrowsPromise<{ -readonly [P in keyof T]: SettledResult; }, never>; static race | any)[]>(values: T): ThrowsPromise ? U : T[number] extends PromiseLike ? U : Awaited, InferErrors>; /** type cast (third party promise) to a ThrowsPromise */ static fromPromise(promise: Promise): ThrowsPromise; /** type cast that strips the throws type */ asPromise(): Promise; } export {};