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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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

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

Successfully merging this pull request may close these issues.

2 participants