-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: generate types from JSDoc #377
Conversation
Was removed in v5
@@ -91,15 +121,15 @@ export default class PodiumClient extends EventEmitter { | |||
}); | |||
|
|||
this.#metrics = new Metrics(); | |||
this.#metrics.on('error', error => { | |||
this.#metrics.on('error', (error) => { | |||
log.error( | |||
'Error emitted by metric stream in @podium/client module', | |||
error, | |||
); | |||
}); | |||
|
|||
this[Symbol.iterator] = () => ({ |
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 don't think this Symbol.iterator
API is possible to type
@@ -227,6 +252,7 @@ export default class PodletClientContentResolver { | |||
if (outgoing.redirectable && statusCode >= 300) { | |||
outgoing.redirect = { | |||
statusCode, | |||
// @ts-expect-error TODO: look into what happens if the podlet returns more than one location header |
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.
TS highlighted this as a potential error, but I didn't want to make a decision there now
|
||
/** | ||
* Filter assets array based on scope. | ||
* If scope property is not present, asset will be included (backwards compatibility) | ||
* If scope property is set to "all", asset will be included. | ||
* If scope is set to "content" and asset scope property is set to "fallback", asset will not be included | ||
* If scope is set to "fallback" and asset scope property is set to "content", asset will not be included | ||
* @template {import("@podium/utils").AssetCss | import("@podium/utils").AssetJs} T[] |
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.
Replaced with generics so the type is kept untouched on the Response
class itself
Tested with local linking via |
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.
lgtm 👍
Reexport some types that were missing from the client export
🎉 This PR is included in version 5.0.21 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Expand the typing/JSDoc internally in the module as well