Improve typings for form-data

This commit is contained in:
Rogier Schouten 2016-11-15 14:47:30 +01:00
parent 33ae2bd878
commit 6980db6a37
2 changed files with 13 additions and 3 deletions

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
});
}

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 {