import { MiddlewareComposition } from './middleware'; /** Allow customizing the default behavior */ export interface HyperlinkWatcherInputOptions { selector?: string; composition: MiddlewareComposition; disablePopUpBlockersWorkaround?: boolean; } /** Watcher options */ export interface HyperlinkWatcherOptions { selector: string; composition: MiddlewareComposition; disablePopUpBlockersWorkaround: boolean; } export declare function getDefaultHyperlinkWatcherOptions(): HyperlinkWatcherOptions; /** Its instance allows you to chain middlewares */ export declare class HyperlinkWatcher { protected readonly options: HyperlinkWatcherOptions; protected observer: MutationObserver | null; protected scopedElementClicked: EventListenerOrEventListenerObject; constructor(options: HyperlinkWatcherInputOptions); /** Watch clicks on DOM hyperlinks * * Note: this will watch existing hyperlinks when called, but will also manage new hyperlinks added to the DOM */ watch(): void; /** Stop watching clicks on DOM hyperlinks (useful to free memory) */ unwatch(): void; /** Helper to add listener since called at different places */ protected watchElementClick(element: Element): void; /** With stop the default click to simulate our how logic with middlewares * * Note: the structure of this method is a bit different because of a potentiel issue when binding the context (ref: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/unbound-method.md) */ protected elementClicked: (event: Event) => void; }