kontent-ai / model-generator-js

MIT License
13 stars 9 forks source link

Types for Linked Elements #21

Closed furmandev closed 2 years ago

furmandev commented 2 years ago

Is there any way to generate types for linked elements? (when the linked elements are restricted to a certain type or types). Currently we are doing:

Movie.elements.stars.linkedItems as Actor[]

I think maybe what we would like is for the generated model to look like:

export type Movie = IContentItem<{
  stars: Elements.LinkedItemsElement<Actor>;
}>;
Enngage commented 2 years ago

Hey @furmandev,

This has been implemented in the latest version ;)