/**
 * SyncPayloadSchema -- Zod schemas for sync protocol messages.
 *
 * Validates both shape and resource limits for sync requests and responses
 * at the trust boundary (HTTP ingress/egress). Prevents malformed or
 * oversized payloads from reaching the CRDT merge engine.
 *
 * @module domain/services/sync/SyncPayloadSchema
 * @see B64 -- Sync ingress payload validation
 */
import z from 'zod';
export interface SyncPayloadLimits {
    maxWritersInFrontier: number;
    maxPatches: number;
    maxOpsPerPatch: number;
    maxStringBytes: number;
    maxBlobBytes: number;
}
export declare const DEFAULT_LIMITS: Readonly<SyncPayloadLimits>;
/**
 * Normalizes a frontier value that may be a Map (cbor-x decodes maps)
 * or a plain object into a validated plain object.
 */
export declare function normalizeFrontier(value: unknown): Record<string, string> | null;
export declare function createSyncRequestSchema(limits?: SyncPayloadLimits): z.ZodType;
export declare function createSyncResponseSchema(limits?: SyncPayloadLimits): z.ZodType;
type ValidatedSyncRequestPayload = {
    type: 'sync-request';
    frontier: Record<string, string>;
    page?: {
        maxPatches: number;
        cursor?: string | null;
    };
};
/**
 * Validates a sync request payload. Returns the parsed value or throws.
 */
export declare function validateSyncRequest(payload: unknown, // nosemgrep: ts-no-unknown-outside-adapters -- 0025B
limits?: SyncPayloadLimits): {
    ok: true;
    value: ValidatedSyncRequestPayload;
} | {
    ok: false;
    error: string;
};
/**
 * Validates a sync response payload. Returns the parsed value or an error.
 */
export declare function validateSyncResponse(payload: unknown, // nosemgrep: ts-no-unknown-outside-adapters -- 0025B
limits?: SyncPayloadLimits): {
    ok: true;
    value: unknown;
} | {
    ok: false;
    error: string;
};
export {};
