Skip to content

Commit

Permalink
Add GlobalStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Jan 3, 2025
1 parent 5a09cec commit 1f5bd67
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/core-data/src/dynamic-entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type * as ET from './entity-types';

export type WPEntityTypes< C extends ET.Context = 'edit' > = {
Comment: ET.Comment< C >;
GlobalStyles: ET.GlobalStylesRevision< C >;
Media: ET.Attachment< C >;
Menu: ET.NavMenu< C >;
MenuItem: ET.NavMenuItem< C >;
Expand All @@ -32,7 +33,9 @@ export type WPEntityTypes< C extends ET.Context = 'edit' > = {
* - "media" to "mediaItems"
* - "status" to "statuses"
*/
type PluralizeEntity< T extends string > = T extends 'Media'
type PluralizeEntity< T extends string > = T extends 'GlobalStyles'
? 'GlobalStylesVariations'
: T extends 'Media'
? 'MediaItems'
: T extends 'Status'
? 'Statuses'
Expand All @@ -49,7 +52,9 @@ type PluralizeEntity< T extends string > = T extends 'Media'
* - "mediaItems" to "media"
* - "statuses" to "status"
*/
type SingularizeEntity< T extends string > = T extends 'MediaItems'
type SingularizeEntity< T extends string > = T extends 'GlobalStylesVariations'
? 'GlobalStyles'
: T extends 'MediaItems'
? 'Media'
: T extends 'Statuses'
? 'Status'
Expand Down

0 comments on commit 1f5bd67

Please sign in to comment.