Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Type parameters

  • T

Hierarchy

  • PreferenceRetrieval

Index

Methods

Methods

get

  • get<K>(preferenceName: K | { overrideIdentifier?: undefined | string; preferenceName: K }, defaultValue?: T[K], resourceUri?: undefined | string): T[K]