@firfi/quint-connect
Version:
Model-based testing framework connecting Quint specifications to TypeScript implementations
44 lines • 2.23 kB
TypeScript
import { Effect } from "effect";
import { QuintError, QuintNotFoundError } from "./errors.js";
import type { PlatformProcessBoundary } from "./platform-process.js";
import type { TraceGenerationAdapter } from "./trace-adapter.js";
interface EvaluatorResult {
readonly stdout: string;
readonly exitCode: number;
readonly stderr: string;
}
interface EvaluatorProcess {
readonly pid?: number | undefined;
readonly stdin: {
readonly write: (input: string) => unknown;
readonly end: () => unknown;
};
readonly stdout: {
readonly on: (event: "data", listener: (chunk: Buffer) => void) => unknown;
};
readonly stderr: {
readonly on: (event: "data", listener: (chunk: Buffer) => void) => unknown;
};
readonly on: {
(event: "close", listener: (code: number | null) => void): unknown;
(event: "error", listener: (error: Error) => void): unknown;
};
}
type SpawnEvaluatorProcess = (evaluatorPath: string, args: ReadonlyArray<string>, options: {
readonly stdio: ["pipe", "pipe", "pipe"];
readonly detached: boolean;
}) => EvaluatorProcess;
interface CompiledEvaluatorAdapterDeps {
readonly compiledInputExists: (path: string) => boolean;
readonly cpuCount: () => number;
readonly getEvaluatorPath: () => string;
readonly randomSeedHex: () => string;
readonly readCompiledInput: (path: string) => Effect.Effect<string, QuintError>;
readonly runEvaluator: (evaluatorPath: string, inputStr: string) => Effect.Effect<EvaluatorResult, QuintNotFoundError>;
}
export declare const makeRunEvaluatorProcess: (spawnProcess?: SpawnEvaluatorProcess, processBoundary?: PlatformProcessBoundary) => (evaluatorPath: string, inputStr: string) => Effect.Effect<EvaluatorResult, QuintNotFoundError>;
export declare const makeCompiledEvaluatorTraceAdapter: (deps?: CompiledEvaluatorAdapterDeps) => TraceGenerationAdapter;
export declare const compiledEvaluatorTraceAdapter: TraceGenerationAdapter;
export { decodeCompiledEvaluatorInput, patchCompiledEvaluatorInput } from "./compiled-evaluator-input.js";
export { normalizeEvaluatorOutput } from "./compiled-evaluator-output.js";
//# sourceMappingURL=compiled-evaluator-adapter.d.ts.map