import { ExtensionContext } from "vscode" ; import { IAzExtOutputChannel , IAzureUserInput , registerUIExtensionVariables , UIExtensionVariables } from 'vscode-azureextensionui' ; import { localize } from "./localize" ; class UninitializedExtensionVariables implements UIExtensionVariables { private _error : Error = new Error ( localize ( 'uninitializedError' , '"registerUIExtensionVariables" must be called before using the vscode-azureappservice package.' ) ) ; public get context ( ) : ExtensionContext { throw this . _error ; } public get outputChannel ( ) : IAzExtOutputChannel { throw this . _error ; } public get ui ( ) : IAzureUserInput { throw this . _error ; } public get prefix ( ) : string { throw this . _error ; } } interface IAppServiceExtensionVariables extends UIExtensionVariables { prefix : string ; } /**
 * Container for common extension variables used throughout the AppService package. They must be initialized with registerAppServiceExtensionVariables
 */ export let ext = new UninitializedExtensionVariables ( ) ; /**
 * Call this to register common variables used throughout the AppService package.
 */ export function registerAppServiceExtensionVariables ( extVars ) { if ( ext === extVars ) { return ; } ext = extVars ; registerUIExtensionVariables ( extVars ) ; }