From b550905ad79af4c6b3eac2f832d3ef8769ce9c54 Mon Sep 17 00:00:00 2001 From: Hawk Ticehurst Date: Tue, 28 Dec 2021 16:03:32 -0800 Subject: [PATCH 1/3] Add missing type info to component registration functions --- src/badge/index.ts | 6 +++++- src/button/index.ts | 2 +- src/checkbox/index.ts | 5 ++++- src/data-grid/index.ts | 16 +++++++++++++--- src/divider/index.ts | 6 +++++- src/dropdown/index.ts | 5 ++++- src/link/index.ts | 2 +- src/option/index.ts | 2 +- src/panels/index.ts | 16 +++++++++++++--- src/progress-ring/index.ts | 5 ++++- src/radio-group/index.ts | 6 +++++- src/radio/index.ts | 2 +- src/tag/index.ts | 3 ++- src/text-area/index.ts | 3 ++- src/text-field/index.ts | 5 ++++- 15 files changed, 65 insertions(+), 19 deletions(-) diff --git a/src/badge/index.ts b/src/badge/index.ts index b1cffbdb..de50450f 100644 --- a/src/badge/index.ts +++ b/src/badge/index.ts @@ -3,6 +3,7 @@ import { Badge as FoundationBadge, + FoundationElementDefinition, badgeTemplate as template, } from '@microsoft/fast-foundation'; import {badgeStyles as styles} from './badge.styles'; @@ -39,7 +40,10 @@ export class Badge extends FoundationBadge { * * @public */ -export const vsCodeBadge = Badge.compose({ +export const vsCodeBadge = Badge.compose< + FoundationElementDefinition, + typeof Badge +>({ baseName: 'badge', template, styles, diff --git a/src/button/index.ts b/src/button/index.ts index dac25db7..a208bc5b 100644 --- a/src/button/index.ts +++ b/src/button/index.ts @@ -93,7 +93,7 @@ export class Button extends FoundationButton { * * @public */ -export const vsCodeButton = Button.compose({ +export const vsCodeButton = Button.compose({ baseName: 'button', template, styles, diff --git a/src/checkbox/index.ts b/src/checkbox/index.ts index 8b03f2ab..c24bed9b 100644 --- a/src/checkbox/index.ts +++ b/src/checkbox/index.ts @@ -39,7 +39,10 @@ export class Checkbox extends FoundationCheckbox { * * @public */ -export const vsCodeCheckbox = Checkbox.compose({ +export const vsCodeCheckbox = Checkbox.compose< + CheckboxOptions, + typeof Checkbox +>({ baseName: 'checkbox', template, styles, diff --git a/src/data-grid/index.ts b/src/data-grid/index.ts index 383fc711..3a76b498 100644 --- a/src/data-grid/index.ts +++ b/src/data-grid/index.ts @@ -6,6 +6,7 @@ import { DataGrid as FoundationDataGrid, DataGridCell as FoundationDataGridCell, DataGridRow as FoundationDataGridRow, + FoundationElementDefinition, dataGridTemplate as gridTemplate, dataGridRowTemplate as rowTemplate, } from '@microsoft/fast-foundation'; @@ -45,7 +46,10 @@ export class DataGrid extends FoundationDataGrid { * * @public */ -export const vsCodeDataGrid = DataGrid.compose({ +export const vsCodeDataGrid = DataGrid.compose< + FoundationElementDefinition, + typeof DataGrid +>({ baseName: 'data-grid', baseClass: FoundationDataGrid, template: gridTemplate, @@ -67,7 +71,10 @@ export class DataGridRow extends FoundationDataGridRow {} * * @public */ -export const vsCodeDataGridRow = DataGridRow.compose({ +export const vsCodeDataGridRow = DataGridRow.compose< + FoundationElementDefinition, + typeof DataGridRow +>({ baseName: 'data-grid-row', baseClass: FoundationDataGridRow, template: rowTemplate, @@ -89,7 +96,10 @@ export class DataGridCell extends FoundationDataGridCell {} * * @public */ -export const vsCodeDataGridCell = DataGridCell.compose({ +export const vsCodeDataGridCell = DataGridCell.compose< + FoundationElementDefinition, + typeof DataGridCell +>({ baseName: 'data-grid-cell', baseClass: FoundationDataGridCell, template: cellTemplate, diff --git a/src/divider/index.ts b/src/divider/index.ts index 6819ccf1..cd9f0855 100644 --- a/src/divider/index.ts +++ b/src/divider/index.ts @@ -3,6 +3,7 @@ import { Divider as FoundationDivider, + FoundationElementDefinition, dividerTemplate as template, } from '@microsoft/fast-foundation'; import {dividerStyles as styles} from './divider.styles'; @@ -22,7 +23,10 @@ export class Divider extends FoundationDivider {} * * @public */ -export const vsCodeDivider = Divider.compose({ +export const vsCodeDivider = Divider.compose< + FoundationElementDefinition, + typeof Divider +>({ baseName: 'divider', template, styles, diff --git a/src/dropdown/index.ts b/src/dropdown/index.ts index 33ff89ec..f6e7cdb6 100644 --- a/src/dropdown/index.ts +++ b/src/dropdown/index.ts @@ -29,7 +29,10 @@ export class Dropdown extends FoundationSelect {} * * @public */ -export const vsCodeDropdown = Dropdown.compose({ +export const vsCodeDropdown = Dropdown.compose< + DropdownOptions, + typeof Dropdown +>({ baseName: 'dropdown', template, styles, diff --git a/src/link/index.ts b/src/link/index.ts index 19b18b17..ecf1b396 100644 --- a/src/link/index.ts +++ b/src/link/index.ts @@ -29,7 +29,7 @@ export class Link extends FoundationAnchor {} * * @public */ -export const vsCodeLink = Link.compose({ +export const vsCodeLink = Link.compose({ baseName: 'link', template, styles, diff --git a/src/option/index.ts b/src/option/index.ts index 166d3fe3..4fcd789e 100644 --- a/src/option/index.ts +++ b/src/option/index.ts @@ -45,7 +45,7 @@ export class Option extends FoundationListboxOption { * * @public */ -export const vsCodeOption = Option.compose({ +export const vsCodeOption = Option.compose({ baseName: 'option', template, styles, diff --git a/src/panels/index.ts b/src/panels/index.ts index c91cfe60..8b5ed764 100644 --- a/src/panels/index.ts +++ b/src/panels/index.ts @@ -2,6 +2,7 @@ // Licensed under the MIT License. import { + FoundationElementDefinition, Tab as FoundationTab, TabPanel as FoundationTabPanel, Tabs as FoundationTabs, @@ -53,7 +54,10 @@ export class Panels extends FoundationTabs { * * @public */ -export const vsCodePanels = Panels.compose({ +export const vsCodePanels = Panels.compose< + FoundationElementDefinition, + typeof Panels +>({ baseName: 'panels', template: tabsTemplate, styles: panelsStyles, @@ -95,7 +99,10 @@ export class PanelTab extends FoundationTab { * * @public */ -export const vsCodePanelTab = PanelTab.compose({ +export const vsCodePanelTab = PanelTab.compose< + FoundationElementDefinition, + typeof PanelTab +>({ baseName: 'panel-tab', template: tabTemplate, styles: panelTabStyles, @@ -116,7 +123,10 @@ export class PanelView extends FoundationTabPanel {} * * @public */ -export const vsCodePanelView = PanelView.compose({ +export const vsCodePanelView = PanelView.compose< + FoundationElementDefinition, + typeof PanelView +>({ baseName: 'panel-view', template: tabPanelTemplate, styles: panelViewStyles, diff --git a/src/progress-ring/index.ts b/src/progress-ring/index.ts index 5693eced..d51730ad 100644 --- a/src/progress-ring/index.ts +++ b/src/progress-ring/index.ts @@ -69,7 +69,10 @@ export class ProgressRing extends BaseProgress { * * @public */ -export const vsCodeProgressRing = ProgressRing.compose({ +export const vsCodeProgressRing = ProgressRing.compose< + ProgressRingOptions, + typeof ProgressRing +>({ baseName: 'progress-ring', template, styles, diff --git a/src/radio-group/index.ts b/src/radio-group/index.ts index 2ce9c57e..e29bcc2c 100644 --- a/src/radio-group/index.ts +++ b/src/radio-group/index.ts @@ -2,6 +2,7 @@ // Licensed under the MIT License. import { + FoundationElementDefinition, RadioGroup as FoundationRadioGroup, radioGroupTemplate as template, } from '@microsoft/fast-foundation'; @@ -40,7 +41,10 @@ export class RadioGroup extends FoundationRadioGroup { * * @public */ -export const vsCodeRadioGroup = RadioGroup.compose({ +export const vsCodeRadioGroup = RadioGroup.compose< + FoundationElementDefinition, + typeof RadioGroup +>({ baseName: 'radio-group', template, styles, diff --git a/src/radio/index.ts b/src/radio/index.ts index 2e983ba2..da0261dc 100644 --- a/src/radio/index.ts +++ b/src/radio/index.ts @@ -39,7 +39,7 @@ export class Radio extends FoundationRadio { * * @public */ -export const vsCodeRadio = Radio.compose({ +export const vsCodeRadio = Radio.compose({ baseName: 'radio', template, styles, diff --git a/src/tag/index.ts b/src/tag/index.ts index d85c6504..5eb53303 100644 --- a/src/tag/index.ts +++ b/src/tag/index.ts @@ -3,6 +3,7 @@ import { Badge as FoundationBadge, + FoundationElementDefinition, badgeTemplate as template, } from '@microsoft/fast-foundation'; import {tagStyles as styles} from './tag.styles'; @@ -39,7 +40,7 @@ export class Tag extends FoundationBadge { * * @public */ -export const vsCodeTag = Tag.compose({ +export const vsCodeTag = Tag.compose({ baseName: 'tag', template, styles, diff --git a/src/text-area/index.ts b/src/text-area/index.ts index 7bf0e16e..decb80d4 100644 --- a/src/text-area/index.ts +++ b/src/text-area/index.ts @@ -2,6 +2,7 @@ // Licensed under the MIT License. import { + FoundationElementDefinition, TextArea as FoundationTextArea, textAreaTemplate as template, } from '@microsoft/fast-foundation'; @@ -41,7 +42,7 @@ export class TextArea extends FoundationTextArea { * * @public */ -export const vsCodeTextArea = TextArea.compose({ +export const vsCodeTextArea = TextArea.compose({ baseName: 'text-area', template, styles, diff --git a/src/text-field/index.ts b/src/text-field/index.ts index 54354f69..1bd34686 100644 --- a/src/text-field/index.ts +++ b/src/text-field/index.ts @@ -39,7 +39,10 @@ export class TextField extends FoundationTextField { * * @public */ -export const vsCodeTextField = TextField.compose({ +export const vsCodeTextField = TextField.compose< + TextFieldOptions, + typeof TextField +>({ baseName: 'text-field', template, styles, From 4cb71a1ba4cbc0d6c0b8a1e9a543daa6c9eda68d Mon Sep 17 00:00:00 2001 From: Hawk Ticehurst Date: Tue, 28 Dec 2021 16:03:40 -0800 Subject: [PATCH 2/3] Regenerate API report --- docs/api-report.md | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/docs/api-report.md b/docs/api-report.md index ec57ebb7..c1628f8f 100644 --- a/docs/api-report.md +++ b/docs/api-report.md @@ -12,14 +12,12 @@ import { Button as Button_2 } from '@microsoft/fast-foundation'; import { ButtonOptions } from '@microsoft/fast-foundation'; import { Checkbox as Checkbox_2 } from '@microsoft/fast-foundation'; import { CheckboxOptions } from '@microsoft/fast-foundation'; -import { Constructable } from '@microsoft/fast-element'; import type { Container } from '@microsoft/fast-foundation'; import { DataGrid as DataGrid_2 } from '@microsoft/fast-foundation'; import { DataGridCell as DataGridCell_2 } from '@microsoft/fast-foundation'; import { DataGridRow as DataGridRow_2 } from '@microsoft/fast-foundation'; import { DesignSystem } from '@microsoft/fast-foundation'; import { Divider as Divider_2 } from '@microsoft/fast-foundation'; -import { FoundationElement } from '@microsoft/fast-foundation'; import { FoundationElementDefinition } from '@microsoft/fast-foundation'; import { FoundationElementRegistry } from '@microsoft/fast-foundation'; import { ListboxOption } from '@microsoft/fast-foundation'; @@ -41,24 +39,24 @@ import { TextFieldOptions } from '@microsoft/fast-foundation'; // @public export const allComponents: { vsCodeBadge: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; - vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; - vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; + vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; + vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodeDataGrid: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodeDataGridCell: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodeDataGridRow: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodeDivider: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; - vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; - vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; - vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; + vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; + vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; + vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodePanels: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodePanelTab: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodePanelView: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; - vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; + vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodeRadioGroup: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; - vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; + vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodeTag: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; vsCodeTextArea: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; - vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; + vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; register(container?: Container | undefined, ...rest: any[]): void; }; @@ -189,10 +187,10 @@ export class TextField extends TextField_2 { export const vsCodeBadge: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public export const vsCodeDataGrid: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; @@ -207,13 +205,13 @@ export const vsCodeDataGridRow: (overrideDefinition?: OverrideFoundationElementD export const vsCodeDivider: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public export const vsCodePanels: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; @@ -225,10 +223,10 @@ export const vsCodePanelTab: (overrideDefinition?: OverrideFoundationElementDefi export const vsCodePanelView: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public export const vsCodeRadioGroup: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; @@ -240,7 +238,7 @@ export const vsCodeTag: (overrideDefinition?: OverrideFoundationElementDefinitio export const vsCodeTextArea: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // @public -export const vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry>; +export const vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition | undefined) => FoundationElementRegistry; // (No @packageDocumentation comment for this package) From 6c4e4b1668095cc10072a192f5ae59fa1bb36cb3 Mon Sep 17 00:00:00 2001 From: Hawk Ticehurst Date: Tue, 28 Dec 2021 16:11:10 -0800 Subject: [PATCH 3/3] Fix formatting error --- src/text-area/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/text-area/index.ts b/src/text-area/index.ts index decb80d4..ea290fe6 100644 --- a/src/text-area/index.ts +++ b/src/text-area/index.ts @@ -42,7 +42,10 @@ export class TextArea extends FoundationTextArea { * * @public */ -export const vsCodeTextArea = TextArea.compose({ +export const vsCodeTextArea = TextArea.compose< + FoundationElementDefinition, + typeof TextArea +>({ baseName: 'text-area', template, styles,