///
import * as Package from "../pkg";
import * as IR from "../ir";
import * as VM from "../vm";
import { ForeignInterface } from "./foreign";
import { CrochetValue } from "../vm";
export declare type TestReportMessage = TRM_Started | TRM_Test_Started | TRM_Test_Passed | TRM_Test_Failed | TRM_Test_Skipped | TRM_Finished;
export declare abstract class TestReportMessageBase {
}
export declare class TRM_Started extends TestReportMessageBase {
readonly id: string;
readonly tag = "started";
constructor(id: string);
}
export declare class TRM_Test_Started extends TestReportMessageBase {
readonly id: string;
readonly test_id: string;
readonly pkg: string;
readonly module: string;
readonly name: string;
readonly tag = "test-started";
constructor(id: string, test_id: string, pkg: string, module: string, name: string);
}
export declare class TRM_Test_Passed extends TestReportMessageBase {
readonly id: string;
readonly test_id: string;
readonly tag = "test-passed";
constructor(id: string, test_id: string);
}
export declare class TRM_Test_Failed extends TestReportMessageBase {
readonly id: string;
readonly test_id: string;
readonly message: string;
readonly tag = "test-failed";
constructor(id: string, test_id: string, message: string);
}
export declare class TRM_Test_Skipped extends TestReportMessageBase {
readonly id: string;
readonly test_id: string;
readonly tag = "test-skipped";
constructor(id: string, test_id: string);
}
export declare class TRM_Finished extends TestReportMessageBase {
readonly id: string;
readonly tag = "finished";
constructor(id: string);
}
export interface IFileSystem {
read_package(name: string): Promise;
read_file(x: string): Promise;
read_binary(file: Package.ResolvedFile, pkg: Package.ResolvedPackage): Promise;
read_native_module(file: Package.ResolvedFile, pkg: Package.ResolvedPackage): Promise<(_: ForeignInterface) => Promise>;
}
export interface ISignal {
request_capabilities(graph: Package.PackageGraph, root: Package.Package): Promise>;
booted(vm: BootedCrochet): Promise;
report_test(message: TestReportMessage): Promise;
}
export declare class Crochet {
readonly safe_mode: boolean;
readonly fs: IFileSystem;
readonly signal: ISignal;
readonly trusted: Set;
readonly registered_packages: Map;
constructor(safe_mode: boolean, fs: IFileSystem, signal: ISignal);
boot(root: string, target: Package.Target): Promise;
trust(pkg: Package.Package): void;
register_package_from_file(filename: string): Promise;
register_package(pkg: Package.Package): Promise;
private resolver;
private get_package;
}
export declare class BootedCrochet {
readonly crochet: Crochet;
readonly graph: Package.PackageGraph;
private initialised;
readonly universe: VM.Universe;
constructor(crochet: Crochet, graph: Package.PackageGraph);
initialise(root: string): Promise;
run(name: string, args: VM.CrochetValue[]): Promise>;
private assert_initialised;
private load_package;
private reify_capability_grants;
private load_native;
private load_source;
run_tests(run_id: string, filter: (_: VM.CrochetTest) => boolean, verbose?: boolean): Promise;
load_declaration(x: IR.Declaration, module: VM.CrochetModule): Promise;
run_block(x: IR.BasicBlock, env: VM.Environment): Promise>;
invoke(name: string, args: CrochetValue[]): Promise>;
}