import { AbstractEventService } from './AbstractEventService';
import { BlockchainEventEmitter } from './BlockchainEventEmitter';
export interface Snapshot<SnapshotPayloadType> {
    readonly latestBlockNumber: number;
    readonly payload: SnapshotPayloadType;
}
export declare abstract class AbstractSnapshotService<EventType, SnapshotPayloadType, SerializedSnapshotType> extends AbstractEventService<EventType> {
    private savedLatestBlockNumber;
    protected constructor(blockchainEventEmitter: BlockchainEventEmitter, eventName: string);
    init(): Promise<void>;
    retrieveEventsFromLatestBlock(): Promise<void>;
    get isReady(): boolean;
    private loadSnapshot;
    protected saveSnapshot(): Promise<unknown>;
    protected afterEventsAccepted(eventsCount: number): Promise<void>;
    protected abstract getSnapshotPayload(): SnapshotPayloadType;
    protected abstract populateSnapshot(snapshot: Snapshot<SnapshotPayloadType>): void;
    protected abstract serializeSnapshot(snapshot: Snapshot<SnapshotPayloadType>): SerializedSnapshotType;
    protected abstract deserializeSnapshot(serializedSnapshot: SerializedSnapshotType): Snapshot<SnapshotPayloadType>;
    protected abstract fetchSnapshot(): Promise<SerializedSnapshotType>;
    protected abstract persistSnapshot(serializedSnapshot: SerializedSnapshotType): Promise<unknown>;
}
