import type { Page } from "playwright"; import type { ListenerChangeType, ListenerId, ListenerTriggerEvent, PageListener, PageListenerInfo, PageListenerManagerConfig } from "./page-listener-types.js"; export declare function matchPath(target: string, pattern: string): boolean; export declare function extractPathname(url: string): string; export declare function derivePathPatternFromUrl(page: Page | null): string; interface DetectNodeLike { nodeType: number; } interface DetectMutationLike { type: string; addedNodes?: ArrayLike | null; removedNodes?: ArrayLike | null; } export declare function nodesContainElement(nodes: ArrayLike | null | undefined): boolean; export declare function detectChangeTypes(mutations: ArrayLike | null | undefined): ListenerChangeType[]; export declare function detectChangeType(mutations: ArrayLike | null | undefined): ListenerChangeType; export interface AddListenerParams { selector: string; pathPattern: string; prompt: string; enabled?: boolean; changeTypes?: ListenerChangeType[]; } export interface UpdateListenerParams { listenerId: ListenerId; selector?: string; pathPattern?: string; prompt?: string; enabled?: boolean; changeTypes?: ListenerChangeType[]; } export declare class PageListenerManager { private readonly agentId; private readonly browserId; private readonly config; private readonly listeners; private readonly eventQueue; private readonly triggerMeta; private readonly pendingChangeTypes; private readonly existsLatched; private readonly attachedPages; private readonly navHandledPages; private currentPage; constructor(agentId: string, browserId: string, config?: PageListenerManagerConfig); getCurrentPage(): Page | null; loadFromStore(): Promise; attach(page: Page): Promise; reattach(page: Page): Promise; addListener(params: AddListenerParams): Promise; updateListener(params: UpdateListenerParams): Promise; removeListener(id: ListenerId): Promise; toggleListener(id: ListenerId, enabled?: boolean): Promise; listListeners(): Promise; hasPendingEvents(): boolean; enqueueEvent(event: ListenerTriggerEvent): void; dequeueEvent(): ListenerTriggerEvent | undefined; collectEvents(): ListenerTriggerEvent[]; scanExistsAtPoll(): Promise; dispose(): Promise; setHighlightEnabled(enabled: boolean): Promise; private ensureExposed; private attachNavigationHandler; private handleDomChange; private installOnPage; private uninstallOnPage; private elementExists; } export {};