import * as fs from "fs"; import * as http from "http"; import busboy = require("busboy"); export = asyncBusboy; declare function asyncBusboy( req: http.IncomingMessage, options: asyncBusboy.OnFileOptions, ): Promise; declare function asyncBusboy(req: http.IncomingMessage, options?: asyncBusboy.Options): Promise; declare namespace asyncBusboy { interface Options extends Omit { headers?: http.IncomingHttpHeaders | undefined; onFile?: busboy.BusboyEvents["file"] | undefined; } type OnFileOptions = WithRequiredProps; interface Result { fields: { [key: string]: unknown }; files: FileReadStream[]; } type OnFileResult = Omit; interface FileReadStream extends fs.ReadStream { fieldname: string; filename: string; transferEncoding: string; encoding: string; mimeType: string; mime: string; } } type WithRequiredProps = & Omit & { [MK in K]-?: NonNullable; };