Add mssql.proposed.d.ts (#23394)

* Add mssql.proposed.d.ts

* Add proposed ref
This commit is contained in:
Charles Gagnon
2023-06-15 16:29:20 -07:00
committed by GitHub
parent 42a0622d93
commit 336f3af6a4
3 changed files with 39 additions and 35 deletions

View File

@@ -3,12 +3,15 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// This is the place for extensions to expose APIs.
declare module 'mssql' {
import * as azdata from 'azdata';
/**
* Covers defining what the mssql extension exports to other extensions
* Covers defining what the mssql extension exports to other extensions.
*
* This file should only contain definitions which rely on STABLE azdata typings
* (from azdata.d.ts). Anything which relies on PROPOSED typings (from azdata.proposed.d.ts)
* should go in mssql.proposed.d.ts.
*
* 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)
@@ -42,22 +45,9 @@ declare module 'mssql' {
readonly sqlProjects: ISqlProjectsService;
readonly sqlAssessment: ISqlAssessmentService;
readonly azureBlob: IAzureBlobService;
}
/**
* A browser supporting actions over the object explorer connections provided by this extension.
* Currently this is the
*/
export interface MssqlObjectExplorerBrowser {
/**
* Gets the matching node given a context object, e.g. one from a right-click on a node in Object Explorer
*/
getNode<T extends ITreeNode>(objectExplorerContext: azdata.ObjectExplorerContext): Thenable<T>;
}
/**
* A tree node in the object explorer tree
*/
@@ -66,14 +56,6 @@ declare module 'mssql' {
getChildren(refreshChildren: boolean): ITreeNode[] | Thenable<ITreeNode[]>;
}
/**
* A HDFS file node. This is a leaf node in the object explorer tree, and its contents
* can be queried
*/
export interface IFileNode extends ITreeNode {
getFileContentsAsString(maxBytes?: number): Thenable<string>;
}
//#region --- schema compare
export interface SchemaCompareResult extends azdata.ResultStatus {
operationId: string;
@@ -865,18 +847,6 @@ declare module 'mssql' {
}
//#endregion
/**
* Sql Assessment
*/
// SqlAssessment interfaces -----------------------------------------------------------------------
export interface ISqlAssessmentService {
assessmentInvoke(ownerUri: string, targetType: azdata.sqlAssessment.SqlAssessmentTargetType): Promise<azdata.SqlAssessmentResult>;
getAssessmentItems(ownerUri: string, targetType: azdata.sqlAssessment.SqlAssessmentTargetType): Promise<azdata.SqlAssessmentResult>;
generateAssessmentScript(items: azdata.SqlAssessmentResultItem[], targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Promise<azdata.ResultStatus>;
}
export interface CreateSasResponse {
sharedAccessSignature: string;
}

View File

@@ -0,0 +1,33 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'mssql' {
import * as azdata from 'azdata';
/**
* Covers defining what the mssql extension exports to other extensions.
*
* This file should only contain definitions which rely on PROPOSED azdata typings
* (from azdata.proposed.d.ts). Anything which relies on STABLE typings (from azdata.d.ts)
* should go in mssql.d.ts.
*
* This is to make it easier for extensions that don't need these features to only import the ones
* that depend on stable features so they don't have to copy over the proposed typings themselves.
*
* 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 {
readonly sqlAssessment: ISqlAssessmentService;
}
export interface ISqlAssessmentService {
assessmentInvoke(ownerUri: string, targetType: azdata.sqlAssessment.SqlAssessmentTargetType): Promise<azdata.SqlAssessmentResult>;
getAssessmentItems(ownerUri: string, targetType: azdata.sqlAssessment.SqlAssessmentTargetType): Promise<azdata.SqlAssessmentResult>;
generateAssessmentScript(items: azdata.SqlAssessmentResultItem[], targetServerName: string, targetDatabaseName: string, taskExecutionMode: azdata.TaskExecutionMode): Promise<azdata.ResultStatus>;
}
}