Interface PreferenceRetrieval<T>

Generic interface to declare a typesafe get function based on the given configuration type.

Illustration

interface PreferenceConfiguration {
'myext.enabled': boolean,
}
const enabled : boolean = prefs.get('myext.enabled'); // valid
const debug : string = prefs.get('myext.enabled'); // invalid
prefs.get('foobar'); // invalid
interface PreferenceRetrieval<T> {
    get<K>(preferenceName, defaultValue?, resourceUri?): T[K];
}

Type Parameters

  • T

Methods

Methods