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.
Type Parameters
Section titled “Type Parameters”TReq
TRes = TReq
Returns
Section titled “Returns”MsgPackCodec<TReq, TRes>
Example
Section titled “Example”// Symmetric (same type for serialize and deserialize)const codec = msgpack<MyData>();
// Asymmetric (different request and response types)const codec = msgpack<SearchQuery, SearchResult>();