UNPKG

1.78 kBTypeScriptView Raw
1/**
2 * -------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4 * See License in the project root for license information.
5 * -------------------------------------------------------------------------------------------
6 */
7/**
8 * @interface {@link https://github.com/bitinn/node-fetch/#options}
9 * Signature to define the fetch request options for node environment
10 * @property {number} [follow] - node-fetch option: maximum redirect count. 0 to not follow redirect
11 * @property {number} [compress] - node-fetch option: support gzip/deflate content encoding. false to disable
12 * @property {number} [size] - node-fetch option: maximum response body size in bytes. 0 to disable
13 * @property {any} [agent] - node-fetch option: HTTP(S).Agent instance, allows custom proxy, certificate, lookup, family etc.
14 * @property {number} [highWaterMark] - node-fetch option: maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource.
15 * @property {boolean} [insecureHTTPParser] - node-fetch option: use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
16 */
17export interface NodeFetchInit {
18 follow?: number;
19 compress?: boolean;
20 size?: number;
21 agent?: any;
22 highWaterMark?: number;
23 insecureHTTPParser?: boolean;
24}
25/**
26 * @interface
27 * Signature to define the fetch api options which includes both fetch standard options and also the extended node fetch options
28 * @extends RequestInit @see {@link https://fetch.spec.whatwg.org/#requestinit}
29 * @extends NodeFetchInit
30 */
31export interface FetchOptions extends RequestInit, NodeFetchInit {
32}