-
Notifications
You must be signed in to change notification settings - Fork 12
feat: add content type generic for guide step content #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add content type generic for guide step content #722
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ef48f6c to
c3a5cdc
Compare
| // | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| export type Any = any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if unknown is better than any here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was on the fence about that but decided to keep it as any for this PR. I understand unknown is considered a "safer" choice, but I'm afraid it would end up adding a lot of boilerplate/annoyance in practice..
Besides, it was initially typed as any so switching to unknown here would technically be a breaking change? I'm definitely open to the idea, but I suspect it's better handled as a separate version if we do decide to make that change.
dc794ae to
0907b4e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #722 +/- ##
==========================================
+ Coverage 63.73% 63.74% +0.01%
==========================================
Files 185 185
Lines 7450 7458 +8
Branches 879 879
==========================================
+ Hits 4748 4754 +6
- Misses 2676 2678 +2
Partials 26 26
|

Description
Adds a generic type parameter for typing guide step contents, which users can pass in when using the
useGuide(s)hooks or calling theselecteGuide(s)methods in the guide client.Note, there is a corresponding CLI PR (knocklabs/knock-cli#575) to add a new
knock guide generate-typescommand which generates types for all guides in a given environment automatically.