選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

index.d.ts 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Type definitions for body-parser 1.17
  2. // Project: https://github.com/expressjs/body-parser
  3. // Definitions by: Santi Albo <https://github.com/santialbo>
  4. // Vilic Vane <https://github.com/vilic>
  5. // Jonathan Häberle <https://github.com/dreampulse>
  6. // Gevik Babakhani <https://github.com/blendsdk>
  7. // Tomasz Łaziuk <https://github.com/tlaziuk>
  8. // Jason Walton <https://github.com/jwalton>
  9. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  10. // TypeScript Version: 2.3
  11. /// <reference types="node" />
  12. import { NextHandleFunction } from 'connect';
  13. import * as http from 'http';
  14. // for docs go to https://github.com/expressjs/body-parser/tree/1.16.0#body-parser
  15. // @deprecated
  16. declare function bodyParser(options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded): NextHandleFunction;
  17. declare namespace bodyParser {
  18. interface Options {
  19. inflate?: boolean;
  20. limit?: number | string;
  21. type?: string | string[] | ((req: http.IncomingMessage) => any);
  22. verify?(req: http.IncomingMessage, res: http.ServerResponse, buf: Buffer, encoding: string): void;
  23. }
  24. interface OptionsJson extends Options {
  25. reviver?(key: string, value: any): any;
  26. strict?: boolean;
  27. }
  28. interface OptionsText extends Options {
  29. defaultCharset?: string;
  30. }
  31. interface OptionsUrlencoded extends Options {
  32. extended?: boolean;
  33. parameterLimit?: number;
  34. }
  35. function json(options?: OptionsJson): NextHandleFunction;
  36. function raw(options?: Options): NextHandleFunction;
  37. function text(options?: OptionsText): NextHandleFunction;
  38. function urlencoded(options?: OptionsUrlencoded): NextHandleFunction;
  39. }
  40. export = bodyParser;