Typesafe schema-based preferences utility based on the PreferenceService. Can be used to get preferences as well as listen to preference changes.
See createPreferenceProxy on how to instantiate preference proxies.
preferences.onPreferenceChanged(({ preferenceName, newValue }) => { ... });
const enabled = preferences['myext.enabled'];
We cannot load providers directly in the case if they depend on PreferenceService
somehow.
It allows to load them lazily after DI is configured.
Creates a preference proxy for typesafe preference handling.
the underlying preference service to use for preference handling.
the JSON Schema which describes which preferences are available including types and descriptions. Can be a promise.
configuration options.
the created preference proxy.
createPreferenceProxy
to make your preferences available wherever needed.See CorePreferences for an example.
Note that if schema
is a Promise, most actions will be no-ops until the promise is resolved.
Union of all possible key/value pairs for a type
T