Skip to content

Commit

Permalink
Changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Jan 16, 2025
1 parent 9f40a53 commit 29fba55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions packages/perseus-core/src/data-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,18 @@ export interface PerseusWidgetTypes {
*/
export type PerseusWidgetsMap = MakeWidgetMap<PerseusWidgetTypes>;

/**
* PerseusWidget is a union of all the different types of widget options that
* Perseus knows about.
*
* Thanks to it being based on PerseusWidgetTypes interface, this union is
* automatically extended to include widgets used in tests without those widget
* option types seeping into our production types.
*
* @see MockWidget for an example
*/
export type PerseusWidget = PerseusWidgetTypes[keyof PerseusWidgetTypes];

/**
* A "PerseusItem" is a classic Perseus item. It is rendered by the
* `ServerItemRenderer` and the layout is pre-set.
Expand Down Expand Up @@ -377,8 +389,6 @@ export type VideoWidget = WidgetOptions<'video', PerseusVideoWidgetOptions>;
//prettier-ignore
export type DeprecatedStandinWidget = WidgetOptions<'deprecated-standin', object>;

export type PerseusWidget = PerseusWidgetTypes[keyof PerseusWidgetTypes];

/**
* A background image applied to various widgets.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/perseus/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const MafsGraphTypeFlags = [
/**
* APIOptions provides different ways to customize the behaviour of Perseus.
*
* @see APIOptionsWithDefaults
* @see {@link APIOptionsWithDefaults}
*/
export type APIOptions = Readonly<{
isArticle?: boolean;
Expand Down

0 comments on commit 29fba55

Please sign in to comment.