Skip to content
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: Decoded Message Types #552

Merged
merged 1 commit into from
Dec 3, 2024
Merged

feat: Decoded Message Types #552

merged 1 commit into from
Dec 3, 2024

Conversation

alexrisch
Copy link
Contributor

Please enjoy this Thanksgiving Gif

Improved Decoded Message types and returns from listing
Added DecodedMessageUnion utility type to manage returned values from list methods
Added more type tests to help check against type usage

One callout is to really make types work I am using as const for the codecs, I did this rather than requiring readonly array of codecs. This means integrators can still dynamically create codecs but still use types, but this is only needed for the initial type inferencing if done by the client

Improved Decoded Message types and returns from listing
Added DecodedMessageUnion utility type to manage returned values from list methods
Added more type tests to help check against type usage
@alexrisch alexrisch requested a review from a team as a code owner November 28, 2024 13:07
},
{ contentType: ContentTypeNumber }
}
// { contentType: ContentTypeNumber }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were already failing, V3 related I believe

@@ -21,6 +21,7 @@ export enum MessageDeliveryStatus {
}

export class DecodedMessage<
ContentType extends DefaultContentTypes[number] = DefaultContentTypes[number],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could have a type for DefaultContentTypes[number] like
export type DefaultContentType = DefaultContentTypes[number]

since we use it a lot

@alexrisch alexrisch merged commit d396e0b into main Dec 3, 2024
5 of 6 checks passed
@alexrisch alexrisch deleted the ar/decoded-message-types branch December 3, 2024 14:55
Copy link

github-actions bot commented Dec 3, 2024

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants