import type { BinaryReader, BinaryWriter, JsonSafe } from './codegen/index.js'; import type { MessageBody, TypedJson } from './helpers.js'; export type ProtoMsg = { readonly typeUrl: TU; readonly value: Uint8Array; }; export interface EncodeObject { readonly typeUrl: TU; readonly value: MessageBody; } export interface TypedAmino> { readonly type: TU; readonly value: MT; } export interface Proto3Codec, IM = MT> { readonly typeUrl: TU; encode(message: IM, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): MT; fromJSON(object: any): MT; toJSON(message: IM): JsonSafe; fromPartial(object: Partial): MT; fromProtoMsg(message: ProtoMsg): MT; toProto(message: IM): Uint8Array; toProtoMsg(message: IM): ProtoMsg; } /** * Wraps a codec, adding built-in partial message support. * * @template [TU=string] * @template [MT=MessageBody] * @param {Proto3Codec} codec The original codec. * @param {string[]} [nonNullishFields] The properties that should be replaced with `{}` if nullish. * @returns {Proto3Codec>} A new codec that can handle partial input messages. */ export declare const Codec: >(codec: Proto3Codec, nonNullishFields?: string[]) => Proto3Codec>; export interface Proto3CodecHelper> extends Proto3Codec> { typedJson(message: Partial): TypedJson; typedAmino(message: Partial): TypedAmino; typedEncode(message: Partial): EncodeObject; fromTyped(object: unknown, embeddedFields?: { [valueProp: string]: string; }): MT; } /** * Wraps a codec, adding built-in partial message support and helpers for common * manipulations. * * @template [TU=string] * @template [MT=MessageBody] * @param {Proto3Codec} codec The original codec. * @param {string[]} [nonNullishFields] The fields that should be replaced with `{}` if nullish. * @returns {Proto3CodecHelper} Codec and helpers that can handle partial input messages. */ export declare const CodecHelper: >(codec: Proto3Codec, nonNullishFields?: string[]) => Proto3CodecHelper; //# sourceMappingURL=codec-helpers.d.ts.map