Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #73 from xmtp/rygine/fix-primitive-types
Browse files Browse the repository at this point in the history
Add registry param to encode/decode
  • Loading branch information
rygine authored Jun 13, 2024
2 parents 4c63bf0 + 2c05e89 commit 01827d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/content-type-primitives/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export type EncodedContent<Parameters = Record<string, string>> = {
content: Uint8Array;
};

export type ContentCodec<T> = {
export type ContentCodec<T = any> = {
contentType: ContentTypeId;
encode(content: T): EncodedContent;
decode(content: EncodedContent): T;
encode(content: T, registry: CodecRegistry<T>): EncodedContent;
decode(content: EncodedContent, registry: CodecRegistry<T>): T;
fallback(content: T): string | undefined;
shouldPush: (content: T) => boolean;
};
Expand Down

0 comments on commit 01827d0

Please sign in to comment.