wzp
2021-05-13 7d694a9113118daec5be7ac224dab46a3b20f106
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Agent } from 'http';
import { Headers } from './Headers';
import { ICache } from './ICache';
import Response = require('http-response-object');
import { CachedResponse } from './CachedResponse';
interface Options {
    agent?: Agent | boolean;
    allowRedirectHeaders?: string[];
    cache?: 'file' | 'memory' | ICache;
    duplex?: boolean;
    followRedirects?: boolean;
    gzip?: boolean;
    headers?: Headers;
    ignoreFailedInvalidation?: boolean;
    maxRedirects?: number;
    maxRetries?: number;
    retry?: boolean | ((err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream> | void, attemptNumber: number) => boolean);
    retryDelay?: number | ((err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream> | void, attemptNumber: number) => number);
    socketTimeout?: number;
    timeout?: number;
    isMatch?: (requestHeaders: Headers, cachedResponse: CachedResponse, defaultValue: boolean) => boolean;
    isExpired?: (cachedResponse: CachedResponse, defaultValue: boolean) => boolean;
    canCache?: (res: Response<NodeJS.ReadableStream>, defaultValue: boolean) => boolean;
}
export { Options };