UNPKG

@syntropylog/adapters

Version:
22 lines 875 B
import { BrokerMessage } from '@syntropylog/types'; /** * Utility class for handling payload serialization/deserialization * across different broker adapters. */ export declare class PayloadSerializer { /** * Serializes a BrokerMessage payload for sending to a broker. * Handles Buffer objects by extracting their JSON content. */ static serializeForBroker(message: BrokerMessage): string; /** * Deserializes a payload received from a broker into a Buffer * that the SyntropyLog framework expects. */ static deserializeFromBroker(brokerPayload: Buffer | string | null): Buffer; /** * Creates a BrokerMessage with properly deserialized payload */ static createBrokerMessage(brokerPayload: Buffer | string | null, headers?: Record<string, any>): BrokerMessage; } //# sourceMappingURL=PayloadSerializer.d.ts.map