export type TargetWithSession = { target: LH.Crdp.Target.TargetInfo; cdpSession: LH.Puppeteer.CDPSession; session: LH.Gatherer.ProtocolSession; protocolListener: (event: unknown) => void; }; export type ProtocolEventMap = { "protocolevent": [LH.Protocol.RawEventMessage]; }; export type ProtocolEventMessageEmitter = LH.Protocol.StrictEventEmitterClass; declare const TargetManager_base: ProtocolEventMessageEmitter; /** * Tracks targets (the page itself, its iframes, their iframes, etc) as they * appear and allows listeners to the flattened protocol events from all targets. */ export class TargetManager extends TargetManager_base { /** @param {LH.Puppeteer.CDPSession} cdpSession */ constructor(cdpSession: LH.Puppeteer.CDPSession); _enabled: boolean; _rootCdpSession: import("../../index.js").Puppeteer.CDPSession; _mainFrameId: string; /** * A map of target id to target/session information. Used to ensure unique * attached targets. * @type {Map} */ _targetIdToTargets: Map; /** @type {Map} */ _executionContextIdToDescriptions: Map; /** * @param {LH.Puppeteer.CDPSession} cdpSession */ _onSessionAttached(cdpSession: LH.Puppeteer.CDPSession): Promise; /** * @param {LH.Crdp.Page.FrameNavigatedEvent} frameNavigatedEvent */ _onFrameNavigated(frameNavigatedEvent: LH.Crdp.Page.FrameNavigatedEvent): Promise; /** * @param {LH.Crdp.Runtime.ExecutionContextCreatedEvent} event */ _onExecutionContextCreated(event: LH.Crdp.Runtime.ExecutionContextCreatedEvent): void; /** * @param {LH.Crdp.Runtime.ExecutionContextDestroyedEvent} event */ _onExecutionContextDestroyed(event: LH.Crdp.Runtime.ExecutionContextDestroyedEvent): void; _onExecutionContextsCleared(): void; /** * @param {string} sessionId * @return {LH.Gatherer.ProtocolSession} */ _findSession(sessionId: string): LH.Gatherer.ProtocolSession; /** * @param {string} targetType * @return {targetType is LH.Protocol.TargetType} */ _isAcceptedTargetType(targetType: string): targetType is LH.Protocol.TargetType; /** * Returns the root session. * @return {LH.Gatherer.ProtocolSession} */ rootSession(): LH.Gatherer.ProtocolSession; mainFrameExecutionContexts(): import("devtools-protocol").Protocol.Runtime.ExecutionContextDescription[]; /** * Returns a listener for all protocol events from session, and augments the * event with the sessionId. * @param {LH.Protocol.TargetType} targetType * @param {string} sessionId */ _getProtocolEventListener(targetType: LH.Protocol.TargetType, sessionId: string): (method: EventName, params: LH.Protocol.RawEventMessageRecord[EventName]["params"]) => void; /** * @return {Promise} */ enable(): Promise; /** * @return {Promise} */ disable(): Promise; } export {}; //# sourceMappingURL=target-manager.d.ts.map