aqua/api/api-npm/aqua-api.d.ts

70 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-08-09 14:32:27 +00:00
import type { FunctionCallDef, ServiceDef } from "@fluencelabs/interfaces";
2022-12-28 08:30:42 +00:00
export class AquaConfig {
2023-08-09 14:32:27 +00:00
constructor(
logLevel?: string,
constants?: string[],
noXor?: boolean,
noRelay?: boolean,
targetType?: string,
tracing?: boolean,
);
2023-08-09 14:32:27 +00:00
logLevel?: string;
constants?: string[];
noXor?: boolean;
noRelay?: boolean;
targetType?: string;
tracing?: boolean;
2022-12-28 08:30:42 +00:00
}
export class AquaFunction {
2023-08-09 14:32:27 +00:00
funcDef: FunctionCallDef;
script: string;
2022-12-28 08:30:42 +00:00
}
export class GeneratedSource {
2023-08-09 14:32:27 +00:00
name: string;
tsSource?: string;
jsSource?: string;
tsTypes?: string;
}
2022-12-28 08:30:42 +00:00
export class CompilationResult {
2023-08-09 14:32:27 +00:00
services: Record<string, ServiceDef>;
functions: Record<string, AquaFunction>;
functionCall?: AquaFunction;
errors: string[];
generatedSources: GeneratedSource[];
}
export class Input {
2023-08-09 14:32:27 +00:00
constructor(input: string);
2023-08-09 14:32:27 +00:00
input: string;
}
export class Path {
2023-08-09 14:32:27 +00:00
constructor(path: string);
2023-08-09 14:32:27 +00:00
path: string;
}
export class Call {
2023-08-09 14:32:27 +00:00
constructor(functionCall: string, arguments: any, input: Input | Path);
2023-08-09 14:32:27 +00:00
functionCall: string;
arguments: any;
input: Input | Path;
2022-12-28 08:30:42 +00:00
}
export class Compiler {
2023-08-09 14:32:27 +00:00
compile(
input: Input | Path | Call,
imports: string[],
config?: AquaConfig,
): Promise<CompilationResult>;
2022-12-28 08:30:42 +00:00
}
export var Aqua: Compiler;