diff --git a/extensions/notebook/src/test/common.ts b/extensions/notebook/src/test/common.ts index 55abefac6b..d355fec1e8 100644 --- a/extensions/notebook/src/test/common.ts +++ b/extensions/notebook/src/test/common.ts @@ -321,7 +321,7 @@ class TestComponentBase implements azdata.Component { updateProperty(key: string, value: any): Thenable { throw new Error('Method not implemented'); } - updateCssStyles(cssStyles: { [key: string]: string; }): Thenable { + updateCssStyles(cssStyles: azdata.CssStyles): Thenable { throw new Error('Method not implemented'); } onValidityChanged: vscode.Event = undefined; diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index 35300d56c6..4a518ec770 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -2783,7 +2783,7 @@ declare module 'azdata' { * @param cssStyles The styles to update * @returns Thenable that completes once the update has been applied to the UI */ - updateCssStyles(cssStyles: { [key: string]: string }): Thenable; + updateCssStyles(cssStyles: CssStyles): Thenable; /** * Event fired to notify that the component's validity has changed @@ -2960,6 +2960,11 @@ declare module 'azdata' { 'inherit' | ''; + /** + * Set of CSS key-value pairs + */ + export type CssStyles = { [key: string]: string | number }; + /** * The config for a FlexBox-based container. This supports easy * addition of content to a container with a flexible layout @@ -3038,7 +3043,7 @@ declare module 'azdata' { /** * Matches the CSS style key and its available values. */ - CSSStyles?: { [key: string]: string }; + CSSStyles?: CssStyles; } export interface FormItemLayout { @@ -3086,7 +3091,7 @@ declare module 'azdata' { /** * Matches the CSS style key and its available values. */ - CSSStyles?: { [key: string]: string }; + CSSStyles?: CssStyles; } export interface DivContainer extends Container, DivContainerProperties { @@ -3224,7 +3229,7 @@ declare module 'azdata' { /** * Matches the CSS style key and its available values. */ - CSSStyles?: { [key: string]: string }; + CSSStyles?: CssStyles; } export type ThemedIconPath = { light: string | vscode.Uri; dark: string | vscode.Uri }; diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 7ca3bf6e75..254e181372 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -315,8 +315,6 @@ declare module 'azdata' { linkCodiconStyles?: CssStyles; } - export type CssStyles = { [key: string]: string | number }; - export interface RadioCardGroupComponentProperties extends ComponentProperties, TitledComponentProperties { cards: RadioCard[]; cardWidth: string; diff --git a/src/sql/workbench/browser/modelComponents/divContainer.component.ts b/src/sql/workbench/browser/modelComponents/divContainer.component.ts index 35b566a7f7..e043cd55d6 100644 --- a/src/sql/workbench/browser/modelComponents/divContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/divContainer.component.ts @@ -153,7 +153,7 @@ export default class DivContainer extends ContainerBase ` }) -export default class FlexContainer extends ContainerBase implements IComponent, OnDestroy { +export default class FlexContainer extends ContainerBase implements IComponent, OnDestroy { @Input() descriptor: IComponentDescriptor; @Input() modelStore: IModelStore; private _flexFlow: string; @@ -65,7 +65,7 @@ export default class FlexContainer extends ContainerBase impleme /// IComponent implementation - public setLayout(layout: FlexLayout): void { + public setLayout(layout: azdata.FlexLayout): void { this._flexFlow = layout.flexFlow ? layout.flexFlow : ''; this._justifyContent = layout.justifyContent ? layout.justifyContent : ''; this._alignItems = layout.alignItems ? layout.alignItems : ''; @@ -122,7 +122,7 @@ export default class FlexContainer extends ContainerBase impleme public getItemOrder(item: FlexItem): number { return item.config ? item.config.order : 0; } - public getItemStyles(item: FlexItem): { [key: string]: string } { + public getItemStyles(item: FlexItem): azdata.CssStyles { return item.config && item.config.CSSStyles ? item.config.CSSStyles : {}; } } diff --git a/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts b/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts index e2036973c4..846c85fd04 100644 --- a/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts +++ b/src/sql/workbench/browser/modelComponents/splitviewContainer.component.ts @@ -168,7 +168,7 @@ export default class SplitViewContainerImpl extends ContainerBase