/** * Fills in where a component is defined when the page could only say how it * was registered. The page names a class's `customElements.define` call by a * number (`defineId`) on tree nodes and timeline events, and by its stack * (`defineFrames`) on details. The host's resolver (the extension maps them * through the page's sourcemaps) turns frames into a `source`, which is set * on whatever carried the number or the stack before it goes on. * * A number is asked about once: the first unknown ids of a page go to it in * one `define-frames` command, its answer is consumed here, and the result * is kept per page and id, so later events and nodes are filled on the spot. * * Order is kept. Events that must wait hold the ones behind them, and * inspector messages do the same among themselves, so a later `gone` or * fresher details cannot be overtaken by an older answer. With nothing held, * a message passes straight through. A resolver that fails, or an answer * that takes longer than {@link RESOLVE_TIMEOUT_MS}, leaves things as they * came, and the miss is remembered rather than retried. */ import type { ElementSource, GeneratedFrame, TemplateSite } from '../../types/inspector.js'; import type { TimelineSource } from './source.js'; /** Maps a define call's stack to where the class is written. */ export type DefineSourceResolver = (frames: GeneratedFrame[]) => Promise; /** Finds where the template a details message names renders the element. */ export type TemplateLocator = (site: TemplateSite) => Promise; /** * `source`, with its events and inspector messages passed through `resolve`, * and the template a details message names through `locate` into its * `callSite`. The template site itself never goes further. */ export declare const withDefineSources: (source: TimelineSource, resolve: DefineSourceResolver, timeoutMs?: number, locate?: TemplateLocator) => TimelineSource; //# sourceMappingURL=define-sources.d.ts.map