export type FetchResponse = { content: string | null; status: number | null; }; /** * @fileoverview Fetcher is a utility for making requests to any arbitrary resource, * ignoring normal browser constraints such as CORS. */ /** @typedef {{content: string|null, status: number|null}} FetchResponse */ export class Fetcher { /** * @param {LH.Gatherer.ProtocolSession} session */ constructor(session: LH.Gatherer.ProtocolSession); session: LH.Gatherer.ProtocolSession; /** * Fetches any resource using the network directly. * * @param {string} url * @param {{timeout: number}=} options timeout is in ms * @return {Promise} */ fetchResource(url: string, options?: { timeout: number; } | undefined): Promise; /** * @param {string} url * @return {Promise} */ _fetchWithFetchApi(url: string): Promise; /** * @param {string} handle * @param {{timeout: number}=} options, * @return {Promise} */ _readIOStream(handle: string, options?: { timeout: number; } | undefined): Promise; /** * @param {string} url * @return {Promise<{stream: LH.Crdp.IO.StreamHandle|null, status: number|null}>} */ _loadNetworkResource(url: string): Promise<{ stream: LH.Crdp.IO.StreamHandle | null; status: number | null; }>; /** * @param {string} url * @param {{timeout: number}} options timeout is in ms * @return {Promise} */ _fetchResourceOverProtocol(url: string, options: { timeout: number; }): Promise; /** * @template T * @param {Promise} promise * @param {number} ms */ _wrapWithTimeout(promise: Promise, ms: number): Promise; } import * as LH from '../../types/lh.js'; //# sourceMappingURL=fetcher.d.ts.map