import { z } from 'zod'; /** * Codec is an entity that encodes and decodes messages to and from a * binary format. */ export interface Codec { /** The HTTP content type of the encoder */ contentType: string; /** * Encodes the given payload into a binary representation. * * @param payload - The payload to encode. * @returns An ArrayBuffer containing the encoded payload. */ encode: (payload: unknown, schema?: z.ZodType) => Uint8Array; /** * Decodes the given binary representation into a type checked payload. * * @param data - The data to decode. * @param schema - The schema to decode the data with. */ decode:

(data: Uint8Array | ArrayBuffer, schema?: P) => z.infer

; } /** JSONCodec is a JSON implementation of Codec. */ export declare class JSONCodec implements Codec { contentType: string; private readonly decoder; private readonly encoder; constructor(); encode(payload: unknown, schema?: z.ZodType): Uint8Array; decode

(data: Uint8Array | ArrayBuffer, schema?: P): z.infer

; decodeString

(data: string, schema?: P): z.infer

; encodeString(payload: unknown, schema?: z.ZodType): string; } /** * CSVCodec is a CSV implementation of Codec. */ export declare class CSVCodec implements Codec { contentType: string; encode(payload: unknown): Uint8Array; decode

(data: Uint8Array | ArrayBuffer, schema?: P): z.infer

; encodeString(payload: unknown): string; decodeString

(data: string, schema?: P): z.infer

; private parseValue; } export declare class TextCodec implements Codec { contentType: string; encode(payload: unknown): Uint8Array; decode

(data: Uint8Array | ArrayBuffer, schema?: P): z.infer

; } export declare const JSON_CODEC: JSONCodec; export declare const CSV_CODEC: CSVCodec; export declare const TEXT_CODEC: TextCodec; export declare const ENCODERS: Codec[]; //# sourceMappingURL=codec.d.ts.map