UNPKG

@cloudpss/ubjson

Version:

Opinionated UBJSON encoder/decoder for CloudPSS.

16 lines 1 kB
import type { EncodeOptions, DecodeOptions } from '../options.js'; export { UnexpectedEofError as UnexpectedEof } from '../helper/errors.js'; export type { EncodeOptions, DecodeOptions }; /** 编码为 UBJSON */ export declare function encode(value: unknown, options?: EncodeOptions): ReadableStream<Uint8Array>; /** 编码为 UBJSON */ export declare function encodeMany(value: AsyncIterable<unknown>, options?: EncodeOptions): ReadableStream<Uint8Array>; /** 编码为 UBJSON */ export declare function encoder(options?: EncodeOptions): TransformStream<unknown, Uint8Array>; /** 解码 UBJSON */ export declare function decode(stream: ReadableStream<Uint8Array>, options?: DecodeOptions): Promise<unknown>; /** 解码 UBJSON */ export declare function decodeMany(stream: ReadableStream<Uint8Array>, options?: DecodeOptions): AsyncIterable<unknown>; /** 解码 UBJSON */ export declare function decoder(options?: DecodeOptions): TransformStream<Uint8Array, unknown>; //# sourceMappingURL=index.d.ts.map