DefinitelyTyped/types/pify/index.d.ts
mad-mike b9c5f4a535 [pify] Update to version 3.0.0 (#20038)
* [pify] Add missing option errorFirst

see https://github.com/sindresorhus/pify#errorfirst

* [pify] Migrate promiseModule

* [pify] Update definitions to version 3.0.0
2017-09-26 13:00:09 -07:00

24 lines
807 B
TypeScript

// Type definitions for pify 3.0.0
// Project: https://github.com/sindresorhus/pify
// Definitions by: Sam Verschueren <https://github.com/samverschueren>, [Michael Müller] <https://github.com/mad-mike>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface PromiseModule {
new(executor: (resolve: (value?: any) => void, reject: (reason?: any) => void) => void): any;
}
interface PifyOptions {
multiArgs?: boolean,
include?: [string | RegExp],
exclude?: [string | RegExp],
excludeMain?: boolean,
errorFirst?: boolean,
promiseModule?: PromiseModule
}
declare function pify(input: Function, options?: PifyOptions): (...args: any[]) => Promise<any>;
declare function pify(input: any, options?: PifyOptions): any;
declare namespace pify { }
export = pify;