import { EventFns, Metadata, StateWithProvenance, Where } from '@actyx/sdk'; import { SnapshotStore } from '@actyx/sdk/lib/snapshotStore'; import { Observable } from '../../node_modules/rxjs'; import { PondStateTracker } from '../pond-state'; import { FishErrorReporter, FishId, IsReset } from '../types'; import { SnapshotScheduler } from './snapshotScheduler'; /** * Observe a Fish using the subscribe_monotonic endpoint (emulated in Actyx <2.12) * * The rules are: * 1. state snapshots are written asynchronously according to the scheduler * 1. upon start or after time travel, the latest valid snapshot is used, otherwise initialState, empty offsets, no horizon * 1. if isReset is given, query from present to lowerBound to possibly find a newer horizon * 1. start subMono from lowerBound with horizon * 1. upon time travel, await snapshot persistence and then start over from 2 */ export declare const observeMonotonic: (eventStore: EventFns, snapshotStore: SnapshotStore, snapshotScheduler: SnapshotScheduler, reportFishError: FishErrorReporter, pondStateTracker?: PondStateTracker) => (where: Where, initialState: S, onEvent: (state: S, event: E, metadata: Metadata) => S, fishId: FishId, isReset?: IsReset | undefined, deserializeState?: ((jsonState: unknown) => S) | undefined) => Observable>;