Interface: IPromisE<T>
Defined in: packages/promise/src/types/PromisEBase.ts:3
Extends
Promise<T>
Extended by
Type Parameters
T
T = unknown
Properties
[toStringTag]
readonly[toStringTag]:string
Defined in: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:176
Inherited from
Promise.[toStringTag]
onEarlyFinalize
onEarlyFinalize:
OnEarlyFinalize<T>[]
Defined in: packages/promise/src/types/PromisEBase.ts:8
callbacks to be invoked whenever PromisE instance is finalized early using non-static resolve/reject methods
onFinalize
onFinalize:
OnFinalize<T>[]
Defined in: packages/promise/src/types/PromisEBase.ts:10
pending
readonlypending:boolean
Defined in: packages/promise/src/types/PromisEBase.ts:13
Indicates if the promise is still pending/unfinalized
reject
reject: (
reason) =>void
Defined in: packages/promise/src/types/PromisEBase.ts:16
Reject pending promise early.
Parameters
reason
unknown
Returns
void
rejected
readonlyrejected:boolean
Defined in: packages/promise/src/types/PromisEBase.ts:19
Indicates if the promise has been rejected
resolve
resolve: (
value) =>void
Defined in: packages/promise/src/types/PromisEBase.ts:22
Resovle pending promise early.
Parameters
value
T | PromiseLike<T>
Returns
void
resolved
readonlyresolved:boolean
Defined in: packages/promise/src/types/PromisEBase.ts:25
Indicates if the promise has been resolved
state
readonlystate:0|1|2
Defined in: packages/promise/src/types/PromisEBase.ts:5
0: pending, 1: resolved, 2: rejected
Methods
catch()
catch<
TResult>(onrejected?):Promise<T|TResult>
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1564
Attaches a callback for only the rejection of the Promise.
Type Parameters
TResult
TResult = never
Parameters
onrejected?
((reason) => TResult | PromiseLike<TResult>) | null
The callback to execute when the Promise is rejected.
Returns
Promise<T | TResult>
A Promise for the completion of the callback.
Inherited from
Promise.catch
finally()
finally(
onfinally?):Promise<T>
Defined in: node_modules/typescript/lib/lib.es2018.promise.d.ts:29
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Parameters
onfinally?
(() => void) | null
The callback to execute when the Promise is settled (fulfilled or rejected).
Returns
Promise<T>
A Promise for the completion of the callback.
Inherited from
Promise.finally
then()
then<
TResult1,TResult2>(onfulfilled?,onrejected?):Promise<TResult1|TResult2>
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1557
Attaches callbacks for the resolution and/or rejection of the Promise.
Type Parameters
TResult1
TResult1 = T
TResult2
TResult2 = never
Parameters
onfulfilled?
((value) => TResult1 | PromiseLike<TResult1>) | null
The callback to execute when the Promise is resolved.
onrejected?
((reason) => TResult2 | PromiseLike<TResult2>) | null
The callback to execute when the Promise is rejected.
Returns
Promise<TResult1 | TResult2>
A Promise for the completion of which ever callback is executed.
Inherited from
Promise.then