Merge pull request #12693 from rogierschouten/form-data

Improve typings for form-data
This commit is contained in:
Nathan Shively-Sanders
2016-11-22 15:36:26 -08:00
committed by GitHub
2 changed files with 13 additions and 3 deletions
+7
View File
@@ -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
});
}
+6 -3
View File
@@ -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 {