diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index 2fc0e23afb..b3f4897499 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -2306,7 +2306,19 @@ declare module 'azdata' { /** * Microsoft Graph */ - MsGraph = 7 + MsGraph = 7, + /** + * Azure Log Analytics + */ + AzureLogAnalytics = 8, + /** + * Azure Storage + */ + AzureStorage = 9, + /** + * Kusto + */ + AzureKusto = 10 } export interface DidChangeAccountsParams { @@ -2568,8 +2580,9 @@ declare module 'azdata' { * Create a new ModelView editor * @param title The title shown in the editor tab * @param options Options to configure the editor + * @param name The name used to identify the editor in telemetry */ - export function createModelViewEditor(title: string, options?: ModelViewEditorOptions): ModelViewEditor; + export function createModelViewEditor(title: string, options?: ModelViewEditorOptions, name?: string,): ModelViewEditor; export interface ModelViewEditor extends window.ModelViewPanel { /** @@ -2693,7 +2706,15 @@ declare module 'azdata' { export interface ComponentBuilder { component(): TComponent; + /** + * @deprecated Use withProps instead + */ withProperties(properties: U): ComponentBuilder; + /** + * Sets the initial set of properties for the component being created + * @param properties The properties to apply to the component + */ + withProps(properties: TPropertyBag): ComponentBuilder; withValidation(validation: (component: TComponent) => boolean | Thenable): ComponentBuilder; } export interface ContainerBuilder extends ComponentBuilder { @@ -2900,6 +2921,13 @@ declare module 'azdata' { * @param layout object */ setLayout(layout: TLayout): void; + + /** + * Sets the layout for the specified child component + * @param component The component to set the layout for + * @param layout The layout to apply + */ + setItemLayout(component: Component, layout: TItemLayout): void; } export interface NavContainer extends Container { @@ -3306,6 +3334,10 @@ declare module 'azdata' { * This title will show when hovered over */ title?: string | undefined; + /** + * The maximum number of characters allowed in the input box. + */ + maxLength?: number; } export interface TableColumn { @@ -3507,19 +3539,57 @@ declare module 'azdata' { isAutoResizable: boolean; } + export enum ButtonType { + /** + * Opens up the File Picker dialog when clicked + */ + File = 'File', + /** + * Normal button with no special behavior + */ + Normal = 'Normal', + /** + * Button that displays additional information when hovered over + */ + Informational = 'Informational' + } + export interface ButtonProperties extends ComponentWithIconProperties { /** * The label for the button */ label?: string | undefined; + /** * Whether the button opens the file browser dialog + * @deprecated Use fileType instead */ isFile?: boolean | undefined; + /** * The content of the currently selected file */ fileContent?: string | undefined; + + /** + * Specifies the type of button this is. Default is Normal. + */ + buttonType?: ButtonType; + + /** + * Description text to display inside button element. + */ + description?: string; + + /** + * Specifies whether this is a secondary button. Default value is false. + */ + secondary?: boolean; + + /** + * The file type filter used for the file input dialog box - only used when the button type is File + */ + fileType?: string } export interface LoadingComponentProperties extends ComponentProperties { @@ -3599,6 +3669,10 @@ declare module 'azdata' { * An event called when the radio button is clicked */ onDidClick: vscode.Event; + /** + * An event called when the value of radio button changes + */ + onDidChangeCheckedState: vscode.Event; } export interface CheckBoxComponent extends Component, CheckBoxProperties { @@ -3890,6 +3964,40 @@ declare module 'azdata' { */ export function createModelViewDialog(title: string, dialogName?: string, width?: DialogWidth): Dialog; + export interface ModelViewDashboard { + /** + * Registers the initial set of tabs for this dashboard + * @param handler Callback for creating the initial set of tabs to display + */ + registerTabs(handler: (view: ModelView) => Thenable<(DashboardTab | DashboardTabGroup)[]>): void; + /** + * Open the dashboard + */ + open(): Thenable; + /** + * Close the dashboard + */ + close(): Thenable; + /** + * Updates the tabs that are currently displayed + * @param tabs The new set of tabs to display + */ + updateTabs(tabs: (DashboardTab | DashboardTabGroup)[]): void; + /** + * Selects the tab with the given ID + * @param id The ID of the tab to select + */ + selectTab(id: string): void; + } + + /** + * Creates a ModelView Dashboard that when opened will be displayed in an editor pane. + * @param title The title displayed in the editor tab for the dashboard + * @param name The name used to identify this dashboard in telemetry + * @param options Options to configure the dashboard + */ + export function createModelViewDashboard(title: string, name?: string, options?: ModelViewDashboardOptions): ModelViewDashboard; + /** * Create a dialog tab which can be included as part of the content of a dialog * @param title The title of the page, displayed on the tab to select the page @@ -4077,6 +4185,11 @@ declare module 'azdata' { * Position of the button on the dialog footer */ position?: DialogButtonPosition | undefined; + + /** + * Specifies whether this is a secondary button. Default is false. + */ + secondary?: boolean; } export type DialogButtonPosition = 'left' | 'right'; @@ -4119,6 +4232,11 @@ declare module 'azdata' { * An optional description for the page. If provided it will be displayed underneath the page title. */ description: string; + + /** + * An optional name for the page. If provided it will be used for telemetry + */ + pageName?: string; } export interface Wizard { @@ -4210,8 +4328,9 @@ declare module 'azdata' { /** * Open the wizard. Does nothing if the wizard is already open. + * @param source Where the wizard was opened from for telemetry (ex: command palette, context menu) */ - open(): Thenable; + open(source?: string): Thenable; /** * Close the wizard. Does nothing if the wizard is not open. @@ -4307,6 +4426,37 @@ declare module 'azdata' { export function getQueryDocument(fileUri: string): Thenable; } + export interface DashboardTab extends Tab { + /** + * Toolbar of the tab, optional. + */ + toolbar?: ToolbarContainer; + } + + export interface DashboardTabGroup { + /** + * Title of the tab group + */ + title: string; + + /** + * Child tabs of the tab group + */ + tabs: DashboardTab[]; + } + + export interface ModelViewDashboardOptions { + /** + * Whether to show the tab icon, default is true + */ + showIcon?: boolean; + + /** + * Whether to show the tab navigation pane even when there is only one tab, default is false + */ + alwaysShowTabs?: boolean; + } + export interface ModelViewEditorOptions { /** * Should the model view editor's context be kept around even when the editor is no longer visible? It is false by default @@ -4480,6 +4630,11 @@ declare module 'azdata' { */ export const onDidChangeNotebookCell: vscode.Event; + /** + * An event that is emitted when the active Notebook editor is changed. + */ + export const onDidChangeActiveNotebookEditor: vscode.Event; + /** * Show the given document in a notebook editor. A [column](#ViewColumn) can be provided * to control where the editor is being shown. Might change the [active editor](#nb.activeNotebookEditor). diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 245747381c..8610a81db6 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -257,13 +257,6 @@ declare module 'azdata' { title: string; } - export interface RadioButtonComponent { - /** - * An event called when the value of radio button changes - */ - onDidChangeCheckedState: vscode.Event; - } - export interface DeclarativeTableColumn { headerCssStyles?: CssStyles; rowCssStyles?: CssStyles; @@ -326,10 +319,6 @@ declare module 'azdata' { slider(): ComponentBuilder; } - export interface ComponentBuilder { - withProps(properties: TPropertyBag): ComponentBuilder; - } - export interface RadioCard { id: string; descriptions: RadioCardDescription[]; @@ -600,28 +589,7 @@ declare module 'azdata' { textType?: TextType; } - export namespace nb { - /** - * An event that is emitted when the active Notebook editor is changed. - */ - export const onDidChangeActiveNotebookEditor: vscode.Event; - } export namespace window { - export interface ModelViewDashboard { - registerTabs(handler: (view: ModelView) => Thenable<(DashboardTab | DashboardTabGroup)[]>): void; - open(): Thenable; - close(): Thenable; - updateTabs(tabs: (DashboardTab | DashboardTabGroup)[]): void; - selectTab(id: string): void; - } - - /** - * - * @param title The title displayed in the editor tab for the dashboard - * @param name The name used to identify this dashboard in telemetry - * @param options Options to configure the dashboard - */ - export function createModelViewDashboard(title: string, name?: string, options?: ModelViewDashboardOptions): ModelViewDashboard; export interface Dialog { /** @@ -661,40 +629,41 @@ declare module 'azdata' { * Width of the wizard */ width?: DialogWidth; - - /** - * Open the wizard. Does nothing if the wizard is already open. - * @param source Where the wizard was opened from for telemetry (ex: command palette, context menu) - */ - open(source?: string): Thenable; - } - - export interface WizardPage extends ModelViewPanel { - /** - * An optional name for the page. If provided it will be used for telemetry - */ - pageName?: string; } /** * 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. + * flyout (default): Positioned full screen height, opens from the right side of the application. + * callout: Opens below or beside parent element, contains footer section with buttons. */ export type DialogStyle = 'normal' | 'flyout' | 'callout'; + /** + * Where to position the dialog relative to the parent element + */ export type DialogPosition = 'left' | 'below'; /** - * These are positional data prior to opening of dialog. - * They are needed for positioning relative to the button which triggers the opening of the dialog. - * Default is undefined. + * The p + * They are needed for positioning relative to the element which triggers the opening of the dialog. */ export interface IDialogProperties { + /** + * x position of the dialog relative to the parent element + */ xPos: number, + /** + * y position of the dialog relative to the parent element + */ yPos: number, + /** + * width of the dialog + */ width: number, + /** + * height of the dialog + */ height: number } @@ -711,57 +680,6 @@ declare module 'azdata' { */ export function createModelViewDialog(title: string, dialogName?: string, width?: DialogWidth, dialogStyle?: DialogStyle, dialogPosition?: DialogPosition, renderHeader?: boolean, renderFooter?: boolean, dialogProperties?: IDialogProperties): Dialog; - export interface Button { - /** - * Specifies whether this is a secondary button. Default is false. - */ - secondary?: boolean; - } - } - - export namespace workspace { - /** - * Create a new ModelView editor - * @param title The title shown in the editor tab - * @param options Options to configure the editor - * @param name The name used to identify the editor in telemetry - */ - export function createModelViewEditor(title: string, options?: ModelViewEditorOptions, name?: string,): ModelViewEditor; - } - - export interface DashboardTab extends Tab { - /** - * Toolbar of the tab, optional. - */ - toolbar?: ToolbarContainer; - } - - export interface DashboardTabGroup { - /** - * * Title of the tab group - */ - title: string; - - /** - * children of the tab group - */ - tabs: DashboardTab[]; - } - - export interface ModelViewDashboardOptions { - /** - * Whether to show the tab icon, default is true - */ - showIcon?: boolean; - - /** - * Whether to show the tab navigation pane even when there is only one tab, default is false - */ - alwaysShowTabs?: boolean; - } - - export interface Container extends Component { - setItemLayout(component: Component, layout: TItemLayout): void; } export interface TaskInfo { @@ -772,10 +690,6 @@ declare module 'azdata' { icon?: IconPath; } - export interface ButtonCell extends TableCell { - columnName: string; - } - export namespace sqlAssessment { export enum SqlAssessmentTargetType { @@ -853,54 +767,6 @@ declare module 'azdata' { delete?: boolean; } - export enum AzureResource { - /** - * Azure Log Analytics - */ - AzureLogAnalytics = 8, - /** - * Azure Storage - */ - AzureStorage = 9, - /** - * Kusto - */ - AzureKusto = 10 - } - - export interface ButtonProperties { - /** - * Specifies whether to use expanded layout or not. - */ - buttonType?: ButtonType; - /** - * Description text to display inside button element. - */ - description?: string; - /** - * Specifies whether this is a secondary button. Default value is false. - */ - secondary?: boolean; - - /** - * The file type filter used for the file input dialog box - only used when the button type is File - */ - fileType?: string - } - - export enum ButtonType { - File = 'File', - Normal = 'Normal', - Informational = 'Informational' - } - - export interface InputBoxProperties { - /** - * The maximum number of characters allowed in the input box. - */ - maxLength?: number; - } - export namespace workspace { /** * Creates and enters a workspace at the specified location