// The phrase finder's shapes (release 34), shared by its server // (lib/phrase-finder/server.ts, the /api/phrase-finder routes) and the page // (components/tools/PhraseFinder.tsx). Types only. export type PhraseMode = "auto" | "words" | "regex"; /** A checked search (lib/phrase-finder/scan.mjs checkSpec). */ export type PhraseScanSpec = { rows: { id: string; text: string; label?: string; mode: PhraseMode; source: string; used: "words" | "regex" }[]; channels: string[]; prefer: string | null; exclude: string | null; }; export type PhraseSample = { slug: string; videoId: string; date: string | null; title: string | null; platform: string | null; start: number; end: number; match: string; context: string; speakerCheck: boolean; via?: { slug: string; videoId: string }; }; /** One phrase's numbers (lib/phrase-finder/summary.mjs summarisePhrase). */ export type PhraseSummary = { instances: number; hits: number; dropped: number; scanned: number; years: Record; spark: string; rumble: number; notRumble: number; preferred: number; other: number; placed: number; speakerChecks: number; bySlug: Record; first: string | null; last: string | null; samples: PhraseSample[]; }; export type PhraseScanRowView = { id: string; text: string; label?: string; mode: PhraseMode; used: "words" | "regex"; source: string; summary: PhraseSummary }; export type PhraseScanView = { id: string; state: "running" | "done" | "failed" | "cancelled"; spec: PhraseScanSpec; startedAt: string | null; seconds: number | null; progress: { done: number; total: number; channel: string; channelsDone: number; channels: number } | null; error: string | null; scanned: number | null; rows: PhraseScanRowView[] | null; }; export type PhraseChannel = { slug: string; name: string; platform: string | null; videos: number }; export type PhraseSuggestion = { key: string; regex: string; instances: number | null; spark: string | null; from: string }; export type PhraseFinderState = { channels: PhraseChannel[]; suggestions: PhraseSuggestion[]; last: { channels: string[]; prefer: string | null; exclude: string | null; rows: { text: string; mode: PhraseMode; label?: string }[] } | null; running: string | null; recent: string[]; // The project kind Create montage scaffolds (lib/projects/create.mjs MONTAGE_KIND). montageKind: string; }; export type TranscriptAround = { title: string | null; date: string | null; at: number; cues: { start: number; end: number; text: string; lit: boolean }[]; };