@webability/core 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -52,6 +52,11 @@ interface DetectedIssue {
52
52
  interface FixDetector {
53
53
  name: string;
54
54
  detect(page: PageLike): Promise<DetectedIssue[]>;
55
+ /** Per-page emission cap, when the detector has one. When a run returns
56
+ * >= cap findings the results are TRUNCATED (DOM-order biased) and the
57
+ * scan reports it via ScanResult.truncated — silent truncation reads as
58
+ * "covered everything" when it didn't (loop iter8 / honesty infra). */
59
+ cap?: number;
55
60
  }
56
61
  /**
57
62
  * Browser-runtime detector signature.
@@ -116,6 +121,21 @@ interface ScanResult {
116
121
  timestamp: string;
117
122
  /** High-confidence violations. Safe to surface as bugs. */
118
123
  issues: ScanIssue[];
124
+ /** Detectors that hit their per-page cap this run — their counts are lower
125
+ * bounds, not a census. Additive field; absent = nothing truncated. */
126
+ truncated?: Array<{
127
+ detector: string;
128
+ cap: number;
129
+ }>;
130
+ /**
131
+ * Non-fatal engine subsystem failures that silently disable a category of
132
+ * checks. Consumers MUST surface these to the user — a result with
133
+ * `engineWarnings` is NOT a full scan. Currently: `'color:kernel-injection-failed'`
134
+ * disables all contrast checks for the page. Absent = all subsystems healthy.
135
+ */
136
+ engineWarnings?: string[];
137
+ /** Engine (core package) version that produced this result — provenance */
138
+ engine?: string;
119
139
  /**
120
140
  * Findings the classifier or axe-core flagged as ambiguous. Show to the user
121
141
  * for review — never auto-fix. Empty array (not omitted) when no incompletes,
@@ -160,11 +180,27 @@ interface ScanOptions {
160
180
  enableScreenshots?: boolean;
161
181
  /** Scan content inside iframes. Default: false. */
162
182
  includeIframes?: boolean;
183
+ /**
184
+ * Wait for entrance animations to finish before scanning (prevents false
185
+ * contrast failures on mid-fade text). `false` disables, a number sets the
186
+ * wait cap in ms. Default: enabled with a 4000ms cap.
187
+ */
188
+ settle?: boolean | number;
163
189
  }
164
190
 
165
191
  declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
166
192
 
167
- declare function runDetectors(page: PageLike): Promise<DetectedIssue[]>;
193
+ type TruncationEntry = {
194
+ detector: string;
195
+ cap: number;
196
+ };
197
+ /**
198
+ * `outTruncated` collects which detectors hit their per-page cap THIS call.
199
+ * `outWarnings` collects non-fatal engine subsystem failures (e.g. kernel
200
+ * injection blocked by CSP) that silently disable a category of checks.
201
+ * Both arrays are per-invocation (caller-owned), never module state.
202
+ */
203
+ declare function runDetectors(page: PageLike, outTruncated?: TruncationEntry[], outWarnings?: string[]): Promise<DetectedIssue[]>;
168
204
  declare function extractSiteTheme(page: PageLike): Promise<SiteTheme>;
169
205
 
170
206
  interface AxeViolation {
package/dist/index.d.ts CHANGED
@@ -52,6 +52,11 @@ interface DetectedIssue {
52
52
  interface FixDetector {
53
53
  name: string;
54
54
  detect(page: PageLike): Promise<DetectedIssue[]>;
55
+ /** Per-page emission cap, when the detector has one. When a run returns
56
+ * >= cap findings the results are TRUNCATED (DOM-order biased) and the
57
+ * scan reports it via ScanResult.truncated — silent truncation reads as
58
+ * "covered everything" when it didn't (loop iter8 / honesty infra). */
59
+ cap?: number;
55
60
  }
56
61
  /**
57
62
  * Browser-runtime detector signature.
@@ -116,6 +121,21 @@ interface ScanResult {
116
121
  timestamp: string;
117
122
  /** High-confidence violations. Safe to surface as bugs. */
118
123
  issues: ScanIssue[];
124
+ /** Detectors that hit their per-page cap this run — their counts are lower
125
+ * bounds, not a census. Additive field; absent = nothing truncated. */
126
+ truncated?: Array<{
127
+ detector: string;
128
+ cap: number;
129
+ }>;
130
+ /**
131
+ * Non-fatal engine subsystem failures that silently disable a category of
132
+ * checks. Consumers MUST surface these to the user — a result with
133
+ * `engineWarnings` is NOT a full scan. Currently: `'color:kernel-injection-failed'`
134
+ * disables all contrast checks for the page. Absent = all subsystems healthy.
135
+ */
136
+ engineWarnings?: string[];
137
+ /** Engine (core package) version that produced this result — provenance */
138
+ engine?: string;
119
139
  /**
120
140
  * Findings the classifier or axe-core flagged as ambiguous. Show to the user
121
141
  * for review — never auto-fix. Empty array (not omitted) when no incompletes,
@@ -160,11 +180,27 @@ interface ScanOptions {
160
180
  enableScreenshots?: boolean;
161
181
  /** Scan content inside iframes. Default: false. */
162
182
  includeIframes?: boolean;
183
+ /**
184
+ * Wait for entrance animations to finish before scanning (prevents false
185
+ * contrast failures on mid-fade text). `false` disables, a number sets the
186
+ * wait cap in ms. Default: enabled with a 4000ms cap.
187
+ */
188
+ settle?: boolean | number;
163
189
  }
164
190
 
165
191
  declare function scan(target: string | PageLike, options?: ScanOptions): Promise<ScanResult>;
166
192
 
167
- declare function runDetectors(page: PageLike): Promise<DetectedIssue[]>;
193
+ type TruncationEntry = {
194
+ detector: string;
195
+ cap: number;
196
+ };
197
+ /**
198
+ * `outTruncated` collects which detectors hit their per-page cap THIS call.
199
+ * `outWarnings` collects non-fatal engine subsystem failures (e.g. kernel
200
+ * injection blocked by CSP) that silently disable a category of checks.
201
+ * Both arrays are per-invocation (caller-owned), never module state.
202
+ */
203
+ declare function runDetectors(page: PageLike, outTruncated?: TruncationEntry[], outWarnings?: string[]): Promise<DetectedIssue[]>;
168
204
  declare function extractSiteTheme(page: PageLike): Promise<SiteTheme>;
169
205
 
170
206
  interface AxeViolation {