storyblok-generate-ts icon indicating copy to clipboard operation
storyblok-generate-ts copied to clipboard

Consider extending `SbBlokData` for all blok-types

Open jsve opened this issue 7 months ago • 1 comments

At the moment there is no generic way to declare responses from the storyblok API. I'm declaring the response of useStoryblokApi().get() as StoryblokStory. More appropriate would be StoryblokStory<SbBlokData>, however there is nothing saying that all the generated types match SbBlokData.

Does adding extends SbBlokData to all generated types make sense? If so, please consider adding it. This would also mean that all generated interfaces does no longer need to declare _uid and [k:string] anymore.

jsve avatar Jan 15 '24 14:01 jsve

If there are some new types from Storyblok itself we can use I am happy to review a PR. This library was written in a time where Storyblok didn't deliver any consumable types.

dohomi avatar Feb 27 '24 00:02 dohomi