Package @google-cloud/promisify (3.0.1)

Interfaces

CallbackifyAllOptions

CallbackMethod

PromiseMethod

PromisifyAllOptions

PromisifyOptions

WithPromise

Functions

callbackify(originalMethod)

export declare function callbackify(originalMethod: CallbackMethod): CallbackMethod;

Wraps a promisy type function to conditionally call a callback function.

Parameter
NameDescription
originalMethodCallbackMethod

The method to callbackify.

Returns
TypeDescription
CallbackMethod

callbackifyAll(Class, options)

export declare function callbackifyAll(Class: Function, options?: CallbackifyAllOptions): void;

Callbackifies certain Class methods. This will not callbackify private or streaming methods.

Parameters
NameDescription
ClassFunction

Service class.

optionsCallbackifyAllOptions

Configuration object.

Returns
TypeDescription
void

promisify(originalMethod, options)

export declare function promisify(originalMethod: PromiseMethod, options?: PromisifyOptions): any;

Wraps a callback style function to conditionally return a promise.

Parameters
NameDescription
originalMethodPromiseMethod

The method to promisify.

optionsPromisifyOptions

Promise options.

Returns
TypeDescription
any

promisifyAll(Class, options)

export declare function promisifyAll(Class: Function, options?: PromisifyAllOptions): void;

Promisifies certain Class methods. This will not promisify private or streaming methods.

Parameters
NameDescription
ClassFunction

Service class.

optionsPromisifyAllOptions

Configuration object.

Returns
TypeDescription
void