///
import util = require("util");
import polyfill = require("./implementation");
import getUtilPromisify = require("./polyfill");
import shimUtilPromisify = require("./shim");
// eslint-disable-next-line @typescript-eslint/ban-types
declare function promisify(fn: util.CustomPromisify): TCustom;
declare function promisify(
fn: (callback: (err: any, result: TResult) => void) => void,
): () => Promise;
declare function promisify(fn: (callback: (err?: any) => void) => void): () => Promise;
declare function promisify(
fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void,
): (arg1: T1) => Promise;
declare function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void,
): (arg1: T1, arg2: T2) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void,
): (arg1: T1, arg2: T2) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise;
declare function promisify(
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise;
// eslint-disable-next-line @typescript-eslint/ban-types
declare function promisify(fn: Function): Function;
declare namespace promisify {
const custom: typeof polyfill.custom;
/**
* @deprecated
* Not exposed by native `util.promisify` or supported by browserify's `util.promisify`.
*
* Use `util.promisify.custom` instead.
*/
const customPromisifyArgs: typeof polyfill.customPromisifyArgs | undefined;
function getPolyfill(): ReturnType;
const implementation: typeof polyfill;
function shim(): ReturnType;
}
export = promisify;