diff --git a/types/formidable/formidable-tests.ts b/types/formidable/formidable-tests.ts index a3576628109386..76fa49e1206caa 100644 --- a/types/formidable/formidable-tests.ts +++ b/types/formidable/formidable-tests.ts @@ -6,11 +6,16 @@ import { Formidable, formidable as formidableAlias, IncomingForm, + json, + multipart, MultipartParser, + octetstream, Options, Part, PersistentFile, + PluginFunction, plugins, + querystring, VolatileFile, } from "formidable"; import * as http from "http"; @@ -219,3 +224,12 @@ new IncomingForm(); // $ExpectType IncomingForm formidable(); + +// $ExpectType PluginFunction +octetstream; +// $ExpectType PluginFunction +querystring; +// $ExpectType PluginFunction +multipart; +// $ExpectType PluginFunction +json; diff --git a/types/formidable/index.d.ts b/types/formidable/index.d.ts index bdc3bd7aa40b8c..4a3be81f923c03 100644 --- a/types/formidable/index.d.ts +++ b/types/formidable/index.d.ts @@ -326,6 +326,11 @@ declare const formidable: { IncomingForm: typeof Formidable; // parsers and mapped parsers parsers: typeof parsers; + // add named plugin exports + octetstream: formidable.PluginFunction; + querystring: formidable.PluginFunction; + multipart: formidable.PluginFunction; + json: formidable.PluginFunction; } & formidable.MappedParsers; export = formidable;