import type { TypecheckProgress, TypecheckResult } from "./typecheckProject.js"; import { type TypeErrorEntry } from "./typecheckProject.js"; /** At most this many of the new errors are sent; the count says how many. */ export declare const MAX_REPORTED_ERRORS = 200; /** What the typecheck is doing, as it says so. */ export type ProposalTypecheckStep = { step: "reading"; } | { step: "lockfile"; } | { step: "checking"; which: "site" | "proposal"; detail: string; }; /** A new type error as content keeps it: a file always, a position always. */ export type ProposalTypeError = { file: string; line: number; column: number; code: number; message: string; }; /** * The calls a proposal's typecheck makes: the Studio's through its origin, * home's upgrade page to content directly. `T` is the report as content * answers it. */ export type ProposalTypecheckClient = { files(name: string): Promise<{ files: Record; staged: { inputs: string | null; }; }>; reportTypecheck(name: string, report: { inputs: string; newErrors: ProposalTypeError[]; count?: number; }): Promise; }; export type ProposalTypecheckDeps = { name: string; client: ProposalTypecheckClient; /** The site's code, as its live build has it; `null` when nothing is live. */ siteSource: () => Promise | null>; /** The site's recorded `pnpm-lock.yaml` and `pnpm-workspace.yaml`. */ siteDependencyFiles: () => Promise>; /** A lockfile for `packageJson`, for a site that has none on record. */ computeLockfile: (packageJson: string, signal: AbortSignal) => Promise; check: (input: { files: Record; lockfile: string; workspace: string | null; }, options: { onProgress: (progress: TypecheckProgress) => void; signal: AbortSignal; }) => Promise; onStep?: (step: ProposalTypecheckStep) => void; signal: AbortSignal; }; export type ProposalTypecheckOutcome = /** Nothing staged: there is nothing of the proposal's to check. */ { status: "nothing-staged"; } | { status: "checked"; inputs: string; /** Every new error, not only the ones sent. */ errors: ProposalTypeError[]; typecheck: T; }; /** A type error as content keeps it: a file always, a position always. */ export declare function reportedError(error: TypeErrorEntry): ProposalTypeError; export declare function runProposalTypecheck(deps: ProposalTypecheckDeps): Promise>; /** New errors by file, each file's in order: how the dialog lists them. */ export declare function errorsByFile(errors: ProposalTypeError[]): [string, ProposalTypeError[]][];