feat: create abstract NetworkClient with register, status, and ready methods. status calls getNetworkModuleStatus

This commit is contained in:
Derrick Hammer 2023-07-23 13:27:56 -04:00
parent 19167acec2
commit 711b1341b8
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import { Client } from "../client.js";
import { getNetworkModuleStatus } from "#api.js";
export default abstract class NetworkClient extends Client {
public async register() {
return this.callModuleReturn("register");
}
public async status(callback?: any): Promise<void | (() => Promise<void>)> {
return getNetworkModuleStatus(callback, undefined, this.connectModule);
}
public async ready() {
return this.callModuleReturn("ready");
}
}