import type { CrossRealmEnvelopeLegacy, ReplyEnvelopeLegacy, TaggedEnvelope, MxEnvelopeV1, MxMsgType } from './envelope';
export declare function nowIso(): string;
export declare function generateCorrelationId(): string;
export declare function deserializeTaggedEnvelope(json: string): TaggedEnvelope | null;
export interface LegacyEnvelopeValidationResult {
    ok: boolean;
    error?: string;
}
export declare function validateLegacyRequestEnvelope(e: CrossRealmEnvelopeLegacy): LegacyEnvelopeValidationResult;
export declare function createLegacyRequest(params: {
    toRoot: string;
    toPath: string;
    fromRoot: string;
    replyTo: string;
    correlationId?: string;
    body: unknown;
    timestamp?: string;
    ttlMs?: number;
    traceId?: string;
    type?: 'request' | 'event';
    /** @deprecated Use toRoot */
    toRealm?: string;
    /** @deprecated Use fromRoot */
    fromRealm?: string;
}): CrossRealmEnvelopeLegacy;
export declare function createLegacyReply(params: {
    request: CrossRealmEnvelopeLegacy;
    responderRoot: string;
    body: unknown;
    ok: boolean;
    error?: ReplyEnvelopeLegacy['error'];
    timestamp?: string;
    traceId?: string;
    type?: 'reply';
    /** @deprecated Use responderRoot */
    responderRealm?: string;
}): ReplyEnvelopeLegacy;
export declare function serializeLegacyEnvelope(e: CrossRealmEnvelopeLegacy | ReplyEnvelopeLegacy): string;
export declare function createMxEnvV1(params: {
    msgType: MxMsgType;
    toRoot: string;
    toPath: string;
    fromRoot: string;
    fromPath?: string;
    replyToRoot?: string;
    replyToPath?: string;
    correlationId?: string;
    msgId?: string;
    ttl?: number;
    traceId?: string;
    spanId?: string;
    parentSpanId?: string;
    body: unknown;
    ok?: boolean;
    error?: MxEnvelopeV1['error'];
    /** @deprecated Use toRoot */
    toRealm?: string;
    /** @deprecated Use fromRoot */
    fromRealm?: string;
    /** @deprecated Use replyToRoot */
    replyToRealm?: string;
}): MxEnvelopeV1;
export declare function serializeMxEnvV1(e: MxEnvelopeV1): string;
export declare function toErrorMessage(e: unknown): string;
//# sourceMappingURL=envelope_codec.d.ts.map