import { exportMethod } from "../../lib/decorators/moduleDecorators"; import { InjectableNopeBaseModule } from "../../lib/module/BaseModule.injectable"; import { NopeObservable } from "../../lib/observables/nopeObservable"; import { IF01 } from "./IF01"; export interface IF00 { // Test property hello: "world"; } export class ComplexModuleWithDecorators extends InjectableNopeBaseModule { // @exportProperty({ // mode: ['publish'], // topic: 'propWithInternalDefinition' // }) public propWithInternalDefinition = new NopeObservable(); /** * Function description * * @param {IF00} a Description of Parameter a * @param {IF01} [b] Description of Optional Parameter b * @return {*} {Promise} * @memberof ComplexModuleWithDecorators */ // @exportMethod({}) async exportedMethod(a: IF00, b?: IF01): Promise { b.name = a.hello; return b; } @exportMethod({}) async exportedMethodWithCallback( a: number, b: number, operator: (a: number, b: number) => Promise ): Promise { return await operator(a, b); } @exportMethod({}) async exportedMethodWithCallbackCallback( a: number, b: number, operator: ( a: number, b: number, c: (a: string) => Promise ) => Promise ): Promise { return await operator(a, b); } async init() { this.author = { forename: "Martin", mail: "m.karkowski@zema.de", surename: "karkowski" }; this.description = "A Complex Module for Testing."; this.type = "helloworld"; this.version = { date: new Date("05.11.2020"), version: 1 }; await super.init(); } }