/**
* Screenshot masker — blur or black-box PII regions in captured screenshots.
*
* Strategy: inject a CSS overlay into the page before screenshot capture that
* covers detected PII-likely elements (input[type=email], input[type=password],
* elements with PII-containing text) with a blur or solid black mask.
*
* This is a CSS-based approach (no image processing library needed):
* 1. Identify likely-PII DOM elements via selectors
* 2. Add an overlaid
with blur/black filter at each element's bounding box
* 3. Take screenshot
* 4. Remove overlays
*
* Falls back gracefully if elements are not found or overlay injection fails.
*/
import type { Page } from 'playwright';
export interface MaskingOpts {
/** Additional CSS selectors to mask (in addition to defaults) */
extraSelectors?: string[];
/** Masking style: 'blur' or 'blackout' */
style?: 'blur' | 'blackout';
/** Blur strength in px (default 8) */
blurPx?: number;
}
export declare function maskScreenshot(page: Page, opts?: MaskingOpts): Promise<{
maskedCount: number;
screenshot: Buffer;
}>;