mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #12693 from rogierschouten/form-data
Improve typings for form-data
This commit is contained in:
@@ -132,3 +132,10 @@ import * as ImportUsingES6Syntax from 'form-data';
|
||||
console.log(json);
|
||||
});
|
||||
}
|
||||
|
||||
() => {
|
||||
var form = new FormData();
|
||||
form.getLength((err: Error, length: number): void => {
|
||||
// nothing
|
||||
});
|
||||
}
|
||||
|
||||
Vendored
+6
-3
@@ -5,15 +5,18 @@
|
||||
|
||||
// Imported from: https://github.com/soywiz/typescript-node-definitions/form-data.d.ts
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = FormData;
|
||||
|
||||
declare class FormData {
|
||||
import * as stream from "stream";
|
||||
|
||||
declare class FormData extends stream.Readable {
|
||||
append(key: string, value: any, options?: any): void;
|
||||
getHeaders(): FormData.Dictionary<string>;
|
||||
// TODO expand pipe
|
||||
pipe(to: any): any;
|
||||
submit(params: string | Object, callback: (error: any, response: any) => void): any;
|
||||
getBoundary(): string;
|
||||
getLength(callback: (err: Error, length: number) => void): void;
|
||||
}
|
||||
|
||||
declare namespace FormData {
|
||||
|
||||
Reference in New Issue
Block a user