import { ConfigurationTarget , workspace } from "vscode" ; export interface IConfiguration { get < T > ( key ) : T | undefined ; inspect < T > ( key ) : { globalValue ? : T ; } | undefined ; update ( section , value , configurationTarget ? ) : Promise < void > ; } export class VsCodeConfiguration implements IConfiguration { public constructor ( public readonly section ) { } public get < T > ( key ) { return workspace . getConfiguration ( this . section ) . get ( key ) ; } public inspect < T > ( key ) { return workspace . getConfiguration ( this . section ) . inspect < T > ( key ) ; } public async update ( section , value , configurationTarget ? ) { await workspace . getConfiguration ( this . section ) . update ( section , value , configurationTarget ) ; } }