UNPKG

aveazul

Version:

Bluebird drop-in replacement built on native Promise

13 lines (12 loc) 697 B
import type { AveAzulClass } from "./aveazul.ts"; /** * The using function is a utility function that allows you to acquire resources, * process them, and then dispose of them in an error-safe manner. * * @param resources - An array of resources to acquire. * @param handler - A function that will be called with the acquired resources. * @param PromiseCtor - The Promise implementation to use. AveAzul or Bluebird. * @param asArray - Whether to return the result as an array. * @returns A promise that resolves to the result of the handler function. */ export declare function using<R>(resources: any[], handler: (...args: any[]) => R, PromiseCtor: AveAzulClass, asArray: boolean): any;