Clean up Loading Component typings (#13785)

* Clean up Loading Component typings

* add properties to impl
This commit is contained in:
Charles Gagnon
2020-12-11 12:57:46 -08:00
committed by GitHub
parent 496fe0afa5
commit a926f87965
3 changed files with 38 additions and 2 deletions

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

@@ -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
*/

View File

@@ -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' {
/**

View File

@@ -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];
}