mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 14:40:17 +00:00
feat: export types from aqua-api (#904)
* feat: export types from aqua-api * improve
This commit is contained in:
parent
54ddcc8b62
commit
594f46529d
32
api/api-npm/index.d.ts
vendored
32
api/api-npm/index.d.ts
vendored
@ -1,11 +1,11 @@
|
|||||||
import { ServiceDef, FunctionCallDef } from "@fluencelabs/interfaces";
|
import { ServiceDef, FunctionCallDef } from "@fluencelabs/interfaces";
|
||||||
|
|
||||||
class AquaFunction {
|
export class AquaFunction {
|
||||||
funcDef: FunctionCallDef;
|
funcDef: FunctionCallDef;
|
||||||
script: string;
|
script: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class GeneratedSource {
|
export class GeneratedSource {
|
||||||
name: string;
|
name: string;
|
||||||
tsSource?: string;
|
tsSource?: string;
|
||||||
jsSource?: string;
|
jsSource?: string;
|
||||||
@ -43,20 +43,26 @@ type CodeString = {
|
|||||||
code: string;
|
code: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CompileFromStringArgs = CommonArgs & CodeString;
|
||||||
|
export type CompileFromStringReturnType = Omit<CompilationResult, "funcCall">;
|
||||||
|
|
||||||
/** Compile aqua code from a string */
|
/** Compile aqua code from a string */
|
||||||
export declare function compileFromString(
|
export declare function compileFromString(
|
||||||
args: CommonArgs & CodeString,
|
args: CompileFromStringArgs,
|
||||||
): Promise<Omit<CompilationResult, "funcCall">>;
|
): Promise<CompileFromStringReturnType>;
|
||||||
|
|
||||||
type FilePath = {
|
type FilePath = {
|
||||||
/** Path to the aqua file to be compiled */
|
/** Path to the aqua file to be compiled */
|
||||||
filePath: string;
|
filePath: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CompileFromPathArgs = CommonArgs & FilePath;
|
||||||
|
export type CompileFromPathReturnType = Omit<CompilationResult, "funcCall">;
|
||||||
|
|
||||||
/** Compile aqua code from a file */
|
/** Compile aqua code from a file */
|
||||||
export declare function compileFromPath(
|
export declare function compileFromPath(
|
||||||
args: CommonArgs & FilePath,
|
args: CompileFromPathArgs,
|
||||||
): Promise<Omit<CompilationResult, "funcCall">>;
|
): Promise<CompileFromPathReturnType>;
|
||||||
|
|
||||||
type FuncCall = {
|
type FuncCall = {
|
||||||
/** Function call you want to compile. Example: someFunc("someArg") */
|
/** Function call you want to compile. Example: someFunc("someArg") */
|
||||||
@ -65,14 +71,20 @@ type FuncCall = {
|
|||||||
data?: Record<string, unknown> | undefined;
|
data?: Record<string, unknown> | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CompileFuncCallFromStringArgs = CommonArgs & CodeString & FuncCall;
|
||||||
|
export type CompileFuncCallFromStringReturnType = Required<CompilationResult>;
|
||||||
|
|
||||||
/** Compile aqua function call from a string */
|
/** Compile aqua function call from a string */
|
||||||
export declare function compileAquaCallFromString(
|
export declare function compileAquaCallFromString(
|
||||||
args: CommonArgs & CodeString & FuncCall,
|
args: CompileFuncCallFromStringArgs,
|
||||||
): Promise<Required<CompilationResult>>;
|
): Promise<CompileFuncCallFromStringReturnType>;
|
||||||
|
|
||||||
|
export type CompileFuncCallFromPathArgs = CommonArgs & FilePath & FuncCall;
|
||||||
|
export type CompileFuncCallFromPathReturnType = Required<CompilationResult>;
|
||||||
|
|
||||||
/** Compile aqua function call from a file */
|
/** Compile aqua function call from a file */
|
||||||
export declare function compileAquaCallFromPath(
|
export declare function compileAquaCallFromPath(
|
||||||
args: CommonArgs & FilePath & FuncCall,
|
args: CompileFuncCallFromPathArgs,
|
||||||
): Promise<Required<CompilationResult>>;
|
): Promise<CompileFuncCallFromPathReturnType>;
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
Loading…
Reference in New Issue
Block a user