mirror of
https://github.com/esiur/esiur-js.git
synced 2025-06-27 07:13:12 +00:00
2.0.0
This commit is contained in:
43
demo/dotnet/service.js
Normal file
43
demo/dotnet/service.js
Normal file
@ -0,0 +1,43 @@
|
||||
import Warehouse from "../../src/Resource/Warehouse.js";
|
||||
|
||||
import { createRequire } from 'module'
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const WebSocket = require('ws');
|
||||
|
||||
var remote = await Warehouse.get('iip://localhost/mem/service');
|
||||
|
||||
// remote?.instance?.template.properties.forEach((element) => {
|
||||
// console.log(element.name);
|
||||
// console.log(remote[element.name]);
|
||||
// });
|
||||
|
||||
await remote?.Void();
|
||||
await remote?.Connection('ss', 33);
|
||||
await remote?.ConnectionOptional('Test 2', 88);
|
||||
var rt = await remote?.Optional('Optional', 311);
|
||||
console.log(rt);
|
||||
|
||||
var t2 = await remote?.GetTuple2(1, 'A');
|
||||
console.log(t2);
|
||||
var t3 = await remote?.GetTuple3(1, 'A', 1.3);
|
||||
console.log(t3);
|
||||
var t4 = await remote?.GetTuple4(1, 'A', 1.3, true);
|
||||
console.log(t4);
|
||||
|
||||
remote?.on('StringEvent', (args) => console.log(`StringEvent ${args}`));
|
||||
|
||||
remote?.on('ArrayEvent', (args) => console.log(`ArrayEvent ${args}`));
|
||||
|
||||
await remote?.InvokeEvents('Hello');
|
||||
|
||||
// var mcr = MyChildRecord()
|
||||
// ..ChildName = "I'm Child"
|
||||
// ..Name = 'Dad'
|
||||
// ..Score = 332
|
||||
// ..Id = 44;
|
||||
|
||||
// var rec = await remote?.SendRecord(mcr);
|
||||
|
||||
// print(rec);
|
Reference in New Issue
Block a user