You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I want to use seneca with Typescript.
So, I import seneca node package to use import statement.
I run tutorial code to have little change. Like this.
importSenecafrom"seneca";constseneca=Seneca();seneca.add({role: "math",cmd: "sum"},function(msg: any,respond: Function){varsum=msg.left+msg.right;respond(null,{answer: sum});});seneca.add({role: "math",cmd: "product"},function(msg: any,respond: Function){varproduct=msg.left*msg.right;respond(null,{answer: product});});seneca.act({role: "math",cmd: "sum",left: 1,right: 2},console.log).act({role: "math",cmd: "product",left: 3,right: 4},console.log);// This line has Error/** Property 'act' does not exist on type 'void'.ts(2339)*/
Could you tell me how can i use ES6 module system?
If this problem can't solve without CommonJS module system, then i use require statement.
Thanks
The text was updated successfully, but these errors were encountered:
Hello, I want to use seneca with Typescript.
So, I import seneca node package to use import statement.
I run tutorial code to have little change. Like this.
Could you tell me how can i use ES6 module system?
If this problem can't solve without CommonJS module system, then i use require statement.
Thanks
The text was updated successfully, but these errors were encountered: