mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Improve typings for form-data
This commit is contained in:
parent
33ae2bd878
commit
6980db6a37
@ -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
|
||||
});
|
||||
}
|
||||
|
||||
9
form-data/index.d.ts
vendored
9
form-data/index.d.ts
vendored
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user