From 2ccd7405c0541ba5a5961475870ecf4348f32c19 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Wed, 29 Mar 2023 09:06:44 -0700 Subject: [PATCH] Promote some proposed typings (#22508) --- src/sql/azdata.d.ts | 100 +++++++++++++++++++++++++++++-- src/sql/azdata.proposed.d.ts | 111 ----------------------------------- 2 files changed, 96 insertions(+), 115 deletions(-) diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index 6a6262e3da..7b52572749 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -11,6 +11,22 @@ declare module 'azdata' { */ export const version: string; + export namespace env { + /** + * Well-known app quality values + */ + export enum AppQuality { + stable = 'stable', + insider = 'insider', + dev = 'dev' + } + + /** + * The version of Azure Data Studio this is currently running as - such as `stable`, or `insider` + */ + export const quality: AppQuality | string | undefined; + } + // EXPORTED NAMESPACES ///////////////////////////////////////////////// /** * Namespace for Data Management Protocol global methods @@ -92,6 +108,37 @@ declare module 'azdata' { * Namespace for connection management */ export namespace connection { + + /** + * Well-known Authentication types commonly supported by connection providers. + */ + export enum AuthenticationType { + /** + * Username and password + */ + SqlLogin = 'SqlLogin', + /** + * Windows Authentication + */ + Integrated = 'Integrated', + /** + * Azure Active Directory - Universal with MFA support + */ + AzureMFA = 'AzureMFA', + /** + * Azure Active Directory - Password + */ + AzureMFAAndUser = 'AzureMFAAndUser', + /** + * Datacenter Security Token Service Authentication + */ + DSTSAuth = 'dstsAuth', + /** + * No authentication required + */ + None = 'None' + } + /** * Connection profile primary class */ @@ -103,7 +150,7 @@ declare module 'azdata' { databaseName: string; userName: string; password: string; - authenticationType: string; + authenticationType: string | AuthenticationType; savePassword: boolean; groupFullName: string; groupId: string; @@ -370,7 +417,10 @@ declare module 'azdata' { databaseName?: string | undefined; userName: string; password: string; - authenticationType: string; + /** + * The type of authentication to use when connecting + */ + authenticationType: string | connection.AuthenticationType; savePassword: boolean; groupFullName?: string | undefined; groupId?: string | undefined; @@ -2985,6 +3035,11 @@ declare module 'azdata' { export interface ContainerBuilder extends ComponentBuilder { withLayout(layout: TLayout): ContainerBuilder; withItems(components: Array, itemLayout?: TItemLayout): ContainerBuilder; + /** + * Sets the initial set of properties for the container being created + * @param properties The properties to apply to the container + */ + withProps(properties: TPropertyBag): ContainerBuilder; } export interface FlexBuilder extends ContainerBuilder { @@ -4166,6 +4221,10 @@ declare module 'azdata' { export interface TableComponent extends Component, TableComponentProperties { onRowSelected: vscode.Event; onCellAction?: vscode.Event | undefined; + /** + * Append data to the existing table data. + */ + appendData(data: any[][]): Thenable; } export interface FileBrowserTreeComponent extends Component, FileBrowserTreeProperties { @@ -5225,9 +5284,41 @@ declare module 'azdata' { | 'executionPlan' | 'visualize'; + /** + * A message sent during the execution of a query + */ + export interface QueryMessage { + /** + * The message string + */ + message: string; + /** + * Whether this message is an error message or not + */ + isError: boolean; + /** + * The timestamp for when this message was sent + */ + time?: string; + } + + /** + * Information about a query that was executed + */ + export interface QueryInfo { + /** + * Any messages that have been received from the query provider + */ + messages: QueryMessage[]; + /** + * The ranges for each batch that has executed so far + */ + batchRanges: vscode.Range[]; + } + export interface QueryEventListener { /** - * A callback that is called whenever a query event occurs + * An event that is fired for query events * @param type The type of query event * @param document The document this event was sent by * @param args The extra information for the event, if any @@ -5236,8 +5327,9 @@ declare module 'azdata' { * queryStop: undefined * executionPlan: string (the plan itself) * visualize: ResultSetSummary (the result set to be visualized) + * @param queryInfo The information about the query that triggered this event */ - onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined): void; + onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined, queryInfo: QueryInfo): void; } export interface QueryDocument { diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 6fb4cf5689..2da14c90ff 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -9,22 +9,6 @@ import * as vscode from 'vscode'; declare module 'azdata' { - export namespace env { - /** - * Well-known app quality values - */ - export enum AppQuality { - stable = 'stable', - insider = 'insider', - dev = 'dev' - } - - /** - * The version of Azure Data Studio this is currently running as - such as `stable`, or `insider` - */ - export const quality: AppQuality | string | undefined; - } - export namespace nb { export interface NotebookDocument { /** @@ -423,10 +407,6 @@ declare module 'azdata' { } export interface IConnectionProfile extends ConnectionInfo { - /** - * The type of authentication to use when connecting - */ - authenticationType: string | connection.AuthenticationType; azureAccount?: string; azureResourceId?: string; azurePortalEndpoint?: string; @@ -521,35 +501,6 @@ declare module 'azdata' { } export namespace connection { - /** - * Well-known Authentication types commonly supported by connection providers. - */ - export enum AuthenticationType { - /** - * Username and password - */ - SqlLogin = 'SqlLogin', - /** - * Windows Authentication - */ - Integrated = 'Integrated', - /** - * Azure Active Directory - Universal with MFA support - */ - AzureMFA = 'AzureMFA', - /** - * Azure Active Directory - Password - */ - AzureMFAAndUser = 'AzureMFAAndUser', - /** - * Datacenter Security Token Service Authentication - */ - DSTSAuth = 'dstsAuth', - /** - * No authentication required - */ - None = 'None' - } /** * Opens the change password dialog. @@ -728,13 +679,6 @@ declare module 'azdata' { headerFilter?: boolean, } - export interface TableComponent { - /** - * Append data to an existing table data. - */ - appendData(data: any[][]): Thenable; - } - export interface ListViewOption { /** * The optional accessibility label for the column. Default is the label for the list view option. @@ -1819,67 +1763,12 @@ declare module 'azdata' { */ export type AriaLiveValue = 'polite' | 'assertive' | 'off'; - export interface ContainerBuilder extends ComponentBuilder { - /** - * Sets the initial set of properties for the container being created - * @param properties The properties to apply to the container - */ - withProps(properties: TPropertyBag): ContainerBuilder; - } - export interface ContainerProperties extends ComponentProperties { /** * Corresponds to the aria-live accessibility attribute for this component */ ariaLive?: AriaLiveValue } - export namespace queryeditor { - - export interface QueryMessage { - /** - * The message string - */ - message: string; - /** - * Whether this message is an error message or not - */ - isError: boolean; - /** - * The timestamp for when this message was sent - */ - time?: string; - } - - /** - * Information about a query that was executed - */ - export interface QueryInfo { - /** - * Any messages that have been received from the query provider - */ - messages: QueryMessage[]; - /** - * The ranges for each batch that has executed so far - */ - batchRanges: vscode.Range[]; - } - - export interface QueryEventListener { - /** - * An event that is fired for query events - * @param type The type of query event - * @param document The document this event was sent by - * @param args The extra information for the event, if any - * The args sent depend on the type of event : - * queryStart: undefined - * queryStop: undefined - * executionPlan: string (the plan itself) - * visualize: ResultSetSummary (the result set to be visualized) - * @param queryInfo The information about the query that triggered this event - */ - onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined, queryInfo: QueryInfo): void; - } - } export interface NodeInfo { /**