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;
};
export type TsCheckerWorkerData = {
    /** App root */
    appRoot: 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;
};
export declare class AbortError extends Error {
}
/** Terminates all active TypeScript workers */
export declare function terminateAllTypeScriptWorkers(): Promise<void>;
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;
};
/** Creates a TypeScript worker that handles typechecking and is watching for new entrypoints. */
export declare function createTypeScriptWorkerThread(options: TsCheckerWorkerData, callbacks?: TsWorkerCallbacks): void;
