(fn: (host: SettingsHost) => T)
| 22 | } |
| 23 | |
| 24 | #withHost<T>(fn: (host: SettingsHost) => T): T { |
| 25 | const host = this.#host; |
| 26 | if (!host) { |
| 27 | throw new Error('Settings host not available'); |
| 28 | } |
| 29 | return fn(host); |
| 30 | } |
| 31 | |
| 32 | register(defs: SettingDefinition[]) { |
| 33 | return this.#withHost((h) => h.register(defs)); |