Sha256: 736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50

Contents?: true

Size: 1.78 KB

Versions: 49

Compression:

Stored size: 1.78 KB

Contents

// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
//                 Leon Yu <https://github.com/leonyu>
//                 BendingBender <https://github.com/BendingBender>
//                 Maple Miao <https://github.com/mapleeit>

/// <reference types="node" />
import * as stream from 'stream';
import * as http from 'http';

export = FormData;

// Extracted because @types/node doesn't export interfaces.
interface ReadableOptions {
  highWaterMark?: number;
  encoding?: string;
  objectMode?: boolean;
  read?(this: stream.Readable, size: number): void;
  destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void;
  autoDestroy?: boolean;
}

interface Options extends ReadableOptions {
  writable?: boolean;
  readable?: boolean;
  dataSize?: number;
  maxDataSize?: number;
  pauseStreams?: boolean;
}

declare class FormData extends stream.Readable {
  constructor(options?: Options);
  append(key: string, value: any, options?: FormData.AppendOptions | string): void;
  getHeaders(userHeaders?: FormData.Headers): FormData.Headers;
  submit(
    params: string | FormData.SubmitOptions,
    callback?: (error: Error | null, response: http.IncomingMessage) => void
  ): http.ClientRequest;
  getBuffer(): Buffer;
  setBoundary(boundary: string): void;
  getBoundary(): string;
  getLength(callback: (err: Error | null, length: number) => void): void;
  getLengthSync(): number;
  hasKnownLength(): boolean;
}

declare namespace FormData {
  interface Headers {
    [key: string]: any;
  }

  interface AppendOptions {
    header?: string | Headers;
    knownLength?: number;
    filename?: string;
    filepath?: string;
    contentType?: string;
  }

  interface SubmitOptions extends http.RequestOptions {
    protocol?: 'https:' | 'http:';
  }
}

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/form-data/index.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/form-data/index.d.ts