import { SyncDataFlowStatus, SyncPriorityStatus, SyncProgress, SyncStatus, SyncStreamDescription, SyncStreamStatus } from '@powersync/common'; import { CoreSyncStatus } from '../../client/sync/stream/core-instruction.js'; /** * The {@link SyncStatus} subset not managed by the Rust client in {@link CoreSyncStatus}. * * This includes the upload state and JS errors. */ export interface JavaScriptSyncState { uploading?: boolean; downloadError?: Error; uploadError?: Error; } export declare class SyncStatusSnapshot implements SyncStatus { readonly core: CoreSyncStatus | null; readonly jsState: JavaScriptSyncState; constructor(core: CoreSyncStatus | null, jsState: JavaScriptSyncState); get connected(): boolean; get connecting(): boolean; get downloading(): boolean; get uploading(): boolean; get downloadError(): Error | undefined; get uploadError(): Error | undefined; get dataFlowStatus(): SyncDataFlowStatus; get lastSyncedAt(): Date | undefined; get hasSynced(): boolean | undefined; get syncStreams(): SyncStreamStatus[] | undefined; forStream(stream: SyncStreamDescription): SyncStreamStatus | undefined; get priorityStatusEntries(): SyncPriorityStatus[] | undefined; get downloadProgress(): SyncProgress | null; statusForPriority(priority: number): SyncPriorityStatus | undefined; isEqual(status: SyncStatus): boolean; getMessage(): string; /** * Serializes the SyncStatus instance to a plain object. * * @returns A plain object representation of the sync status */ toJSON(): SyncStatusJson; /** * Not all errors are serializable over a MessagePort. E.g. some `DomExceptions` fail to be passed across workers. * This explicitly serializes errors in the SyncStatus. */ serializeError(error?: Error): Error | undefined; } export interface SyncStatusJson { core: CoreSyncStatus | null; dataFlow: JavaScriptSyncState; }