import { nopeObservable } from "../lib/observables/nopeObservable"; import { exportsElementsToDispatcher, exportMethodToDispatcher, exportPropertyToDispatcher } from "../lib/dispatcher/nopeDispatcherDecorators"; import { IF01 } from "./testExternalDescriptor"; import { IF02 } from "./testExternalDescriptorReference"; export interface IF00 { // Test property hello: 'world' } @exportsElementsToDispatcher({ uri: 'test' }) export class CLWithInterface { @exportPropertyToDispatcher exportedAttributeSimple = new nopeObservable(false); @exportPropertyToDispatcher exportedAttributeComplex = new nopeObservable<{ element01: IF00, num: number }>({ element01: { hello:"world" }, num: 0 }); /** * * 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); } }