dohomi / storyblok-generate-ts

Generates TypeScript interface types based on Storyblok component file
MIT License
102 stars 32 forks source link

Typed groups? #70

Open combi-35 opened 4 months ago

combi-35 commented 4 months ago

Hi, within storyblok you can create fields of type group. The group itself becomes a property of the defintion.

For example, I created a group colors and would like to have all colors inside there like primary, secondary. So far colors is exported as a field with type any. Bildschirmfoto 2024-04-26 um 11 19 09

I would like to access thoose properties with colors.primary and not just primary. Is this somehow possible?

dohomi commented 4 months ago

I think you'd extend your TS with overwriting the colors similar to this approach: https://github.com/dohomi/storyblok-generate-ts?tab=readme-ov-file#resolve-relations