import type { Page } from 'playwright'; /** A green walk is not a clean surface: what these classes do not cover is in docs/walk-review-inventory-2026-08-30.md. */ export declare const DEFECT_CLASSES: readonly ['accessibility-error', 'accessibility-warning', 'buy-box-above-fold', 'content-integrity', 'error-page-status', 'fabricated-claim', 'fake-session', 'light-on-light', 'link-integrity', 'ops-leakage', 'placeholder-asset', 'stub-only-entity']; export type DefectClass = (typeof DEFECT_CLASSES)[number]; /** `blocking` breaks trust or the buy path; `major` confuses the buyer; `minor` is polish. */ export type Severity = 'blocking' | 'major' | 'minor'; /** `evidence` is the measured value (colours and ratio, status code, matched text), never a restatement of the class. */ export type Finding = { class: DefectClass; evidence: string; selector?: string; severity: Severity; url: string; }; export type Viewport = { height: number; width: number; }; export type ProbeContext = { headers?: Record; /** One memo per walk: `link-integrity` would otherwise HEAD the same footer link once per page. */ memo: Map; options: Record; /** From `page.goto`'s own response; nothing on a loaded page remembers it. */ status: number; url: string; viewport: Viewport; }; export type Probe = { class: DefectClass; id: string; /** D-031: refuses the run when a required option is missing; a probe with nothing to look for is indistinguishable from a clean page. */ needs?: (options: Record) => Promise | void; alsoFilesUnder?: DefectClass[]; run: (page: Page, context: ProbeContext) => Promise; /** The reading no single page can make, called once after every page; each finding is filed against the page whose `url` it names. */ finish?: (context: FinishContext) => Finding[]; }; export declare const classesOf: (probe: Probe) => DefectClass[]; export type FinishContext = { memo: Map; options: Record; urls: string[]; }; export type PageReport = { findings: Finding[]; status: number; url: string; }; export type Webgl = { available: false; } | { available: true; caveat: 'granted' | 'refused'; renderer: null | string; vendor: null | string; }; export type PageReady = { scrollTo?: string; waitFor?: string; }; export type WalkReport = { /** Keyed by the classes that ran: a zero means probed for, none found; an absent class was never looked for. */ counts: Partial>; finishedAt: string; gpu: boolean; pages: PageReport[]; probes: string[]; startedAt: string; stoppedAt?: { url: string; why: string; }; viewport: Viewport; webgl: Webgl; }; /** The walk could not run (exit 2), as distinct from a run that found nothing. */ export declare class WalkError extends Error { constructor(message: string); } export declare class WalkStopped extends WalkError { readonly report: WalkReport; constructor(message: string, report: WalkReport); }