| 1234567891011121314151617181920212223242526272829 |
- import { ConfigLoader } from 'loadson'
- import { RPCExporter } from 'rpclibrary'
-
- export type ConfigLoaderIfc<ConfT> = {
- Config : {
- getConfig: () => ConfT
- resetConfig: () => ConfT
- setConfig: (conf:ConfT) => ConfT
- setConfigKey: (key:string, value:any) => ConfT
- deleteConfigKey: (key:string) => ConfT
- getConfigKey: (key:string) => any
- }
- }
-
- export class RPCConfigLoader<ConfT>
- extends ConfigLoader<ConfT>
- implements RPCExporter<ConfigLoaderIfc<ConfT>, "Config">{
-
- name = "Config" as "Config"
-
- RPCs = () => [
- this.getConfig,
- this.resetConfig,
- this.setConfig,
- this.setConfigKey,
- this.deleteConfigKey,
- this.getConfigKey
- ]
- }
|