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

Add more primitive types #71

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/big-crabs-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@xmtp/content-type-primitives": patch
---

Add more primitive types
2 changes: 1 addition & 1 deletion packages/content-type-primitives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "[email protected]:xmtp/xmtp-js-content-types.git",
"url": "git+ssh://git@github.com/xmtp/xmtp-js-content-types.git",
"directory": "packages/content-type-primitives"
},
"license": "MIT",
Expand Down
10 changes: 10 additions & 0 deletions packages/content-type-primitives/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ export type ContentCodec<T> = {
fallback(content: T): string | undefined;
shouldPush: (content: T) => boolean;
};

/**
* An interface implemented for accessing codecs by content type.
* @deprecated
*/
export interface CodecRegistry<T = any> {
codecFor(contentType: ContentTypeId): ContentCodec<T> | undefined;
}

export type CodecMap<T = any> = Map<string, ContentCodec<T>>;
Loading