Skip to content

msgpack

msgpack<TReq, TRes>(): MsgPackCodec<TReq, TRes>

Defined in: packages/codecs/src/msgpack-codec.ts:124

Create a typed MsgPack codec.

Returns a new MsgPackCodec instance with the specified type parameters. Use this to get compile-time type safety for request/response data.

TReq

TRes = TReq

MsgPackCodec<TReq, TRes>

// Symmetric (same type for serialize and deserialize)
const codec = msgpack<MyData>();
// Asymmetric (different request and response types)
const codec = msgpack<SearchQuery, SearchResult>();