/** * A `fetch` that goes through the page. The standalone server has no business * reading a page's URLs itself (it would fetch whatever a connected page * names, from the server's network), so to map a define call's stack through * the page's sourcemaps it asks the page to read its own scripts: a * `fetch-text` command out, a `fetched-text` message back (see * `runtime/inspector/install.ts`, which refuses anything off the page's * origin). * * The reply is consumed here and never reaches the sink; nothing else * listens for it. Two asks for one URL at the same time share one command. A * page that never answers (closed, or older than the command) leaves the ask * waiting at most {@link FETCH_TIMEOUT_MS}, after which it reads as a failed * fetch. Nothing is cached: the caller (the sourcemap resolver) keeps what * it needs. */ import type { TimelineSource } from './source.js'; import type { FetchedResponse } from './source-maps.js'; export interface PageFetch { /** `source`, with `fetched-text` replies taken out of its messages. */ source: TimelineSource; /** Reads `url` in the page. Resolves, never rejects; a miss is `ok: false`. */ fetch: (url: string) => Promise; } export declare const withPageFetch: (source: TimelineSource, timeoutMs?: number) => PageFetch; //# sourceMappingURL=page-fetch.d.ts.map