import type { Enum } from '../../../../shared/src/enum.ts';
import type { Subscription } from '../../types/subscription.ts';
import type { ChangeStreamData } from '../change-source/protocol/current.ts';
import type { WatermarkedChange } from './change-streamer-service.ts';
import { type Downstream } from './change-streamer.ts';
import * as ErrorType from './error-type-enum.ts';
type ErrorType = Enum<typeof ErrorType>;
/**
 * Encapsulates a subscriber to changes. All subscribers start in a
 * "catchup" phase in which changes are buffered in a backlog while the
 * storer is queried to send any changes that were committed since the
 * subscriber's watermark. Once the catchup is complete, calls to
 * {@link send()} result in immediately sending the change.
 */
export declare class Subscriber {
    #private;
    readonly id: string;
    constructor(protocolVersion: number, id: string, watermark: string, downstream: Subscription<Downstream>);
    get watermark(): string;
    get acked(): string;
    send(change: WatermarkedChange): Promise<void>;
    /** catchup() is called on ChangeEntries loaded from the store. */
    catchup(change: WatermarkedChange): Promise<void>;
    /**
     * Marks the Subscribe as "caught up" and flushes any backlog of
     * entries that were received during the catchup.
     */
    setCaughtUp(): void;
    supportsMessage(change: ChangeStreamData[1]): boolean;
    fail(err?: unknown): void;
    close(error?: ErrorType, message?: string): void;
}
export {};
//# sourceMappingURL=subscriber.d.ts.map