Delete azurecore value provider and simplify type (#17543)

This commit is contained in:
Charles Gagnon
2021-11-01 10:13:58 -07:00
committed by GitHub
parent 08d3803453
commit a9d96e166a
4 changed files with 11 additions and 42 deletions

View File

@@ -27,12 +27,16 @@ declare module 'resource-deployment' {
export type InputValueType = string | number | boolean | undefined;
export interface IValueProvider {
/**
* The ID associated with this value provider. Fields use this ID in the package.json to indicate which provider to use to get the value for that field.
* Each ID must be globally unique - an error will be thrown if the same ID is already registered.
*/
readonly id: string,
/**
* Gets a calculated value based on the given input values.
* @param triggerValues A map of the trigger field names and their current values specified in the valueProvider field info
*/
getValue(triggerValues: string | {[key: string]: InputValueType}): Promise<InputValueType>;
getValue(triggerValues: {[key: string]: InputValueType}): Promise<InputValueType>;
}
/**
@@ -44,6 +48,12 @@ declare module 'resource-deployment' {
export interface IExtension {
registerOptionsSourceProvider(provider: IOptionsSourceProvider): vscode.Disposable,
/**
* Registers a value provider that resource deployment definitions can use to dynamically fetch the value for specified fields.
* @param provider The provider to register
* @returns A disposable is returned that will unregister the provider when is disposed - this should be used to ensure
* that the provider is unregistered when the extension is uninstalled/deactivated.
*/
registerValueProvider(provider: IValueProvider): vscode.Disposable
}
}