forked from ubiquity/ubiquibot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot-runtime.ts
More file actions
38 lines (30 loc) · 858 Bytes
/
Copy pathbot-runtime.ts
File metadata and controls
38 lines (30 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { createAdapters } from "../adapters/adapters";
import { Logs } from "ubiquibot-logger";
class Runtime {
private static _instance: Runtime;
private _adapters: ReturnType<typeof createAdapters>;
private _logger: Logs;
private constructor() {
this._adapters = {} as ReturnType<typeof createAdapters>;
this._logger = {} as Logs;
}
public static getState(): Runtime {
if (!Runtime._instance) {
Runtime._instance = new Runtime();
}
return Runtime._instance;
}
public get adapters(): ReturnType<typeof createAdapters> {
return this._adapters;
}
public set adapters(adapters: ReturnType<typeof createAdapters>) {
this._adapters = adapters;
}
public get logger(): Logs {
return this._logger;
}
public set logger(logger: Logs) {
this._logger = logger;
}
}
export default Runtime;