Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions types/formidable/formidable-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -219,3 +224,12 @@ new IncomingForm();

// $ExpectType IncomingForm
formidable();

// $ExpectType PluginFunction
octetstream;
// $ExpectType PluginFunction
querystring;
// $ExpectType PluginFunction
multipart;
// $ExpectType PluginFunction
json;
5 changes: 5 additions & 0 deletions types/formidable/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;