import type { Page } from "playwright";
export interface MutationEvent {
    type: "added" | "removed" | "changed";
    selector: string;
    tagName?: string;
    text?: string;
    previousValue?: string;
    currentValue?: string;
    timestamp: number;
    attribute?: string;
}
export interface MutationOptions {
    /** Subtree to watch (default: "body") */
    rootSelector?: string;
    /** Watch for childList changes */
    childList?: boolean;
    /** Watch for attribute changes */
    attributes?: boolean;
    /** Watch for character data changes */
    characterData?: boolean;
    /** Track text changes on specific attributes */
    attributeFilter?: string[];
}
/**
 * Detect DOM mutations during test execution.
 * Returns a function that retrieves accumulated mutation events.
 * Useful for verifying that async UI updates actually happened.
 */
export declare function watchMutations(page: Page, options?: MutationOptions): () => Promise<MutationEvent[]>;
/**
 * Wait for a specific DOM mutation to occur (element added).
 * Useful as a replacement for arbitrary sleep delays.
 */
export declare function waitForElement(page: Page, selector: string, timeout?: number): Promise<boolean>;
/**
 * Wait for a specific element to be removed from the DOM.
 */
export declare function waitForElementRemoved(page: Page, selector: string, timeout?: number): Promise<boolean>;
/**
 * Wait for text content to appear on the page.
 */
export declare function waitForText(page: Page, text: string, timeout?: number): Promise<boolean>;
/**
 * Snapshot the current DOM structure for comparison.
 * Returns a compacted HTML string of the body.
 */
export declare function snapshotDOM(page: Page): Promise<string>;
/**
 * Compare two DOM snapshots and return a list of differences.
 */
export declare function compareSnapshots(before: string, after: string): string[];
export declare function extractElements(html: string): Record<string, string>;
//# sourceMappingURL=dom-mutation.d.ts.map