Skip to content

Commit

Permalink
leverage ValuesOf type helper
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdholt committed Jan 12, 2023
1 parent 4a20b5a commit 18ec7f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 5 additions & 4 deletions packages/web-components/docs/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ElementStyles } from '@microsoft/fast-element';
import { ElementViewTemplate } from '@microsoft/fast-element';
import { FASTElement } from '@microsoft/fast-element';
import { FASTElementDefinition } from '@microsoft/fast-element';
import { ValuesOf } from '@microsoft/fast-foundation';

// @public
class Text_2 extends FASTElement {
Expand All @@ -33,7 +34,7 @@ export const TextAlign: {
};

// @public
export type TextAlign = typeof TextAlign[keyof typeof TextAlign];
export type TextAlign = ValuesOf<typeof TextAlign>;

// @public
export const TextDefinition: FASTElementDefinition<typeof Text_2>;
Expand All @@ -46,7 +47,7 @@ export const TextFont: {
};

// @public
export type TextFont = typeof TextFont[keyof typeof TextFont];
export type TextFont = ValuesOf<typeof TextFont>;

// @public
export const TextSize: {
Expand All @@ -63,7 +64,7 @@ export const TextSize: {
};

// @public
export type TextSize = typeof TextSize[keyof typeof TextSize];
export type TextSize = ValuesOf<typeof TextSize>;

// @public
export const TextStyles: ElementStyles;
Expand All @@ -82,7 +83,7 @@ export const TextWeight: {
};

// @public
export type TextWeight = typeof TextWeight[keyof typeof TextWeight];
export type TextWeight = ValuesOf<typeof TextWeight>;

// (No @packageDocumentation comment for this package)

Expand Down
10 changes: 6 additions & 4 deletions packages/web-components/src/text/text.options.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ValuesOf } from '@microsoft/fast-foundation';

/**
* TextSize constants
* @public
Expand All @@ -20,7 +22,7 @@ export const TextSize = {
* The font size and line height based on the theme tokens
* @public
*/
export type TextSize = typeof TextSize[keyof typeof TextSize];
export type TextSize = ValuesOf<typeof TextSize>;

/**
* TextFont Constants
Expand All @@ -36,7 +38,7 @@ export const TextFont = {
* Applies font family to the content
* @public
*/
export type TextFont = typeof TextFont[keyof typeof TextFont];
export type TextFont = ValuesOf<typeof TextFont>;

/**
* TextWeight Constants
Expand All @@ -53,7 +55,7 @@ export const TextWeight = {
* Applies font weight to the content
* @public
*/
export type TextWeight = typeof TextWeight[keyof typeof TextWeight];
export type TextWeight = ValuesOf<typeof TextWeight>;

/**
* TextAlign Constants
Expand All @@ -70,4 +72,4 @@ export const TextAlign = {
* Aligns the content
* @public
*/
export type TextAlign = typeof TextAlign[keyof typeof TextAlign];
export type TextAlign = ValuesOf<typeof TextAlign>;

0 comments on commit 18ec7f8

Please sign in to comment.