Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing type info in component registration functions #308

Merged
merged 3 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions docs/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -41,24 +39,24 @@ import { TextFieldOptions } from '@microsoft/fast-foundation';
// @public
export const allComponents: {
vsCodeBadge: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof Badge>;
vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition<ButtonOptions> | undefined) => FoundationElementRegistry<ButtonOptions, Constructable<FoundationElement>>;
vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition<CheckboxOptions> | undefined) => FoundationElementRegistry<CheckboxOptions, Constructable<FoundationElement>>;
vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition<ButtonOptions> | undefined) => FoundationElementRegistry<ButtonOptions, typeof Button>;
vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition<CheckboxOptions> | undefined) => FoundationElementRegistry<CheckboxOptions, typeof Checkbox>;
vsCodeDataGrid: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof DataGrid>;
vsCodeDataGridCell: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof DataGridCell>;
vsCodeDataGridRow: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof DataGridRow>;
vsCodeDivider: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof Divider>;
vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition<SelectOptions> | undefined) => FoundationElementRegistry<SelectOptions, Constructable<FoundationElement>>;
vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition<AnchorOptions> | undefined) => FoundationElementRegistry<AnchorOptions, Constructable<FoundationElement>>;
vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition<ListboxOptionOptions> | undefined) => FoundationElementRegistry<ListboxOptionOptions, Constructable<FoundationElement>>;
vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition<SelectOptions> | undefined) => FoundationElementRegistry<SelectOptions, typeof Dropdown>;
vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition<AnchorOptions> | undefined) => FoundationElementRegistry<AnchorOptions, typeof Link>;
vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition<ListboxOptionOptions> | undefined) => FoundationElementRegistry<ListboxOptionOptions, typeof Option_2>;
vsCodePanels: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof Panels>;
vsCodePanelTab: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof PanelTab>;
vsCodePanelView: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof PanelView>;
vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition<ProgressRingOptions> | undefined) => FoundationElementRegistry<ProgressRingOptions, Constructable<FoundationElement>>;
vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition<ProgressRingOptions> | undefined) => FoundationElementRegistry<ProgressRingOptions, typeof ProgressRing>;
vsCodeRadioGroup: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof RadioGroup>;
vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition<RadioOptions> | undefined) => FoundationElementRegistry<RadioOptions, Constructable<FoundationElement>>;
vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition<RadioOptions> | undefined) => FoundationElementRegistry<RadioOptions, typeof Radio>;
vsCodeTag: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof Tag>;
vsCodeTextArea: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof TextArea>;
vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition<TextFieldOptions> | undefined) => FoundationElementRegistry<TextFieldOptions, Constructable<FoundationElement>>;
vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition<TextFieldOptions> | undefined) => FoundationElementRegistry<TextFieldOptions, typeof TextField>;
register(container?: Container | undefined, ...rest: any[]): void;
};

Expand Down Expand Up @@ -189,10 +187,10 @@ export class TextField extends TextField_2 {
export const vsCodeBadge: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof Badge>;

// @public
export const vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition<ButtonOptions> | undefined) => FoundationElementRegistry<ButtonOptions, Constructable<FoundationElement>>;
export const vsCodeButton: (overrideDefinition?: OverrideFoundationElementDefinition<ButtonOptions> | undefined) => FoundationElementRegistry<ButtonOptions, typeof Button>;

// @public
export const vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition<CheckboxOptions> | undefined) => FoundationElementRegistry<CheckboxOptions, Constructable<FoundationElement>>;
export const vsCodeCheckbox: (overrideDefinition?: OverrideFoundationElementDefinition<CheckboxOptions> | undefined) => FoundationElementRegistry<CheckboxOptions, typeof Checkbox>;

// @public
export const vsCodeDataGrid: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof DataGrid>;
Expand All @@ -207,13 +205,13 @@ export const vsCodeDataGridRow: (overrideDefinition?: OverrideFoundationElementD
export const vsCodeDivider: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof Divider>;

// @public
export const vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition<SelectOptions> | undefined) => FoundationElementRegistry<SelectOptions, Constructable<FoundationElement>>;
export const vsCodeDropdown: (overrideDefinition?: OverrideFoundationElementDefinition<SelectOptions> | undefined) => FoundationElementRegistry<SelectOptions, typeof Dropdown>;

// @public
export const vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition<AnchorOptions> | undefined) => FoundationElementRegistry<AnchorOptions, Constructable<FoundationElement>>;
export const vsCodeLink: (overrideDefinition?: OverrideFoundationElementDefinition<AnchorOptions> | undefined) => FoundationElementRegistry<AnchorOptions, typeof Link>;

// @public
export const vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition<ListboxOptionOptions> | undefined) => FoundationElementRegistry<ListboxOptionOptions, Constructable<FoundationElement>>;
export const vsCodeOption: (overrideDefinition?: OverrideFoundationElementDefinition<ListboxOptionOptions> | undefined) => FoundationElementRegistry<ListboxOptionOptions, typeof Option_2>;

// @public
export const vsCodePanels: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof Panels>;
Expand All @@ -225,10 +223,10 @@ export const vsCodePanelTab: (overrideDefinition?: OverrideFoundationElementDefi
export const vsCodePanelView: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof PanelView>;

// @public
export const vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition<ProgressRingOptions> | undefined) => FoundationElementRegistry<ProgressRingOptions, Constructable<FoundationElement>>;
export const vsCodeProgressRing: (overrideDefinition?: OverrideFoundationElementDefinition<ProgressRingOptions> | undefined) => FoundationElementRegistry<ProgressRingOptions, typeof ProgressRing>;

// @public
export const vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition<RadioOptions> | undefined) => FoundationElementRegistry<RadioOptions, Constructable<FoundationElement>>;
export const vsCodeRadio: (overrideDefinition?: OverrideFoundationElementDefinition<RadioOptions> | undefined) => FoundationElementRegistry<RadioOptions, typeof Radio>;

// @public
export const vsCodeRadioGroup: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof RadioGroup>;
Expand All @@ -240,7 +238,7 @@ export const vsCodeTag: (overrideDefinition?: OverrideFoundationElementDefinitio
export const vsCodeTextArea: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => FoundationElementRegistry<FoundationElementDefinition, typeof TextArea>;

// @public
export const vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition<TextFieldOptions> | undefined) => FoundationElementRegistry<TextFieldOptions, Constructable<FoundationElement>>;
export const vsCodeTextField: (overrideDefinition?: OverrideFoundationElementDefinition<TextFieldOptions> | undefined) => FoundationElementRegistry<TextFieldOptions, typeof TextField>;

// (No @packageDocumentation comment for this package)

Expand Down
6 changes: 5 additions & 1 deletion src/badge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import {
Badge as FoundationBadge,
FoundationElementDefinition,
badgeTemplate as template,
} from '@microsoft/fast-foundation';
import {badgeStyles as styles} from './badge.styles';
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class Button extends FoundationButton {
*
* @public
*/
export const vsCodeButton = Button.compose<ButtonOptions>({
export const vsCodeButton = Button.compose<ButtonOptions, typeof Button>({
baseName: 'button',
template,
styles,
Expand Down
5 changes: 4 additions & 1 deletion src/checkbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export class Checkbox extends FoundationCheckbox {
*
* @public
*/
export const vsCodeCheckbox = Checkbox.compose<CheckboxOptions>({
export const vsCodeCheckbox = Checkbox.compose<
CheckboxOptions,
typeof Checkbox
>({
baseName: 'checkbox',
template,
styles,
Expand Down
16 changes: 13 additions & 3 deletions src/data-grid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion src/divider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import {
Divider as FoundationDivider,
FoundationElementDefinition,
dividerTemplate as template,
} from '@microsoft/fast-foundation';
import {dividerStyles as styles} from './divider.styles';
Expand All @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion src/dropdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export class Dropdown extends FoundationSelect {}
*
* @public
*/
export const vsCodeDropdown = Dropdown.compose<DropdownOptions>({
export const vsCodeDropdown = Dropdown.compose<
DropdownOptions,
typeof Dropdown
>({
baseName: 'dropdown',
template,
styles,
Expand Down
2 changes: 1 addition & 1 deletion src/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class Link extends FoundationAnchor {}
*
* @public
*/
export const vsCodeLink = Link.compose<LinkOptions>({
export const vsCodeLink = Link.compose<LinkOptions, typeof Link>({
baseName: 'link',
template,
styles,
Expand Down
2 changes: 1 addition & 1 deletion src/option/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class Option extends FoundationListboxOption {
*
* @public
*/
export const vsCodeOption = Option.compose<OptionOptions>({
export const vsCodeOption = Option.compose<OptionOptions, typeof Option>({
baseName: 'option',
template,
styles,
Expand Down
16 changes: 13 additions & 3 deletions src/panels/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

import {
FoundationElementDefinition,
Tab as FoundationTab,
TabPanel as FoundationTabPanel,
Tabs as FoundationTabs,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion src/progress-ring/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ export class ProgressRing extends BaseProgress {
*
* @public
*/
export const vsCodeProgressRing = ProgressRing.compose<ProgressRingOptions>({
export const vsCodeProgressRing = ProgressRing.compose<
ProgressRingOptions,
typeof ProgressRing
>({
baseName: 'progress-ring',
template,
styles,
Expand Down
6 changes: 5 additions & 1 deletion src/radio-group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

import {
FoundationElementDefinition,
RadioGroup as FoundationRadioGroup,
radioGroupTemplate as template,
} from '@microsoft/fast-foundation';
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/radio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Radio extends FoundationRadio {
*
* @public
*/
export const vsCodeRadio = Radio.compose<RadioOptions>({
export const vsCodeRadio = Radio.compose<RadioOptions, typeof Radio>({
baseName: 'radio',
template,
styles,
Expand Down
3 changes: 2 additions & 1 deletion src/tag/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import {
Badge as FoundationBadge,
FoundationElementDefinition,
badgeTemplate as template,
} from '@microsoft/fast-foundation';
import {tagStyles as styles} from './tag.styles';
Expand Down Expand Up @@ -39,7 +40,7 @@ export class Tag extends FoundationBadge {
*
* @public
*/
export const vsCodeTag = Tag.compose({
export const vsCodeTag = Tag.compose<FoundationElementDefinition, typeof Tag>({
baseName: 'tag',
template,
styles,
Expand Down
6 changes: 5 additions & 1 deletion src/text-area/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

import {
FoundationElementDefinition,
TextArea as FoundationTextArea,
textAreaTemplate as template,
} from '@microsoft/fast-foundation';
Expand Down Expand Up @@ -41,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,
Expand Down
5 changes: 4 additions & 1 deletion src/text-field/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export class TextField extends FoundationTextField {
*
* @public
*/
export const vsCodeTextField = TextField.compose<TextFieldOptions>({
export const vsCodeTextField = TextField.compose<
TextFieldOptions,
typeof TextField
>({
baseName: 'text-field',
template,
styles,
Expand Down