From 33a2ca87e00eab7075772cce4a8c012c6a137167 Mon Sep 17 00:00:00 2001 From: InversionSpaces Date: Mon, 18 Dec 2023 12:48:03 +0100 Subject: [PATCH] feat(api): Refactor js api interfaces (#1024) Change types --- api/api-npm/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/api/api-npm/index.d.ts b/api/api-npm/index.d.ts index 0805efa7..2aa63e9a 100644 --- a/api/api-npm/index.d.ts +++ b/api/api-npm/index.d.ts @@ -15,11 +15,11 @@ export declare class GeneratedSource { export declare class CompilationResult { services: Record; functions: Record; - functionCall?: AquaFunction; errors: string[]; warnings: string[]; generatedSources: GeneratedSource[]; } + /** * Imports configuration for the compiler. * Structure: @@ -83,12 +83,11 @@ type CodeString = { }; export type CompileFromStringArgs = CommonArgs & CodeString; -export type CompileFromStringReturnType = Omit; /** Compile aqua code from a string */ export declare function compileFromString( args: CompileFromStringArgs, -): Promise; +): Promise; type FilePath = { /** Path to the aqua file to be compiled */ @@ -96,12 +95,11 @@ type FilePath = { }; export type CompileFromPathArgs = CommonArgs & FilePath; -export type CompileFromPathReturnType = Omit; /** Compile aqua code from a file */ export declare function compileFromPath( args: CompileFromPathArgs, -): Promise; +): Promise; type FuncCall = { /** Function call you want to compile. Example: someFunc("someArg") */ @@ -110,20 +108,22 @@ type FuncCall = { data?: Record | undefined; }; +export type CallCompilationResult = CompilationResult & { + functionCall: AquaFunction; +}; + export type CompileFuncCallFromStringArgs = CommonArgs & CodeString & FuncCall; -export type CompileFuncCallFromStringReturnType = Required; /** Compile aqua function call from a string */ export declare function compileAquaCallFromString( args: CompileFuncCallFromStringArgs, -): Promise; +): Promise; export type CompileFuncCallFromPathArgs = CommonArgs & FilePath & FuncCall; -export type CompileFuncCallFromPathReturnType = Required; /** Compile aqua function call from a file */ export declare function compileAquaCallFromPath( args: CompileFuncCallFromPathArgs, -): Promise; +): Promise; export {};