/** * Explicit out-of-band truth for values written by the lossless PostgreSQL * compatibility codec. Historical rows have NULL in their companion version * column and must never be decoded based on content shape alone. */ export declare const LOSSLESS_CONTENT_CODEC_VERSION: 1; export declare const LOSSLESS_CONTENT_WRITER_APPLICATION_NAME = "opengeni-lossless-v1-session-variable-sets-v1"; export declare function withLosslessContentWriteVersion(value: Value & Record, contentKey: ContentKey, versionKey: VersionKey): Value & Record; export declare function withLosslessContentWriteVersion(value: readonly (Value & Record)[], contentKey: ContentKey, versionKey: VersionKey): Array>; export declare const LEGACY_LOSSLESS_JSON_ENVELOPE_KEY = "$opengeniCanonicalV8_6d9b6f48_2a3e_4d8a_9e33_7611d9d08985"; export declare const LEGACY_LOSSLESS_TEXT_PREFIX = "opengeni-canonical-text-v1:"; export declare const LOSSLESS_JSON_STRING_PREFIX = "opengeni_lossless_json_string_v2_81f06e15:"; export declare const LOSSLESS_TEXT_PREFIX = "opengeni_lossless_text_v2_c4100a62:"; export declare class UnsupportedCanonicalValueError extends TypeError { readonly name = "UnsupportedCanonicalValueError"; } /** * Preserve JSON structure and SQL-queryable control keys. Only strings that * PostgreSQL cannot represent (or that collide with this unshipped v2 tag) are * encoded. A value JSON cannot carry (a symbol key, a function, a bigint, a * cycle, a class instance, ...) never fails the write: the value is first * converted as `JSON.stringify` would (see `toJsonSafeValue`), the change is * logged with its kind and a redacted path (never the value), and the * converted value is stored. */ export declare function toPostgresLosslessJson(value: unknown): unknown; /** * Whether a JSON string value is stored byte-for-byte as given. False for * strings the codec must encode: NUL, lone UTF-16 surrogates and the codec's * own string prefix. SQL that reads such a stored value sees the encoding. */ export declare function isStoredVerbatimAsLosslessJsonString(value: string): boolean; /** * Restore an explicitly versioned JSON value after a PostgreSQL read. A NULL * version denotes literal legacy/old-writer data, including strings that happen * to be valid active-marker encodings. */ export declare function fromPostgresLosslessJson(value: T, codecVersion: number | null | undefined): T; /** * Lossless text-column boundary for NUL, lone UTF-16, and v2-prefix text. * Only the unrepresentable code unit is tagged, with SQL-visible spaces around * the tag, so ordinary surrounding words retain their full-text-search shape. */ export declare function toPostgresLosslessText(value: string): string; /** * Decode only an explicitly versioned value introduced by this migration. The * nullable companion column, not the producer string, is the codec truth. */ export declare function fromPostgresLosslessText(value: string, codecVersion: number | null | undefined): string;