Files
azuredatastudio/extensions/resource-deployment/src/typings/resource-deployment.d.ts
Charles Gagnon 97a4de4111 Have resource deployment providers return disposables (#13690)
* Add dependent field provider to resource deployment

* Change name to value provider service

* Add error handling

* providerId -> id

* Set dropdown value correctly

* missed id

* back to providerId

* fix updating missed id

* Make resource deployment providers disposable
2020-12-07 10:27:37 -08:00

44 lines
1.6 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'resource-deployment' {
import * as azdata from 'azdata';
import * as vscode from 'vscode';
export const enum ErrorType {
userCancelled,
}
export interface ErrorWithType extends Error {
readonly type: ErrorType;
}
export const enum extension {
name = 'Microsoft.resource-deployment'
}
export interface IOptionsSourceProvider {
readonly id: string,
getOptions(): Promise<string[] | azdata.CategoryValue[]> | string[] | azdata.CategoryValue[];
getVariableValue?: (variableName: string, input: string) => Promise<string> | string;
getIsPassword?: (variableName: string) => boolean | Promise<boolean>;
}
export interface IValueProvider {
readonly id: string,
getValue(triggerValue: string): Promise<string>;
}
/**
* Covers defining what the resource-deployment extension exports to other extensions
*
* IMPORTANT: THIS IS NOT A HARD DEFINITION unlike vscode; therefore no enums or classes should be defined here
* (const enums get evaluated when typescript -> javascript so those are fine)
*/
export interface IExtension {
registerOptionsSourceProvider(provider: IOptionsSourceProvider): vscode.Disposable,
registerValueProvider(provider: IValueProvider): vscode.Disposable
}
}