@domandigital/craft 0.6.0 → 0.8.0

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/audit.d.cts CHANGED
@@ -170,6 +170,8 @@ interface Finding {
170
170
  excerpt: string;
171
171
  message: string;
172
172
  fix: string;
173
+ /** The house copy tier (`house.ts`), on copy findings only. */
174
+ house?: "block" | "review" | "explicit";
173
175
  }
174
176
  /**
175
177
  * A declared reason to keep a tell. Lives in the site's `art-direction.json`.
@@ -329,6 +331,7 @@ interface SnapshotOptions {
329
331
  timeoutMs?: number;
330
332
  }
331
333
  interface MinimalPage {
334
+ close?(): Promise<void>;
332
335
  goto(url: string, options?: {
333
336
  waitUntil?: string;
334
337
  timeout?: number;
@@ -365,6 +368,18 @@ declare function loadPlaywright(): Promise<Launcher>;
365
368
  declare function snapshotPage(page: MinimalPage, url: string, options?: SnapshotOptions): Promise<Snapshot>;
366
369
  /** Launch a browser, open `url`, and capture a snapshot. */
367
370
  declare function snapshotUrl(url: string, options?: SnapshotOptions): Promise<Snapshot>;
371
+ interface SnapshotResult {
372
+ url: string;
373
+ snapshot?: Snapshot;
374
+ /** Why this page has no snapshot. The others are still taken. */
375
+ error?: string;
376
+ }
377
+ /**
378
+ * Several pages through one browser, in order. A null model is twenty pages;
379
+ * launching Chromium twenty times is most of the wait. One page that will not
380
+ * load costs that page, not the batch.
381
+ */
382
+ declare function snapshotUrls(urls: string[], options?: SnapshotOptions): Promise<SnapshotResult[]>;
368
383
  interface AuditResult {
369
384
  snapshot: Snapshot;
370
385
  report: CheckReport;
@@ -373,4 +388,4 @@ interface AuditResult {
373
388
  /** Snapshot a URL, judge it against the rendered tells, and fingerprint it. */
374
389
  declare function audit(url: string, options?: SnapshotOptions & CheckOptions): Promise<AuditResult>;
375
390
 
376
- export { type AuditResult, type SnapshotOptions, audit, collectInPage, loadPlaywright, overlayInPage, snapshotPage, snapshotUrl };
391
+ export { type AuditResult, type SnapshotOptions, type SnapshotResult, audit, collectInPage, loadPlaywright, overlayInPage, snapshotPage, snapshotUrl, snapshotUrls };
package/dist/audit.d.ts CHANGED
@@ -170,6 +170,8 @@ interface Finding {
170
170
  excerpt: string;
171
171
  message: string;
172
172
  fix: string;
173
+ /** The house copy tier (`house.ts`), on copy findings only. */
174
+ house?: "block" | "review" | "explicit";
173
175
  }
174
176
  /**
175
177
  * A declared reason to keep a tell. Lives in the site's `art-direction.json`.
@@ -329,6 +331,7 @@ interface SnapshotOptions {
329
331
  timeoutMs?: number;
330
332
  }
331
333
  interface MinimalPage {
334
+ close?(): Promise<void>;
332
335
  goto(url: string, options?: {
333
336
  waitUntil?: string;
334
337
  timeout?: number;
@@ -365,6 +368,18 @@ declare function loadPlaywright(): Promise<Launcher>;
365
368
  declare function snapshotPage(page: MinimalPage, url: string, options?: SnapshotOptions): Promise<Snapshot>;
366
369
  /** Launch a browser, open `url`, and capture a snapshot. */
367
370
  declare function snapshotUrl(url: string, options?: SnapshotOptions): Promise<Snapshot>;
371
+ interface SnapshotResult {
372
+ url: string;
373
+ snapshot?: Snapshot;
374
+ /** Why this page has no snapshot. The others are still taken. */
375
+ error?: string;
376
+ }
377
+ /**
378
+ * Several pages through one browser, in order. A null model is twenty pages;
379
+ * launching Chromium twenty times is most of the wait. One page that will not
380
+ * load costs that page, not the batch.
381
+ */
382
+ declare function snapshotUrls(urls: string[], options?: SnapshotOptions): Promise<SnapshotResult[]>;
368
383
  interface AuditResult {
369
384
  snapshot: Snapshot;
370
385
  report: CheckReport;
@@ -373,4 +388,4 @@ interface AuditResult {
373
388
  /** Snapshot a URL, judge it against the rendered tells, and fingerprint it. */
374
389
  declare function audit(url: string, options?: SnapshotOptions & CheckOptions): Promise<AuditResult>;
375
390
 
376
- export { type AuditResult, type SnapshotOptions, audit, collectInPage, loadPlaywright, overlayInPage, snapshotPage, snapshotUrl };
391
+ export { type AuditResult, type SnapshotOptions, type SnapshotResult, audit, collectInPage, loadPlaywright, overlayInPage, snapshotPage, snapshotUrl, snapshotUrls };