// tests/uat/lib/test-hook-contract.d.ts — Plan 01-11 harness mirror.
//
// CANONICAL SOURCE: src/test-hooks/types.ts (production-side definition
// that ships with the test bundle and is type-checked by tsc as part of
// the `src/**/*` include).
//
// This file is a MANUAL MIRROR. Rationale (per Plan 01-11 RESEARCH §11
// resolution 5): keeping tests/ and src/ import-separable means the
// Puppeteer harness has no `import` reaching into `src/`. The type
// duplication is small (3 fields + nested handlers shape) and any drift
// surfaces as a TypeScript error in the harness — the wire shape
// inspections (`evaluate(() => globalThis.__mokoshTest!.foo)`) are
// statically checked against this declaration.
//
// Drift detection: a Tier-1-style test could snapshot-diff this file
// against src/test-hooks/types.ts; out of scope for Plan 01-11 (small
// surface; reviewer-spottable). If the surface grows beyond ~6 fields,
// promote the diff check to a CI gate.
//
// References:
//   - TypeScript ambient declaration files (`.d.ts`):
//     https://www.typescriptlang.org/docs/handbook/declaration-files/templates.html
//   - The canonical source: src/test-hooks/types.ts

/**
 * Mirror of `src/test-hooks/types.ts:MokoshTestSurface`. See that file
 * for full field-by-field semantics; keep this declaration in sync
 * whenever the canonical surface changes.
 */
interface MokoshTestSurfaceMirror {
  handlers: {
    onClicked: ((tab: chrome.tabs.Tab) => void | Promise<void>) | null;
    onStartup: (() => void | Promise<void>) | null;
    notificationOnClicked: ((notificationId: string) => void | Promise<void>) | null;
  };
  notificationCount: number;
  lastNotificationOptions: chrome.notifications.NotificationOptions<true> | null;
  readonly notificationIds: ReadonlyArray<string>;
  getCurrentStream?: () => MediaStream | null;
  getSegmentCount?: () => number;
}

declare global {
  // eslint-disable-next-line no-var
  var __mokoshTest: MokoshTestSurfaceMirror | undefined;
}

export {};
