Class Promise

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(callback: (resolve: (value?: T) => void, reject?: (error: Error) => void) => void): Promise

Parameters

  • callback: (resolve: (value?: T) => void, reject?: (error: Error) => void) => void

Returns

Promise

Methods

public static all(promises: Thenable[]): Thenable

Parameters

Returns

Thenable

public static async(callback: () => TR): () => Thenable<TR>

Parameters

  • callback: () => TR

Returns

() => Thenable<TR>

public static async(callback: (p1: T1) => TR): (p1: T1) => Thenable<TR>

Parameters

  • callback: (p1: T1) => TR

Returns

(p1: T1) => Thenable<TR>

public static async(callback: (p1: T1, p2: T2) => TR): (p1: T1, p2: T2) => Thenable<TR>

Parameters

  • callback: (p1: T1, p2: T2) => TR

Returns

(p1: T1, p2: T2) => Thenable<TR>

public static async(callback: (p1: T1, p2: T2, p3: T3) => TR): (p1: T1, p2: T2, p3: T3) => Thenable<TR>

Parameters

  • callback: (p1: T1, p2: T2, p3: T3) => TR

Returns

(p1: T1, p2: T2, p3: T3) => Thenable<TR>

public static async(callback: (p1: T1, p2: T2, p3: T3, p4: T4) => TR): (p1: T1, p2: T2, p3: T3, p4: T4) => Thenable<TR>

Parameters

  • callback: (p1: T1, p2: T2, p3: T3, p4: T4) => TR

Returns

(p1: T1, p2: T2, p3: T3, p4: T4) => Thenable<TR>

public catch(onRejected: (error: Error) => T): Thenable

Parameters

  • onRejected: (error: Error) => T

Returns

Thenable

public catch(onRejected: (error: Error) => T): Thenable

Parameters

  • onRejected: (error: Error) => T

Returns

Thenable

public static nfcall(obj: any, methodName: String, args?: Array<any>): Thenable

Parameters

  • obj: any
  • methodName: String
  • args?: Array<any> optional

Returns

Thenable

public static reject(error: Error): Thenable

Parameters

  • error: Error

Returns

Thenable

public static resolve(value?: T): Thenable

Parameters

  • value?: T optional

Returns

Thenable

public static resolve(promise: Thenable): Thenable

Parameters

Returns

Thenable

public static rewriteFolderSync(path: string)

Parameters

  • path: string

public static spawn(generatorFunction: () => TR): Thenable

Parameters

  • generatorFunction: () => TR

Returns

Thenable

public then(onFulfilled: (value: T) => Thenable<TR>, onRejected?: (error: Error) => TR): Thenable

Parameters

  • onFulfilled: (value: T) => Thenable<TR>
  • onRejected?: (error: Error) => TR optional

Returns

Thenable

public then(onFulfilled: (value: T) => Thenable<TR>, onRejected?: (error: Error) => void): Thenable

Parameters

  • onFulfilled: (value: T) => Thenable<TR>
  • onRejected?: (error: Error) => void optional

Returns

Thenable

public then(onFulfilled: (value: T) => TR, onRejected?: (error: Error) => void): Thenable

Parameters

  • onFulfilled: (value: T) => TR
  • onRejected?: (error: Error) => void optional

Returns

Thenable

public then(onFulfilled: (value: T) => TR, onRejected?: (error: Error) => TR): Thenable

Parameters

  • onFulfilled: (value: T) => TR
  • onRejected?: (error: Error) => TR optional

Returns

Thenable

public then(onFulfilled: (value: T) => Thenable<TR>, onRejected?: (error: Error) => TR): Thenable

Parameters

  • onFulfilled: (value: T) => Thenable<TR>
  • onRejected?: (error: Error) => TR optional

Returns

Thenable

public then(onFulfilled: (value: T) => Thenable<TR>, onRejected?: (error: Error) => void): Thenable

Parameters

  • onFulfilled: (value: T) => Thenable<TR>
  • onRejected?: (error: Error) => void optional

Returns

Thenable

public then(onFulfilled: (value: T) => TR, onRejected?: (error: Error) => void): Thenable

Parameters

  • onFulfilled: (value: T) => TR
  • onRejected?: (error: Error) => void optional

Returns

Thenable

public then(onFulfilled: (value: T) => TR, onRejected?: (error: Error) => TR): Thenable

Parameters

  • onFulfilled: (value: T) => TR
  • onRejected?: (error: Error) => TR optional

Returns

Thenable

public static waitAsync(time: number): Thenable

Parameters

  • time: number

Returns

Thenable