import { Actyx } from '@actyx/sdk'; import { Observable } from '../node_modules/rxjs'; import { SwarmInfo, SwarmSummary } from './swarmState'; /** Configure how to wait for swarm. * @public */ export declare type FullWaitForSwarmConfig = { /** * Splash screen enabled */ enabled: boolean; /** * Delay until we consider that we got the swarm state */ waitForSwarmMs: number; /** * Minimum number of sources until we consider that we got the swarm state */ minSources: number; /** * Delay that we allow to sync with the swarm state (leave undefined to wait indefinitely) */ waitForSyncMs?: number; /** * True if we allow the user to skip the splash screen */ allowSkip: boolean; }; /** Partially configure waiting for the swarm. * @public */ export declare type WaitForSwarmConfig = Partial; /** `WaitForSwarmConfig` associated functions. * @public */ export declare const WaitForSwarmConfig: { defaults: FullWaitForSwarmConfig; }; /** Sync progress in terms of event numbers. * @public */ export declare type Progress = { min: number; current: number; max: number; }; /** Sync progress per source, and overall. * @public */ export declare type SyncProgress = { sources: Progress; events: Progress; }; export declare const getSyncProgress: (current: SwarmInfo, reference: SwarmInfo) => SyncProgress; export declare const getSplashStateImpl: (config: WaitForSwarmConfig, swarmInfo: Observable) => Observable; /** * Discovering swarm state. * @public */ export declare type SplashStateDiscovery = { mode: 'discovery'; current: SwarmSummary; skip?: () => void; }; /** * Synchronizing up to the discovered swarm state. * @public */ export declare type SplashStateSync = { mode: 'sync'; reference: SwarmSummary; progress: SyncProgress; current: SwarmSummary; skip?: () => void; }; /** * Current state of swarm synchronization procedure. * @public */ export declare type SplashState = SplashStateDiscovery | SplashStateSync; export declare const streamSplashState: (actyx: Actyx, config: WaitForSwarmConfig) => Observable;