Compare commits
2 Commits
784787de87
...
99ea588c8b
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 99ea588c8b | |
Derrick Hammer | 0611634adf |
|
@ -23,6 +23,10 @@ export interface ModuleBagBound extends ModuleBag {
|
|||
export declare abstract class Client extends EventEmitter {
|
||||
private _callModule?;
|
||||
get callModule(): callModuleBound;
|
||||
private _log?;
|
||||
get log(): log;
|
||||
private _logErr?;
|
||||
get logErr(): logErr;
|
||||
private _connectModule?;
|
||||
get connectModule(): connectModuleBound;
|
||||
loadLibs(module: string): Promise<void>;
|
||||
|
|
|
@ -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,GAAG,GAAG,cAAc,YAAY,EAAE,GAAG,CAAC;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,KAAK,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AACzE,KAAK,kBAAkB,GAAG,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,GAAG,EACT,aAAa,EAAE,MAAM,KAClB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEvD,QAAA,IAAI,UAAU,EAAE,UAAU,CAAC;AAC3B,QAAA,IAAI,aAAa,EAAE,aAAa,CAAC;AACjC,QAAA,IAAI,GAAG,EAAE,GAAG,CAAC;AACb,QAAA,IAAI,MAAM,EAAE,MAAM,CAAC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cAAc,CAAC,CAAqB;IAE5C,IAAI,aAAa,IAAI,kBAAkB,CAEtC;IAEY,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAI/D,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAM1C,SAAS,CAAC,mBAAmB,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG;cAKjC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;CAK3E;AAED,wBAAsB,IAAI,CACxB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,GAAG,cAAc,CAAC,CA+BrC;AAED,KAAK,iBAAiB,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEtD,eAAO,MAAM,OAAO,kEAEV,MAAM,eAEY,GAAG,MAiB9B,CAAC"}
|
|
@ -8,6 +8,14 @@ export class Client extends EventEmitter {
|
|||
get callModule() {
|
||||
return this._callModule;
|
||||
}
|
||||
_log;
|
||||
get log() {
|
||||
return this._log;
|
||||
}
|
||||
_logErr;
|
||||
get logErr() {
|
||||
return this._logErr;
|
||||
}
|
||||
_connectModule;
|
||||
get connectModule() {
|
||||
return this._connectModule;
|
||||
|
@ -23,6 +31,8 @@ export class Client extends EventEmitter {
|
|||
return ret;
|
||||
};
|
||||
this._connectModule = moduleBag.connectModule;
|
||||
this._log = log;
|
||||
this._logErr = logErr;
|
||||
}
|
||||
async loadBound(module) {
|
||||
return (await load(module));
|
||||
|
|
16
src/index.ts
16
src/index.ts
|
@ -37,6 +37,18 @@ export abstract class Client extends EventEmitter {
|
|||
return this._callModule as callModuleBound;
|
||||
}
|
||||
|
||||
private _log?: log;
|
||||
|
||||
get log(): log {
|
||||
return this._log as log;
|
||||
}
|
||||
|
||||
private _logErr?: logErr;
|
||||
|
||||
get logErr(): logErr {
|
||||
return this._logErr as logErr;
|
||||
}
|
||||
|
||||
private _connectModule?: connectModuleBound;
|
||||
|
||||
get connectModule(): connectModuleBound {
|
||||
|
@ -55,6 +67,8 @@ export abstract class Client extends EventEmitter {
|
|||
return ret;
|
||||
};
|
||||
this._connectModule = moduleBag.connectModule;
|
||||
this._log = log;
|
||||
this._logErr = logErr;
|
||||
}
|
||||
|
||||
public async loadBound(module: string): Promise<ModuleBagBound> {
|
||||
|
@ -66,10 +80,12 @@ export abstract class Client extends EventEmitter {
|
|||
throw new Error(ret[1]);
|
||||
}
|
||||
}
|
||||
|
||||
protected handleErrorOrReturn(ret: ErrTuple): any {
|
||||
this.handleError(ret);
|
||||
return ret[0];
|
||||
}
|
||||
|
||||
protected async callModuleReturn(method: string, data?: any): Promise<any> {
|
||||
const ret = await this.callModule(method, data);
|
||||
|
||||
|
|
Reference in New Issue