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

https.d.ts 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. declare module "https" {
  2. import * as tls from "tls";
  3. import * as events from "events";
  4. import * as http from "http";
  5. import { URL } from "url";
  6. type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
  7. type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
  8. rejectUnauthorized?: boolean; // Defaults to true
  9. servername?: string; // SNI TLS Extension
  10. };
  11. interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
  12. rejectUnauthorized?: boolean;
  13. maxCachedSessions?: number;
  14. }
  15. class Agent extends http.Agent {
  16. constructor(options?: AgentOptions);
  17. options: AgentOptions;
  18. }
  19. class Server extends tls.Server {
  20. constructor(requestListener?: http.RequestListener);
  21. constructor(options: ServerOptions, requestListener?: http.RequestListener);
  22. setTimeout(callback: () => void): this;
  23. setTimeout(msecs?: number, callback?: () => void): this;
  24. /**
  25. * Limits maximum incoming headers count. If set to 0, no limit will be applied.
  26. * @default 2000
  27. * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
  28. */
  29. maxHeadersCount: number | null;
  30. timeout: number;
  31. /**
  32. * Limit the amount of time the parser will wait to receive the complete HTTP headers.
  33. * @default 40000
  34. * {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
  35. */
  36. headersTimeout: number;
  37. keepAliveTimeout: number;
  38. }
  39. function createServer(requestListener?: http.RequestListener): Server;
  40. function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
  41. function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
  42. function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
  43. function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
  44. function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
  45. let globalAgent: Agent;
  46. }