Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

RPCConfigLoader.ts 733B

1234567891011121314151617181920212223242526272829
  1. import { ConfigLoader } from 'loadson'
  2. import { RPCExporter } from 'rpclibrary'
  3. export type ConfigLoaderIfc<ConfT> = {
  4. Config : {
  5. getConfig: () => ConfT
  6. resetConfig: () => ConfT
  7. setConfig: (conf:ConfT) => ConfT
  8. setConfigKey: (key:string, value:any) => ConfT
  9. deleteConfigKey: (key:string) => ConfT
  10. getConfigKey: (key:string) => any
  11. }
  12. }
  13. export class RPCConfigLoader<ConfT>
  14. extends ConfigLoader<ConfT>
  15. implements RPCExporter<ConfigLoaderIfc<ConfT>, "Config">{
  16. name = "Config" as "Config"
  17. RPCs = () => [
  18. this.getConfig,
  19. this.resetConfig,
  20. this.setConfig,
  21. this.setConfigKey,
  22. this.deleteConfigKey,
  23. this.getConfigKey
  24. ]
  25. }