import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard'; import { Redis } from '@upstash/redis'; import { PublisherOptions, Publisher, PublisherSubscribeListenerOptions } from '../index.js'; import '@orpc/shared'; interface UpstashRedisPublisherOptions extends PublisherOptions, StandardRPCJsonSerializerOptions { /** * How long (in seconds) to retain events for replay. * * @remark * This allows new subscribers to "catch up" on missed events using `lastEventId`. * Note that event cleanup is deferred for performance reasons — meaning some * expired events may still be available for a short period of time, and listeners * might still receive them. * * @default NaN (disabled) */ resumeRetentionSeconds?: number; /** * The prefix to use for Redis keys. * * @default orpc:publisher: */ prefix?: string; } declare class UpstashRedisPublisher> extends Publisher { private readonly redis; private readonly prefix; private readonly serializer; private readonly retentionSeconds; private readonly listenersMap; private readonly onErrorsMap; private readonly subscriptionPromiseMap; private readonly subscriptionsMap; private get isResumeEnabled(); /** * The exactness of the `XTRIM` command. * * @internal */ xtrimExactness: '~' | '='; /** * Useful for measuring memory usage. * * @internal * */ get size(): number; constructor(redis: Redis, { resumeRetentionSeconds, prefix, ...options }?: UpstashRedisPublisherOptions); private lastCleanupTimeMap; publish(event: K, payload: T[K]): Promise; protected subscribeListener(event: K, originalListener: (payload: T[K]) => void, { lastEventId, onError }?: PublisherSubscribeListenerOptions): Promise<() => Promise>; private prefixKey; private serializePayload; private deserializePayload; } export { UpstashRedisPublisher }; export type { UpstashRedisPublisherOptions };