source: imaps-frontend/node_modules/form-data/index.d.ts

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.8 KB
RevLine 
[d565449]1// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
2// Leon Yu <https://github.com/leonyu>
3// BendingBender <https://github.com/BendingBender>
4// Maple Miao <https://github.com/mapleeit>
5
6/// <reference types="node" />
7import * as stream from 'stream';
8import * as http from 'http';
9
10export = FormData;
11
12// Extracted because @types/node doesn't export interfaces.
13interface ReadableOptions {
14 highWaterMark?: number;
15 encoding?: string;
16 objectMode?: boolean;
17 read?(this: stream.Readable, size: number): void;
18 destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void;
19 autoDestroy?: boolean;
20}
21
22interface Options extends ReadableOptions {
23 writable?: boolean;
24 readable?: boolean;
25 dataSize?: number;
26 maxDataSize?: number;
27 pauseStreams?: boolean;
28}
29
30declare class FormData extends stream.Readable {
31 constructor(options?: Options);
32 append(key: string, value: any, options?: FormData.AppendOptions | string): void;
33 getHeaders(userHeaders?: FormData.Headers): FormData.Headers;
34 submit(
35 params: string | FormData.SubmitOptions,
36 callback?: (error: Error | null, response: http.IncomingMessage) => void
37 ): http.ClientRequest;
38 getBuffer(): Buffer;
39 setBoundary(boundary: string): void;
40 getBoundary(): string;
41 getLength(callback: (err: Error | null, length: number) => void): void;
42 getLengthSync(): number;
43 hasKnownLength(): boolean;
44}
45
46declare namespace FormData {
47 interface Headers {
48 [key: string]: any;
49 }
50
51 interface AppendOptions {
52 header?: string | Headers;
53 knownLength?: number;
54 filename?: string;
55 filepath?: string;
56 contentType?: string;
57 }
58
59 interface SubmitOptions extends http.RequestOptions {
60 protocol?: 'https:' | 'http:';
61 }
62}
Note: See TracBrowser for help on using the repository browser.