(key: T)
| 168 | } |
| 169 | |
| 170 | public get<T extends SystemConfigKey>(key: T): Promise<SystemConfigValueType<T>> { |
| 171 | const funcName = `get${toCamelCase(key)}`; |
| 172 | // @ts-ignore |
| 173 | if (typeof this[funcName] === "function") { |
| 174 | // @ts-ignore |
| 175 | return this[funcName]() as Promise<any>; |
| 176 | } else { |
| 177 | throw new Error(`Method ${funcName} does not exist on SystemConfig`); |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | public set<T extends SystemConfigKey>(key: T, value: SystemConfigValueType<T>): void { |
| 182 | const funcName = `set${toCamelCase(key)}`; |