Promote some proposed APIs to stable (#14788)

* Promote some proposed APIs to stable

* Fix spelling

(cherry picked from commit b88a9ba33e644f83a2b8deac9d99d86803605a85)
This commit is contained in:
Charles Gagnon
2021-03-18 13:11:43 -07:00
committed by GitHub
parent 5da4690be8
commit 11d4ea3232
2 changed files with 187 additions and 218 deletions

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

@@ -194,6 +194,40 @@ declare module 'azdata' {
* @param connectionProfile connection profile
*/
export function connect(connectionProfile: IConnectionProfile, saveConnection?: boolean, showDashboard?: boolean): Thenable<ConnectionResult>;
/**
* Supported connection event types
*/
export type ConnectionEventType =
| 'onConnect'
| 'onDisconnect'
| 'onConnectionChanged';
/**
* Connection Event Lister
*/
export interface ConnectionEventListener {
/**
* Connection event handler
* @param type Connection event type
* @param ownerUri Connection's owner uri
* @param args Connection profile
*/
onConnectionEvent(type: ConnectionEventType, ownerUri: string, args: IConnectionProfile): void;
}
/**
* Register a connection event listener
* @param listener The connection event listener
*/
export function registerConnectionEventListener(listener: connection.ConnectionEventListener): vscode.Disposable;
/**
* Get connection profile by its owner uri
* @param ownerUri The owner uri of the connection
* @returns Thenable to return the connection profile matching the ownerUri
*/
export function getConnection(ownerUri: string): Thenable<ConnectionProfile>;
}
/**
@@ -232,7 +266,7 @@ declare module 'azdata' {
/**
* Get connectionProfile from sessionId
* @param sessionId The id of the session that the node exists on
* @returns The IConnecitonProfile for the session
* @returns The IConnectionProfile for the session
*/
export function getSessionConnectionProfile(sessionId: string): Thenable<IConnectionProfile>;
@@ -1765,7 +1799,7 @@ declare module 'azdata' {
getTemplateNotebook(ownerUri: string, targetDatabase: string, jobId: string): Thenable<AgentNotebookTemplateResult>;
createNotebook(ownerUri: string, notebook: AgentNotebookInfo, templateFilePath: string): Thenable<CreateAgentNotebookResult>;
deleteNotebook(ownerUri: string, notebook: AgentNotebookInfo): Thenable<ResultStatus>;
updateNotebook(ownerUri: string, originialNotebookName: string, notebook: AgentNotebookInfo, templateFilePath: string): Thenable<UpdateAgentNotebookResult>;
updateNotebook(ownerUri: string, originalNotebookName: string, notebook: AgentNotebookInfo, templateFilePath: string): Thenable<UpdateAgentNotebookResult>;
updateNotebookMaterializedName(ownerUri: string, agentNotebookHistory: AgentNotebookHistoryInfo, targetDatabase: string, name: string): Thenable<ResultStatus>;
updateNotebookMaterializedPin(ownerUri: string, agentNotebookHistory: AgentNotebookHistoryInfo, targetDatabase: string, pin: boolean): Thenable<ResultStatus>;
deleteMaterializedNotebook(ownerUri: string, agentNotebookHistory: AgentNotebookHistoryInfo, targetDatabase: string): Thenable<ResultStatus>;
@@ -2026,7 +2060,7 @@ declare module 'azdata' {
defaultView: string;
/**
* TSQL for creating a session
* T-SQL for creating a session
*/
createStatement: string;
}
@@ -2254,7 +2288,11 @@ declare module 'azdata' {
/**
* Azure Dev Ops
*/
AzureDevOps = 6
AzureDevOps = 6,
/**
* Microsoft Graph
*/
MsGraph = 7
}
export interface DidChangeAccountsParams {
@@ -2378,7 +2416,7 @@ declare module 'azdata' {
export namespace resources {
/**
* Registers a resource provider that can suport
* Registers a resource provider that can support
*/
export function registerResourceProvider(providerMetadata: ResourceProviderMetadata, provider: ResourceProvider): vscode.Disposable;
}
@@ -2615,6 +2653,9 @@ declare module 'azdata' {
loadingComponent(): LoadingComponentBuilder;
fileBrowserTree(): ComponentBuilder<FileBrowserTreeComponent, FileBrowserTreeProperties>;
hyperlink(): ComponentBuilder<HyperlinkComponent, HyperlinkComponentProperties>;
separator(): ComponentBuilder<SeparatorComponent, SeparatorComponentProperties>;
infoBox(): ComponentBuilder<InfoBoxComponent, InfoBoxComponentProperties>;
propertiesContainer(): ComponentBuilder<PropertiesContainerComponent, PropertiesContainerComponentProperties>;
}
export interface TreeComponentDataProvider<T> extends vscode.TreeDataProvider<T> {
@@ -3176,6 +3217,10 @@ declare module 'azdata' {
* Corresponds to the aria-selected accessibility attribute for this component
*/
ariaSelected?: boolean;
/**
* Corresponds to the aria-hidden accessibility attribute for this component
*/
ariaHidden?: boolean;
/**
* Matches the CSS style key and its available values.
*/
@@ -3185,19 +3230,25 @@ declare module 'azdata' {
export type ThemedIconPath = { light: string | vscode.Uri; dark: string | vscode.Uri };
export type IconPath = string | vscode.Uri | ThemedIconPath;
export interface ComponentWithIcon {
export interface ComponentWithIcon extends ComponentWithIconProperties { }
export interface ComponentWithIconProperties extends ComponentProperties {
/**
* @deprecated This will be moved to `ComponentWithIconProperties`
* The path for the icon with optional dark-theme away alternative
*/
iconPath?: IconPath;
/**
* @deprecated This will be moved to `ComponentWithIconProperties`
* The height of the icon
*/
iconHeight?: number | string;
/**
* @deprecated This will be moved to `ComponentWithIconProperties`
* The width of the icon
*/
iconWidth?: number | string;
/**
* The title for the icon. This title will show when hovered over
*/
title?: string;
}
export interface InputBoxProperties extends ComponentProperties {
@@ -3214,7 +3265,7 @@ declare module 'azdata' {
*/
min?: number;
/**
* The maxmimum value allowed for the input. Only valid for number inputs.
* The maximum value allowed for the input. Only valid for number inputs.
*/
max?: number;
/**
@@ -3222,6 +3273,20 @@ declare module 'azdata' {
* means the event will propagate up to any parents that have handlers (such as validate on Dialogs)
*/
stopEnterPropagation?: boolean;
/**
* The error message to show when custom validation fails. Note that built-in validations
* (such as min/max values) will use the default error messages for those validations
* as appropriate.
*/
validationErrorMessage?: string;
/**
* Whether the input box is marked with the 'readonly' attribute
*/
readOnly?: boolean;
/**
* This title will show when hovered over
*/
title?: string;
}
export interface TableColumn {
@@ -3256,9 +3321,9 @@ declare module 'azdata' {
}
export enum ColumnSizingMode {
ForceFit = 0, // all columns will be sized to fit in viewable space, no horiz scroll bar
ForceFit = 0, // all columns will be sized to fit in viewable space, no horizontal scroll bar
AutoFit = 1, // columns will be ForceFit up to a certain number; currently 3. At 4 or more the behavior will switch to NO force fit
DataFit = 2 // columns use sizing based on cell data, horiz scroll bar present if more cells than visible in view area
DataFit = 2 // columns use sizing based on cell data, horizontal scroll bar present if more cells than visible in view area
}
export interface TableComponentProperties extends ComponentProperties {
@@ -3284,8 +3349,19 @@ declare module 'azdata' {
}
export interface CheckBoxProperties extends ComponentProperties {
/**
* Whether the checkbox is checked.
*/
checked?: boolean;
/**
* The label to display next to the checkbox.
*/
label?: string;
/**
* Whether the component is marked with the 'required' property - making
* it required to be checked for component validation.
*/
required?: boolean;
}
export interface TreeProperties extends ComponentProperties {
@@ -3325,12 +3401,20 @@ declare module 'azdata' {
url: string;
}
export interface HyperlinkComponentProperties extends ComponentProperties, TitledComponentProperties {
export interface HyperlinkComponentProperties extends TitledComponentProperties {
label: string;
url: string;
/**
* Whether to show the 'external link' icon next to the hyperlink
*/
showLinkIcon?: boolean;
}
export interface DropDownProperties extends ComponentProperties {
export interface ImageComponent extends ComponentWithIcon { }
export interface ImageComponentProperties extends ComponentWithIconProperties { }
export interface DropDownProperties extends LoadingComponentProperties {
value?: string | CategoryValue;
values?: string[] | CategoryValue[];
editable?: boolean;
@@ -3383,7 +3467,7 @@ declare module 'azdata' {
*/
content?: string;
/**
* The languge mode for this text editor. The language mode is SQL by default.
* The language mode for this text editor. The language mode is SQL by default.
*/
languageMode?: string;
/**
@@ -3482,6 +3566,10 @@ declare module 'azdata' {
}
export interface HyperlinkComponent extends Component, HyperlinkComponentProperties {
/**
* An event called when the hyperlink is clicked
*/
onDidClick: vscode.Event<void>;
}
export interface InputBoxComponent extends Component, InputBoxProperties {
@@ -3568,6 +3656,10 @@ declare module 'azdata' {
}
export interface DiffEditorComponent extends Component {
/**
* Title of editor
*/
title: string;
/**
* The content inside the left text editor
*/
@@ -3577,7 +3669,7 @@ declare module 'azdata' {
*/
contentRight: string;
/**
* The languge mode for this text editor. The language mode is SQL by default.
* The language mode for this text editor. The language mode is SQL by default.
*/
languageMode: string;
/**
@@ -3644,6 +3736,70 @@ declare module 'azdata' {
component: Component;
}
/**
* A component that adds a line dividing UI components such as toolbar buttons
*/
export interface SeparatorComponent extends Component { }
/**
* The properties for the separator component
*/
export interface SeparatorComponentProperties extends ComponentProperties { }
/**
* Component to display text with an icon representing the severity
*/
export interface InfoBoxComponent extends Component, InfoBoxComponentProperties { }
export type InfoBoxStyle = 'information' | 'warning' | 'error' | 'success';
/**
* Properties for configuring a InfoBoxComponent
*/
export interface InfoBoxComponentProperties extends ComponentProperties {
/**
* The style of the InfoBox
*/
style: InfoBoxStyle;
/**
* The display text of the InfoBox
*/
text: string;
/**
* Controls whether the text should be announced by the screen reader. Default value is false.
*/
announceText?: boolean;
}
/**
* A property to be displayed in the PropertiesContainerComponent
*/
export interface PropertiesContainerItem {
/**
* The name of the property to display
*/
displayName: string;
/**
* The value of the property to display
*/
value: string;
}
/**
* Component to display a list of property values.
*/
export interface PropertiesContainerComponent extends Component, PropertiesContainerComponentProperties { }
/**
* Properties for configuring a PropertiesContainerComponent
*/
export interface PropertiesContainerComponentProperties extends ComponentProperties {
/**
* The properties to display
*/
propertyItems?: PropertiesContainerItem[];
}
/**
* A view backed by a model provided by an extension.
* This model contains enough information to lay out the view
@@ -3738,14 +3894,17 @@ declare module 'azdata' {
/**
* Create a wizard page with the given title, for inclusion in a wizard
* @param title The title of the page
* @param pageName The optional page name parameter will be used for telemetry
*/
export function createWizardPage(title: string): WizardPage;
export function createWizardPage(title: string, pageName?: string): WizardPage;
/**
* Create a wizard with the given title and pages
* Create a wizard with the given title and width
* @param title The title of the wizard
* @param name The name used to identify the wizard in telemetry
* @param width The width of the wizard, default value is 'narrow'
*/
export function createWizard(title: string): Wizard;
export function createWizard(title: string, name?: string, width?: DialogWidth): Wizard;
/**
* Used to control whether a message in a dialog/wizard is displayed as an error,
@@ -3942,6 +4101,11 @@ declare module 'azdata' {
*/
title: string;
/**
* The name used to identify the wizard in telemetry
*/
name?: string;
/**
* The wizard's pages. Pages can be added/removed while the dialog is open by using
* the addPage and removePage methods
@@ -4131,7 +4295,7 @@ declare module 'azdata' {
/**
* Resource name for this editor
* File icons might depend on file extension, language id or resource name
* Resource name field needs to be set explitly if file icon for a particular Model View Editor depends on editor resource name
* Resource name field needs to be set explicitly if file icon for a particular Model View Editor depends on editor resource name
*/
readonly resourceName?: string;
}
@@ -4939,7 +5103,7 @@ declare module 'azdata' {
/**
* Gets the full specification for this kernel, which can be serialized to
* a noteobok file
* a notebook file
*/
getSpec(): Thenable<IKernelSpec>;