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<K>(preferenceName: K | { overrideIdentifier?: string; preferenceName: K }, defaultValue?: T[K], resourceUri?: string): T[K]