// The verdict vocabulary, typed. The values live in ./verdicts.mjs — plain JS so // umtool's report-to-video scripts can import the same copy — and this module // is how every TS caller reads them: with the verdict as a union, not a string. import { VERDICT_COLOR_RE as VERDICT_COLOR_RE_JS, VERDICT_DEFAULTS as VERDICT_DEFAULTS_JS, VERDICT_LABEL_MAX as VERDICT_LABEL_MAX_JS, VERDICTS as VERDICTS_JS, resolveVerdicts as resolveVerdictsJs, verdictOverrideProblems as verdictOverrideProblemsJs, } from "./verdicts.mjs"; export type Verdict = "CORROBORATED" | "PARTLY" | "CONTRADICTED" | "NOT_FOUND" | "UNTESTABLE"; export type VerdictStyle = { label: string; color: string }; export type VerdictOverride = { label?: string; color?: string }; export const VERDICTS = VERDICTS_JS as readonly Verdict[]; export const VERDICT_DEFAULTS = VERDICT_DEFAULTS_JS as Readonly>>; export const VERDICT_LABEL_MAX: number = VERDICT_LABEL_MAX_JS; export const VERDICT_COLOR_RE: RegExp = VERDICT_COLOR_RE_JS; export function isVerdict(v: unknown): v is Verdict { return typeof v === "string" && (VERDICTS as readonly string[]).includes(v); } // Defaults with the overrides laid over them, one key at a time. export function resolveVerdicts(overrides: unknown): Record { return resolveVerdictsJs(overrides) as Record; } // Every reason an override cannot be used, as sentences naming `where`. export function verdictOverrideProblems(v: unknown, where: string): string[] { return verdictOverrideProblemsJs(v, where); }