import { Logger } from '../types/logger'; /** * Shape of TypeORM's RedisQueryResultCache once the underlying client is * materialized. We reach into it via duck-typing because TypeORM does not * export the type. */ export interface RedisQueryResultCacheLike { client?: { on?: (event: string, fn: (err: Error) => void) => void; }; clientType?: string; __novaErrorHandlerAttached?: boolean; } /** * TypeORM's RedisQueryResultCache only attaches an `error` listener on the * underlying redis client for `clientType === 'redis'`. With `'ioredis'` (what * every hapn service uses to talk to ElastiCache Valkey) the client is an * EventEmitter that crashes the host process on the first unhandled `error` * event — a TLS hiccup or `MOVED` redirect during failover takes down the * Lambda even with `ignoreErrors: true` set in TypeORM config. * * Idempotent: re-running on the same cache is a no-op. * * Returns true if a handler was attached on this call (useful for tests and * for callers that want to observe whether anything happened). */ export declare function attachIoredisErrorHandler(cache: RedisQueryResultCacheLike | undefined | null, logger: Logger): boolean;