import { BuildType } from '../build-enums'; export type TsWorkerMessage = { type: 'initialized'; payload: BuildType; } | { type: 'type-error'; payload: string; } | { type: 'type-check-complete'; payload: { errorCount: number; }; } | { type: 'send-biz-event'; payload?: object; } | { type: 'entrypoints-changed'; payload: { buildType: BuildType; entrypoints: string[]; event: 'add' | 'unlink'; }; } | { type: 'cleanup-complete'; payload: BuildType; } | { type: 'run-check'; }; export type TsCheckerWorkerData = { /** App root */ appRoot: string; /** Source root used for TypeScript resolution (defaults to appRoot) */ srcRoot?: string; /** Relative path to the tsconfig.json from the app root */ tsconfigFullPath: string; buildType: BuildType; /** Array of all the entrypoints. */ entrypoints: string[]; /** The glob that is used to watch for filesystem actions add and unlink */ glob: string; /** When false, skip the internal TypeScript watch program and wait for run-check messages instead */ watchMode?: boolean; }; export declare class AbortError extends Error { } /** Terminates all active TypeScript workers */ export declare function terminateAllTypeScriptWorkers(): Promise; export type TsWorkerCallbacks = { /** Called with the formatted error string whenever a TypeScript diagnostic is emitted. */ onTypeError?: (message: string) => void; /** Called after each type-check cycle completes, with the number of errors found. */ onTypeCheckComplete?: (errorCount: number) => void; }; /** Sends a one-shot type-check request to an already-running worker in watchMode: false. */ export declare function triggerWorkerTypeCheck(buildType: BuildType): void; /** Creates a TypeScript worker that handles typechecking and is watching for new entrypoints. */ export declare function createTypeScriptWorkerThread(options: TsCheckerWorkerData, callbacks?: TsWorkerCallbacks): void;