diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index 4f179e7808..691db4fa5b 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -3400,9 +3400,22 @@ declare module 'azdata' { } export interface LoadingComponentProperties extends ComponentProperties { + /** + * Whether to show the loading spinner instead of the contained component. True by default + */ loading?: boolean; + /** + * Whether to show the loading text next to the spinner + */ showText?: boolean; + /** + * The text to display while loading is set to true + */ loadingText?: string; + /** + * The text to display while loading is set to false. Will also be announced through screen readers + * once loading is completed. + */ loadingCompletedText?: string; } @@ -3595,7 +3608,7 @@ declare module 'azdata' { * Component used to wrap another component that needs to be loaded, and show a loading spinner * while the contained component is loading */ - export interface LoadingComponent extends Component { + export interface LoadingComponent extends Component, LoadingComponentProperties { /** * Whether to show the loading spinner instead of the contained component. True by default */ diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 186d884aaa..7cfd008d3b 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -6,7 +6,6 @@ // This is the place for API experiments and proposal. import * as vscode from 'vscode'; -import { LoadingComponentProperties } from 'azdata'; declare module 'azdata' { /** diff --git a/src/sql/workbench/api/common/extHostModelView.ts b/src/sql/workbench/api/common/extHostModelView.ts index c417ec2b35..11b8f66ed6 100644 --- a/src/sql/workbench/api/common/extHostModelView.ts +++ b/src/sql/workbench/api/common/extHostModelView.ts @@ -1673,6 +1673,30 @@ class LoadingComponentWrapper extends ComponentWrapper implements azdata.Loading this.setProperty('loading', value); } + public get showText(): boolean { + return this.properties['showText']; + } + + public set showText(value: boolean) { + this.setProperty('showText', value); + } + + public get loadingText(): string { + return this.properties['loadingText']; + } + + public set loadingText(value: string) { + this.setProperty('loadingText', value); + } + + public get loadingCompletedText(): string { + return this.properties['loadingCompletedText']; + } + + public set loadingCompletedText(value: string) { + this.setProperty('loadingCompletedText', value); + } + public get component(): azdata.Component { return this.items[0]; }