diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index fd63e6e261..d984907452 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -194,6 +194,40 @@ declare module 'azdata' { * @param connectionProfile connection profile */ export function connect(connectionProfile: IConnectionProfile, saveConnection?: boolean, showDashboard?: boolean): Thenable; + + /** + * 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; } /** @@ -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; @@ -1765,7 +1799,7 @@ declare module 'azdata' { getTemplateNotebook(ownerUri: string, targetDatabase: string, jobId: string): Thenable; createNotebook(ownerUri: string, notebook: AgentNotebookInfo, templateFilePath: string): Thenable; deleteNotebook(ownerUri: string, notebook: AgentNotebookInfo): Thenable; - updateNotebook(ownerUri: string, originialNotebookName: string, notebook: AgentNotebookInfo, templateFilePath: string): Thenable; + updateNotebook(ownerUri: string, originalNotebookName: string, notebook: AgentNotebookInfo, templateFilePath: string): Thenable; updateNotebookMaterializedName(ownerUri: string, agentNotebookHistory: AgentNotebookHistoryInfo, targetDatabase: string, name: string): Thenable; updateNotebookMaterializedPin(ownerUri: string, agentNotebookHistory: AgentNotebookHistoryInfo, targetDatabase: string, pin: boolean): Thenable; deleteMaterializedNotebook(ownerUri: string, agentNotebookHistory: AgentNotebookHistoryInfo, targetDatabase: string): Thenable; @@ -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; hyperlink(): ComponentBuilder; + separator(): ComponentBuilder; + infoBox(): ComponentBuilder; + propertiesContainer(): ComponentBuilder; } export interface TreeComponentDataProvider extends vscode.TreeDataProvider { @@ -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; } 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; diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 1eaad12c83..8e5ce4a74d 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -8,44 +8,6 @@ import * as vscode from 'vscode'; declare module 'azdata' { - /** - * Namespace for connection management - */ - export namespace connection { - /** - * 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 Promise to return the connection profile matching the ownerUri - */ - export function getConnection(ownerUri: string): Thenable; - } export namespace nb { export interface NotebookDocument { @@ -272,17 +234,6 @@ declare module 'azdata' { title: string; } - export interface HyperlinkComponent { - /** - * An event called when the hyperlink is clicked - */ - onDidClick: vscode.Event; - } - - export interface HyperlinkComponentProperties { - showLinkIcon?: boolean; - } - export interface RadioButtonComponent { /** * An event called when the value of radio button changes @@ -342,9 +293,6 @@ declare module 'azdata' { radioCardGroup(): ComponentBuilder; listView(): ComponentBuilder; tabbedPanel(): TabbedPanelComponentBuilder; - separator(): ComponentBuilder; - propertiesContainer(): ComponentBuilder; - infoBox(): ComponentBuilder; slider(): ComponentBuilder; } @@ -352,9 +300,6 @@ declare module 'azdata' { withProps(properties: TPropertyBag): ComponentBuilder; } - export interface DropDownProperties extends LoadingComponentProperties { - } - export interface RadioCard { id: string; descriptions: RadioCardDescription[]; @@ -418,12 +363,6 @@ declare module 'azdata' { onDidClick: vscode.Event; } - export interface SeparatorComponent extends Component { - } - export interface SeparatorComponentProperties extends ComponentProperties { - - } - export interface DeclarativeTableProperties { /** * dataValues will only be used if data is an empty array @@ -442,38 +381,6 @@ declare module 'azdata' { style?: CssStyles } - export interface ComponentProperties { - ariaHidden?: boolean; - } - - export interface ComponentWithIconProperties extends ComponentProperties { - /** - * The path for the icon with optional dark-theme away alternative - */ - iconPath?: IconPath; - /** - * The height of the icon - */ - iconHeight?: number | string; - /** - * The width of the icon - */ - iconWidth?: number | string; - /** - * The title for the icon. This title will show when hovered over - */ - title?: string; - } - - export interface ComponentWithIcon extends ComponentWithIconProperties { - } - - export interface ImageComponent extends ComponentWithIcon { - } - - export interface ImageComponentProperties extends ComponentProperties, ComponentWithIconProperties { - } - /** * Panel component with tabs */ @@ -576,19 +483,6 @@ declare module 'azdata' { withTabs(tabs: (Tab | TabGroup)[]): ContainerBuilder; } - export interface InputBoxProperties extends ComponentProperties { - validationErrorMessage?: string; - readOnly?: boolean; - /** - * This title will show when hovered over - */ - title?: string; - } - - export interface CheckBoxProperties { - required?: boolean; - } - export interface SliderComponentProperties extends ComponentProperties { /** * The value selected on the slider. Default initial value is the minimum value. @@ -621,63 +515,6 @@ declare module 'azdata' { onInput: vscode.Event; } - /** - * 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[]; - } - - /** - * 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; - } - export namespace nb { /** * An event that is emitted when the active Notebook editor is changed. @@ -703,7 +540,7 @@ declare module 'azdata' { export interface Dialog { /** * Width of the dialog. - * Default is 'narrrow'. + * Default is 'narrow'. */ width?: DialogWidth; /** @@ -734,10 +571,6 @@ declare module 'azdata' { } export interface Wizard { - /** - * The name used to identify the wizard in telemetry - */ - name?: string; /** * Width of the wizard */ @@ -754,7 +587,7 @@ declare module 'azdata' { export type DialogWidth = 'narrow' | 'medium' | 'wide' | number | string; /** - * These dialog styles affect how the dialog dispalys in the application. + * These dialog styles affect how the dialog displays in the application. * normal: Positioned top and centered. * flyout (default): Existing panel appearance - positioned full screen height, opens from the right side of the application. * callout: Opens below or beside button clicked, contains footer section with buttons. @@ -788,20 +621,6 @@ declare module 'azdata' { */ export function createModelViewDialog(title: string, dialogName?: string, width?: DialogWidth, dialogStyle?: DialogStyle, dialogPosition?: DialogPosition, renderHeader?: boolean, renderFooter?: boolean, dialogProperties?: IDialogProperties): Dialog; - /** - * 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, name?: string, width?: DialogWidth): Wizard; - - /** - * 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, pageName?: string): WizardPage; export interface Button { /** @@ -966,13 +785,6 @@ declare module 'azdata' { Informational = 'Informational' } - export interface DiffEditorComponent { - /** - * Title of editor - */ - title: string; - } - export namespace workspace { /** * Creates and enters a workspace at the specified location @@ -1082,13 +894,6 @@ declare module 'azdata' { action: ActionOnCellCheckboxCheck; } - export enum AzureResource { - /** - * Microsoft Graph - */ - MsGraph = 7 - } - export interface ResultSetSummary { /** * The visualization options for the result set.