/** * Registry-aware canonical protobuf JSON, alongside the existing generated JSON API. * * @packageDocumentation */ import { type AnyShape } from './any.js'; import { type MessageFns } from './core.js'; import type { Registry } from './registry.js'; /** Controls canonical protobuf JSON parsing. Unknown fields are rejected by default. */ export interface ProtoJSONOptions { /** Skips unknown fields and enum names instead of rejecting them. Defaults to false. */ ignoreUnknownFields?: boolean; } /** Expands an Any into canonical @type JSON. Unknown types cannot be expanded. */ export declare function anyToProtoJSON(value: AnyShape, registry: Registry): unknown; /** Packs canonical @type JSON with a registered codec. */ export declare function anyFromProtoJSON(value: unknown, registry: Registry, options?: ProtoJSONOptions): AnyShape; /** Converts a generated message to canonical JSON without changing its existing toJSON behavior. */ export declare function toProtoJSON(type: MessageFns, message: T, registry: Registry): unknown; /** Reads canonical JSON through the existing generated constructors. */ export declare function fromProtoJSON(type: MessageFns, value: unknown, registry: Registry, options?: ProtoJSONOptions): T; //# sourceMappingURL=proto_json.d.ts.map