Signature:
export declare class TSBuffer<Proto extends TSBufferProto = TSBufferProto>
Constructor | Modifiers | Description |
---|---|---|
(constructor)(proto, options) | Constructs a new instance of the TSBuffer class |
Property | Modifiers | Type | Description |
---|---|---|---|
prune | TSBufferValidator<Proto>['prune'] | ||
validate | TSBufferValidator<Proto>['validate'] |
Method | Modifiers | Description |
---|---|---|
decode(buf, schemaOrId, options) | 解码 | |
decodeJSON(json, schemaOrId, options) | 从 JSON Object 解码,根据协议将 ArrayBuffer、Date、ObjectId 等类型从 JSON 中还原 | |
encode(value, schemaOrId, options) | 编码 | |
encodeJSON(value, schemaOrId, options) | 编码为 JSON Object,根据协议将 JSON 不支持的格式(如 ArrayBuffer、Date、ObjectId)转换成 JSON 可传输的格式 |