From 227dfdc161a6fc56bd68122d5c649205933d20a8 Mon Sep 17 00:00:00 2001 From: Martin Karkowski Date: Mon, 24 Aug 2020 09:39:55 +0200 Subject: [PATCH] adding functions --- test/testFile.ts | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/test/testFile.ts b/test/testFile.ts index 517be4c..68ecd31 100644 --- a/test/testFile.ts +++ b/test/testFile.ts @@ -4,28 +4,60 @@ import { IF01 } from "./testExternalDescriptor"; import { IF02 } from "./testExternalDescriptorReference"; export interface IF00 { + // Test property hello: 'world' } -exportsElementsToDispatcher('test-api') +@exportsElementsToDispatcher({ + uri: 'test' +}) export class CLWithInterface { @exportPropertyToDispatcher exportedAttributeSimple = new nopeObservable(false); @exportPropertyToDispatcher exportedAttributeComplex = new nopeObservable<{ - element01: number, + element01: IF00, num: number }>({ - element01: 0, + element01: { + hello:"world" + }, num: 0 }); - @exportMethodToDispatcher() - async exportedFunction(a: number, b: number, operator: (a: IF00,b: IF01) => Promise){ + + /** + * + * Function which will add two Nodes. + * @param a Parameter a + * @param b Parameter b + */ + @exportMethodToDispatcher({ + url: 'exportedFunction' + }) + async exportedFunction(a: number, b: number, operator: (a: IF00,b: IF01) => Promise<{ + test: IF02, + x: string + }>){ + // Comment etc. return await operator(a,b); } + + /** + * Function which will add two Nodes. + * @param a Parameter a + * @param b Parameter b + */ + @exportMethodToDispatcher({ + url: 'exportedStringFunction' + }) + async exportedStringFunction(a: string, b: string){ + // Comment etc. + return ""; + } + exportedFunctionWithError(a: number, b: number, operator: (a: number,b: number) => Promise){ return operator(a,b); }