dohomi / storyblok-generate-ts

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

[hotfix] Update types for `StoryblokStory` #37

Closed snikidev closed 1 year ago

snikidev commented 1 year ago

Issue

When using useStoryblokState, the hook expects story to have types of ISbStoryData which definition you can find in storyblok-js-client package in storyblok-js-client/dist/types/interfaces.d.ts. And StoryblokStory deviates in only 2 properties: parent_id and paths.

Quick Solution

We do what I did in this PR.

Better (?) Solution

We install storyblok-js-client and extends ISbStoryData interface. 🤷

dohomi commented 1 year ago

@snikidev thanks for your hotfix - I rather don't grab external types - if the changes are this rare I rather keep the dependency tree as small as possible