Skip to content

Commit 00b127d

Browse files
authored
🤖 Merge PR DefinitelyTyped#74513 Add named plugin exports to formidable types by @sleewoo
1 parent 8ccce83 commit 00b127d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎types/formidable/formidable-tests.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import {
1212
PersistentFile,
1313
plugins,
1414
VolatileFile,
15+
PluginFunction,
16+
octetstream,
17+
querystring,
18+
multipart,
19+
json,
1520
} from "formidable";
1621
import * as http from "http";
1722

@@ -219,3 +224,12 @@ new IncomingForm();
219224

220225
// $ExpectType IncomingForm
221226
formidable();
227+
228+
// $ExpectType PluginFunction
229+
octetstream;
230+
// $ExpectType PluginFunction
231+
querystring;
232+
// $ExpectType PluginFunction
233+
multipart;
234+
// $ExpectType PluginFunction
235+
json;

‎types/formidable/index.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ declare const formidable: {
326326
IncomingForm: typeof Formidable;
327327
// parsers and mapped parsers
328328
parsers: typeof parsers;
329+
// add named plugin exports
330+
octetstream: formidable.PluginFunction;
331+
querystring: formidable.PluginFunction;
332+
multipart: formidable.PluginFunction;
333+
json: formidable.PluginFunction;
329334
} & formidable.MappedParsers;
330335

331336
export = formidable;

0 commit comments

Comments
 (0)