diff --git a/form-data/form-data-tests.ts b/form-data/form-data-tests.ts
index 2df21510c0..6d1b9d6cb9 100644
--- a/form-data/form-data-tests.ts
+++ b/form-data/form-data-tests.ts
@@ -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
+ });
+}
diff --git a/form-data/index.d.ts b/form-data/index.d.ts
index 606ffdbd4a..e4bd6ca2e1 100644
--- a/form-data/index.d.ts
+++ b/form-data/index.d.ts
@@ -5,15 +5,18 @@
// Imported from: https://github.com/soywiz/typescript-node-definitions/form-data.d.ts
+///
+
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;
- // 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 {