/** * Redis Utility Functions * * Serialization helpers for converting between JavaScript objects and Redis Hash fields. */ /** * Debug logger for redis-world. * Enable with WORKFLOW_DEBUG=redis or WORKFLOW_DEBUG=1 */ export declare const debug: (...args: unknown[]) => void; /** * Encodes a value using CBOR and returns a base64 string with prefix. * CBOR preserves Date, undefined, Map, Set, BigInt types automatically. */ export declare function toCbor(value: unknown): string; /** * Decodes a CBOR-encoded string (with prefix) back to original value. * Returns undefined if the input is null/undefined or not CBOR-encoded. */ export declare function fromCbor(value: string | null | undefined): T | undefined; /** * Serializes a JavaScript object for Redis Hash storage. * - Date objects are converted to ISO strings * - Objects/arrays are CBOR encoded (preserves nested Date types) * - undefined values are skipped * - null values are stored as empty string */ export declare function serializeForRedis(obj: Record): Record; /** * Deserializes Redis Hash fields back to a JavaScript object. * - CBOR-prefixed strings are decoded with full type preservation * - ISO date strings in known date fields are converted to Date objects * - Empty strings become undefined * - Boolean strings are converted to booleans * - Numeric strings are converted to numbers (except for ID fields) */ export declare function deserializeFromRedis>(data: Record | null): T | null; /** * Converts a ULID to a numeric score for sorted set operations. * ULIDs encode time in the first 10 characters (48-bit timestamp). */ export declare function ulidToScore(ulid: string): number; /** * Creates a key prefix function for consistent key naming. */ export declare function createKeyPrefix(prefix: string): (parts: string[]) => string; /** * Deep clones an object using structuredClone. * Required because the workflow core may mutate returned objects. */ export declare function deepClone(obj: T): T; //# sourceMappingURL=utils.d.ts.map