Promote some proposed typings (#22508)

This commit is contained in:
Charles Gagnon
2023-03-29 09:06:44 -07:00
committed by GitHub
parent ef02e2bfce
commit 2ccd7405c0
2 changed files with 96 additions and 115 deletions

100
src/sql/azdata.d.ts vendored
View File

@@ -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<TComponent extends Component, TLayout, TItemLayout, TPropertyBag extends ContainerProperties> extends ComponentBuilder<TComponent, TPropertyBag> {
withLayout(layout: TLayout): ContainerBuilder<TComponent, TLayout, TItemLayout, TPropertyBag>;
withItems(components: Array<Component>, itemLayout?: TItemLayout): ContainerBuilder<TComponent, TLayout, TItemLayout, TPropertyBag>;
/**
* Sets the initial set of properties for the container being created
* @param properties The properties to apply to the container
*/
withProps(properties: TPropertyBag): ContainerBuilder<TComponent, TLayout, TItemLayout, TPropertyBag>;
}
export interface FlexBuilder extends ContainerBuilder<FlexContainer, FlexLayout, FlexItemLayout, ContainerProperties> {
@@ -4166,6 +4221,10 @@ declare module 'azdata' {
export interface TableComponent extends Component, TableComponentProperties {
onRowSelected: vscode.Event<any>;
onCellAction?: vscode.Event<ICellActionEventArgs> | undefined;
/**
* Append data to the existing table data.
*/
appendData(data: any[][]): Thenable<void>;
}
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 {

View File

@@ -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<void>;
}
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<TComponent extends Component, TLayout, TItemLayout, TPropertyBag extends ContainerProperties> extends ComponentBuilder<TComponent, TPropertyBag> {
/**
* Sets the initial set of properties for the container being created
* @param properties The properties to apply to the container
*/
withProps(properties: TPropertyBag): ContainerBuilder<TComponent, TLayout, TItemLayout, TPropertyBag>;
}
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 {
/**