Compare commits
2 Commits
952630c546
...
0bc5807c6a
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 0bc5807c6a | |
Derrick Hammer | 376a2d330c |
|
@ -3,6 +3,7 @@ type connectModule = typeof import("libkmodule").connectModule;
|
||||||
type logErr = typeof import("libkmodule").logErr;
|
type logErr = typeof import("libkmodule").logErr;
|
||||||
type log = typeof import("libkmodule").log;
|
type log = typeof import("libkmodule").log;
|
||||||
import type { ErrTuple, DataFn } from "@siaweb/libweb";
|
import type { ErrTuple, DataFn } from "@siaweb/libweb";
|
||||||
|
import { EventEmitter2 as EventEmitter } from "eventemitter2";
|
||||||
type callModuleBound = (method: string, data?: any) => Promise<ErrTuple>;
|
type callModuleBound = (method: string, data?: any) => Promise<ErrTuple>;
|
||||||
type connectModuleBound = (method: string, data: any, receiveUpdate: DataFn) => [sendUpdate: DataFn, response: Promise<ErrTuple>];
|
type connectModuleBound = (method: string, data: any, receiveUpdate: DataFn) => [sendUpdate: DataFn, response: Promise<ErrTuple>];
|
||||||
declare let callModule: callModule;
|
declare let callModule: callModule;
|
||||||
|
@ -19,7 +20,7 @@ export interface ModuleBagBound extends ModuleBag {
|
||||||
callModule: callModuleBound;
|
callModule: callModuleBound;
|
||||||
connectModule: connectModuleBound;
|
connectModule: connectModuleBound;
|
||||||
}
|
}
|
||||||
export declare abstract class Client {
|
export declare abstract class Client extends EventEmitter {
|
||||||
private _callModule?;
|
private _callModule?;
|
||||||
get callModule(): callModuleBound;
|
get callModule(): callModuleBound;
|
||||||
private _connectModule?;
|
private _connectModule?;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,cAAc,YAAY,EAAE,UAAU,CAAC;AACzD,KAAK,aAAa,GAAG,cAAc,YAAY,EAAE,aAAa,CAAC;AAC/D,KAAK,MAAM,GAAG,cAAc,YAAY,EAAE,MAAM,CAAC;AACjD,KAAK,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
|
let connectModule;
|
||||||
let log;
|
let log;
|
||||||
let logErr;
|
let logErr;
|
||||||
export class Client {
|
export class Client extends EventEmitter {
|
||||||
_callModule;
|
_callModule;
|
||||||
get callModule() {
|
get callModule() {
|
||||||
return this._callModule;
|
return this._callModule;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@siaweb/libweb": "git+https://git.lumeweb.com/LumeWeb/libsiaweb.git",
|
"@siaweb/libweb": "git+https://git.lumeweb.com/LumeWeb/libsiaweb.git",
|
||||||
|
"eventemitter2": "^6.4.9",
|
||||||
"libkernel": "^0.1.48",
|
"libkernel": "^0.1.48",
|
||||||
"libkmodule": "^0.2.53"
|
"libkmodule": "^0.2.53"
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,6 +2,7 @@ lockfileVersion: 5.4
|
||||||
|
|
||||||
specifiers:
|
specifiers:
|
||||||
'@siaweb/libweb': git+https://git.lumeweb.com/LumeWeb/libsiaweb.git
|
'@siaweb/libweb': git+https://git.lumeweb.com/LumeWeb/libsiaweb.git
|
||||||
|
eventemitter2: ^6.4.9
|
||||||
libkernel: ^0.1.48
|
libkernel: ^0.1.48
|
||||||
libkmodule: ^0.2.53
|
libkmodule: ^0.2.53
|
||||||
prettier: ^2.8.3
|
prettier: ^2.8.3
|
||||||
|
@ -9,6 +10,7 @@ specifiers:
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@siaweb/libweb': git.lumeweb.com/LumeWeb/libsiaweb/5e6cdba3e7d9a4b94e21ddcd5f2b5138fb440ee8
|
'@siaweb/libweb': git.lumeweb.com/LumeWeb/libsiaweb/5e6cdba3e7d9a4b94e21ddcd5f2b5138fb440ee8
|
||||||
|
eventemitter2: 6.4.9
|
||||||
libkernel: 0.1.48
|
libkernel: 0.1.48
|
||||||
libkmodule: 0.2.53
|
libkmodule: 0.2.53
|
||||||
|
|
||||||
|
@ -22,6 +24,10 @@ packages:
|
||||||
resolution: {integrity: sha512-wFqPLVuGyfuEU1PsE7AMC+ANcoJiz7iruJPUrNZC0riDv1qMrZw+tx44HlBXLJ1H50JZiGtRPr9zLgkPFhf9OA==}
|
resolution: {integrity: sha512-wFqPLVuGyfuEU1PsE7AMC+ANcoJiz7iruJPUrNZC0riDv1qMrZw+tx44HlBXLJ1H50JZiGtRPr9zLgkPFhf9OA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/eventemitter2/6.4.9:
|
||||||
|
resolution: {integrity: sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/libkernel/0.1.48:
|
/libkernel/0.1.48:
|
||||||
resolution: {integrity: sha512-h86j/D+5gnpw/h8DTQE1C9hWFRmQnw5ZU9L3fYTZIPqPEIIU40z+tnDp66Zbb6mcfYCr8+SGkhcCy3XsyHOvyQ==}
|
resolution: {integrity: sha512-h86j/D+5gnpw/h8DTQE1C9hWFRmQnw5ZU9L3fYTZIPqPEIIU40z+tnDp66Zbb6mcfYCr8+SGkhcCy3XsyHOvyQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
|
@ -4,6 +4,7 @@ type logErr = typeof import("libkmodule").logErr;
|
||||||
type log = typeof import("libkmodule").log;
|
type log = typeof import("libkmodule").log;
|
||||||
|
|
||||||
import type { ErrTuple, DataFn } from "@siaweb/libweb";
|
import type { ErrTuple, DataFn } from "@siaweb/libweb";
|
||||||
|
import { EventEmitter2 as EventEmitter } from "eventemitter2";
|
||||||
|
|
||||||
type callModuleBound = (method: string, data?: any) => Promise<ErrTuple>;
|
type callModuleBound = (method: string, data?: any) => Promise<ErrTuple>;
|
||||||
type connectModuleBound = (
|
type connectModuleBound = (
|
||||||
|
@ -29,7 +30,7 @@ export interface ModuleBagBound extends ModuleBag {
|
||||||
connectModule: connectModuleBound;
|
connectModule: connectModuleBound;
|
||||||
}
|
}
|
||||||
|
|
||||||
export abstract class Client {
|
export abstract class Client extends EventEmitter {
|
||||||
private _callModule?: callModuleBound;
|
private _callModule?: callModuleBound;
|
||||||
|
|
||||||
get callModule(): callModuleBound {
|
get callModule(): callModuleBound {
|
||||||
|
|
Reference in New Issue