Bot discord pour le serveur d'Ingénieurs pour Demain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. /// <reference types="node" />
  6. import * as stream from 'stream';
  7. import * as http from 'http';
  8. export = FormData;
  9. // Extracted because @types/node doesn't export interfaces.
  10. interface ReadableOptions {
  11. highWaterMark?: number;
  12. encoding?: string;
  13. objectMode?: boolean;
  14. read?(this: stream.Readable, size: number): void;
  15. destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void;
  16. autoDestroy?: boolean;
  17. }
  18. interface Options extends ReadableOptions {
  19. writable?: boolean;
  20. readable?: boolean;
  21. dataSize?: number;
  22. maxDataSize?: number;
  23. pauseStreams?: boolean;
  24. }
  25. declare class FormData extends stream.Readable {
  26. constructor(options?: Options);
  27. append(key: string, value: any, options?: FormData.AppendOptions | string): void;
  28. getHeaders(userHeaders?: FormData.Headers): FormData.Headers;
  29. submit(
  30. params: string | FormData.SubmitOptions,
  31. callback?: (error: Error | null, response: http.IncomingMessage) => void
  32. ): http.ClientRequest;
  33. getBuffer(): Buffer;
  34. getBoundary(): string;
  35. getLength(callback: (err: Error | null, length: number) => void): void;
  36. getLengthSync(): number;
  37. hasKnownLength(): boolean;
  38. }
  39. declare namespace FormData {
  40. interface Headers {
  41. [key: string]: any;
  42. }
  43. interface AppendOptions {
  44. header?: string | Headers;
  45. knownLength?: number;
  46. filename?: string;
  47. filepath?: string;
  48. contentType?: string;
  49. }
  50. interface SubmitOptions extends http.RequestOptions {
  51. protocol?: 'https:' | 'http:';
  52. }
  53. }