import { Devtools, SyncState, UnknownError } from '@livestore/common'; import { EventSequenceNumber } from '@livestore/common/schema'; import * as WebmeshWorker from '@livestore/devtools-web-common/worker'; import { Schema } from '@livestore/utils/effect'; export declare const StorageTypeOpfs: Schema.Struct<{ type: Schema.Literal<["opfs"]>; /** * Default is `livestore-${storeId}` * * When providing this option, make sure to include the `storeId` in the path to avoid * conflicts with other LiveStore apps. */ directory: Schema.optional; }>; export type StorageTypeOpfs = typeof StorageTypeOpfs.Type; export declare const StorageType: Schema.Struct<{ type: Schema.Literal<["opfs"]>; /** * Default is `livestore-${storeId}` * * When providing this option, make sure to include the `storeId` in the path to avoid * conflicts with other LiveStore apps. */ directory: Schema.optional; }>; export type StorageType = typeof StorageType.Type; export type StorageTypeEncoded = typeof StorageType.Encoded; export declare const SyncBackendOptions: Schema.Record$>; export type SyncBackendOptions = Record; declare const LeaderWorkerOuterInitialMessage_base: Schema.TaggedRequestClass; } & { port: Schema.Schema; storeId: typeof Schema.String; clientId: typeof Schema.String; }, typeof Schema.Void, typeof Schema.Never>; export declare class LeaderWorkerOuterInitialMessage extends LeaderWorkerOuterInitialMessage_base { } declare const LeaderWorkerOuterRequest_base: typeof LeaderWorkerOuterInitialMessage; export declare class LeaderWorkerOuterRequest extends LeaderWorkerOuterRequest_base { } declare const LeaderWorkerInnerInitialMessage_base: Schema.TaggedRequestClass; } & { storageOptions: Schema.Struct<{ type: Schema.Literal<["opfs"]>; /** * Default is `livestore-${storeId}` * * When providing this option, make sure to include the `storeId` in the path to avoid * conflicts with other LiveStore apps. */ directory: Schema.optional; }>; devtoolsEnabled: typeof Schema.Boolean; storeId: typeof Schema.String; clientId: typeof Schema.String; debugInstanceId: typeof Schema.String; syncPayloadEncoded: Schema.UndefinedOr>; }, typeof Schema.Void, typeof UnknownError>; export declare class LeaderWorkerInnerInitialMessage extends LeaderWorkerInnerInitialMessage_base { } declare const LeaderWorkerInnerBootStatusStream_base: Schema.TaggedRequestClass; }, Schema.Union<[Schema.Struct<{ stage: Schema.Literal<["loading"]>; }>, Schema.Struct<{ stage: Schema.Literal<["migrating"]>; progress: Schema.Struct<{ done: typeof Schema.Number; total: typeof Schema.Number; }>; }>, Schema.Struct<{ stage: Schema.Literal<["rehydrating"]>; progress: Schema.Struct<{ done: typeof Schema.Number; total: typeof Schema.Number; }>; }>, Schema.Struct<{ stage: Schema.Literal<["syncing"]>; progress: Schema.Struct<{ done: typeof Schema.Number; total: typeof Schema.Number; }>; }>, Schema.Struct<{ stage: Schema.Literal<["done"]>; }>, Schema.Struct<{ stage: Schema.Literal<["warning"]>; reason: Schema.Literal<["private-browsing", "storage-unavailable", "unknown"]>; message: typeof Schema.String; }>]>, typeof Schema.Never>; export declare class LeaderWorkerInnerBootStatusStream extends LeaderWorkerInnerBootStatusStream_base { } declare const LeaderWorkerInnerPushToLeader_base: Schema.TaggedRequestClass; } & { batch: Schema.Array$; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }; readonly parentSeqNum: { readonly global: number & import("effect/Brand").Brand<"GlobalEventSequenceNumber">; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }; }, { readonly clientId: string; readonly sessionId: string; readonly name: string; readonly args: any; readonly seqNum: { readonly global: number & import("effect/Brand").Brand<"GlobalEventSequenceNumber">; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }; readonly parentSeqNum: { readonly global: number & import("effect/Brand").Brand<"GlobalEventSequenceNumber">; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }; }, never>>; }, Schema.Schema, Schema.Union<[typeof import("@livestore/common").LeaderAheadError, typeof import("@livestore/common").NonMonotonicBatchError, typeof import("@livestore/common").StaleRebaseGenerationError]>>; export declare class LeaderWorkerInnerPushToLeader extends LeaderWorkerInnerPushToLeader_base { } declare const LeaderWorkerInnerPullStream_base: Schema.TaggedRequestClass; } & { cursor: Schema.SchemaClass<{ readonly global: number & import("effect/Brand").Brand<"GlobalEventSequenceNumber">; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }, { readonly global: number & import("effect/Brand").Brand<"GlobalEventSequenceNumber">; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }, never>; }, Schema.Struct<{ payload: typeof SyncState.PayloadUpstream; }>, typeof Schema.Never>; export declare class LeaderWorkerInnerPullStream extends LeaderWorkerInnerPullStream_base { } declare const LeaderWorkerInnerStreamEvents_base: Schema.TaggedRequestClass; } & { readonly since: Schema.optional, number, never>; client: Schema.BrandSchema, number, never>; rebaseGeneration: typeof Schema.Int; }> & { make: (seqNum: EventSequenceNumber.Client.CompositeInput) => EventSequenceNumber.Client.Composite; }>; readonly until: Schema.optional, number, never>; client: Schema.BrandSchema, number, never>; rebaseGeneration: typeof Schema.Int; }> & { make: (seqNum: EventSequenceNumber.Client.CompositeInput) => EventSequenceNumber.Client.Composite; }>; readonly filter: Schema.optional>; readonly clientIds: Schema.optional>; readonly sessionIds: Schema.optional>; readonly batchSize: Schema.optional>; readonly includeClientOnly: Schema.optional; }, Schema.Struct<{ name: typeof Schema.String; args: typeof Schema.Any; seqNum: Schema.Struct<{ global: Schema.BrandSchema, number, never>; client: Schema.BrandSchema, number, never>; rebaseGeneration: typeof Schema.Int; }> & { make: (seqNum: EventSequenceNumber.Client.CompositeInput) => EventSequenceNumber.Client.Composite; }; parentSeqNum: Schema.Struct<{ global: Schema.BrandSchema, number, never>; client: Schema.BrandSchema, number, never>; rebaseGeneration: typeof Schema.Int; }> & { make: (seqNum: EventSequenceNumber.Client.CompositeInput) => EventSequenceNumber.Client.Composite; }; clientId: typeof Schema.String; sessionId: typeof Schema.String; }>, typeof Schema.Never>; export declare class LeaderWorkerInnerStreamEvents extends LeaderWorkerInnerStreamEvents_base { } declare const LeaderWorkerInnerExport_base: Schema.TaggedRequestClass; }, Schema.Schema, Uint8Array, never>, typeof Schema.Never>; export declare class LeaderWorkerInnerExport extends LeaderWorkerInnerExport_base { } declare const LeaderWorkerInnerExportEventlog_base: Schema.TaggedRequestClass; }, Schema.Schema, Uint8Array, never>, typeof Schema.Never>; export declare class LeaderWorkerInnerExportEventlog extends LeaderWorkerInnerExportEventlog_base { } declare const LeaderWorkerInnerGetRecreateSnapshot_base: Schema.TaggedRequestClass; }, Schema.Struct<{ snapshot: Schema.Schema>; migrationsReport: Schema.Struct<{ migrations: Schema.Array$; }>; }>>; }>; }>, typeof Schema.Never>; export declare class LeaderWorkerInnerGetRecreateSnapshot extends LeaderWorkerInnerGetRecreateSnapshot_base { } declare const LeaderWorkerInnerGetLeaderHead_base: Schema.TaggedRequestClass; }, Schema.SchemaClass<{ readonly global: number & import("effect/Brand").Brand<"GlobalEventSequenceNumber">; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }, { readonly global: number & import("effect/Brand").Brand<"GlobalEventSequenceNumber">; readonly client: number & import("effect/Brand").Brand<"ClientEventSequenceNumber">; readonly rebaseGeneration: number; }, never>, typeof Schema.Never>; export declare class LeaderWorkerInnerGetLeaderHead extends LeaderWorkerInnerGetLeaderHead_base { } declare const LeaderWorkerInnerGetLeaderSyncState_base: Schema.TaggedRequestClass; }, typeof SyncState.SyncState, typeof Schema.Never>; export declare class LeaderWorkerInnerGetLeaderSyncState extends LeaderWorkerInnerGetLeaderSyncState_base { } declare const LeaderWorkerInnerSyncStateStream_base: Schema.TaggedRequestClass; }, typeof SyncState.SyncState, typeof Schema.Never>; export declare class LeaderWorkerInnerSyncStateStream extends LeaderWorkerInnerSyncStateStream_base { } declare const LeaderWorkerInnerGetNetworkStatus_base: Schema.TaggedRequestClass; }, Schema.Struct<{ isConnected: typeof Schema.Boolean; timestampMs: typeof Schema.Number; devtools: Schema.Struct<{ latchClosed: typeof Schema.Boolean; }>; }>, typeof Schema.Never>; export declare class LeaderWorkerInnerGetNetworkStatus extends LeaderWorkerInnerGetNetworkStatus_base { } declare const LeaderWorkerInnerNetworkStatusStream_base: Schema.TaggedRequestClass; }, Schema.Struct<{ isConnected: typeof Schema.Boolean; timestampMs: typeof Schema.Number; devtools: Schema.Struct<{ latchClosed: typeof Schema.Boolean; }>; }>, typeof Schema.Never>; export declare class LeaderWorkerInnerNetworkStatusStream extends LeaderWorkerInnerNetworkStatusStream_base { } declare const LeaderWorkerInnerShutdown_base: Schema.TaggedRequestClass; }, typeof Schema.Void, typeof Schema.Never>; export declare class LeaderWorkerInnerShutdown extends LeaderWorkerInnerShutdown_base { } declare const LeaderWorkerInnerExtraDevtoolsMessage_base: Schema.TaggedRequestClass; } & { message: Schema.Union<[typeof Devtools.Leader.SnapshotReq, Schema.TaggedStruct<"LSD.Leader.LoadDatabaseFile.Request", { data: Schema.Schema>; batchId: Schema.optional; } & { readonly requestId: typeof Schema.String; readonly liveStoreVersion: typeof Schema.String; readonly clientId: typeof Schema.String; }>, typeof Devtools.Leader.EventlogReq, Schema.TaggedStruct<"LSD.Leader.ResetAllData.Request", { mode: Schema.Literal<["all-data", "only-app-db"]>; } & { readonly requestId: typeof Schema.String; readonly liveStoreVersion: typeof Schema.String; readonly clientId: typeof Schema.String; }>, typeof Devtools.Leader.NetworkStatusSubscribe, typeof Devtools.Leader.NetworkStatusUnsubscribe, typeof Devtools.Leader.Disconnect, typeof Devtools.Leader.CommitEventReq, typeof Devtools.Leader.Ping, typeof Devtools.Leader.DatabaseFileInfoReq, typeof Devtools.Leader.SyncHistorySubscribe, typeof Devtools.Leader.SyncHistoryUnsubscribe, typeof Devtools.Leader.SyncingInfoReq, typeof Devtools.Leader.SyncHeadSubscribe, typeof Devtools.Leader.SyncHeadUnsubscribe, Schema.TaggedStruct<"LSD.Leader.SetSyncLatch.Request", { closeLatch: typeof Schema.Boolean; } & { readonly requestId: typeof Schema.String; readonly liveStoreVersion: typeof Schema.String; readonly clientId: typeof Schema.String; }>]>; }, typeof Schema.Void, typeof Schema.Never>; export declare class LeaderWorkerInnerExtraDevtoolsMessage extends LeaderWorkerInnerExtraDevtoolsMessage_base { } export declare const LeaderWorkerInnerRequest: Schema.Union<[typeof LeaderWorkerInnerInitialMessage, typeof LeaderWorkerInnerBootStatusStream, typeof LeaderWorkerInnerPushToLeader, typeof LeaderWorkerInnerPullStream, typeof LeaderWorkerInnerStreamEvents, typeof LeaderWorkerInnerExport, typeof LeaderWorkerInnerExportEventlog, typeof LeaderWorkerInnerGetRecreateSnapshot, typeof LeaderWorkerInnerGetLeaderHead, typeof LeaderWorkerInnerGetLeaderSyncState, typeof LeaderWorkerInnerSyncStateStream, typeof LeaderWorkerInnerGetNetworkStatus, typeof LeaderWorkerInnerNetworkStatusStream, typeof LeaderWorkerInnerShutdown, typeof LeaderWorkerInnerExtraDevtoolsMessage, typeof WebmeshWorker.Schema.CreateConnection]>; export type LeaderWorkerInnerRequest = typeof LeaderWorkerInnerRequest.Type; declare const SharedWorkerUpdateMessagePort_base: Schema.TaggedRequestClass; } & { port: Schema.Schema; liveStoreVersion: Schema.Literal<[string]>; /** * Initial configuration for the leader worker. This replaces the previous * two-phase SharedWorker handshake and is sent under the tab lock by the * elected leader. Subsequent calls can omit changes and will simply rebind * the port (join) without reinitializing the store. */ initial: typeof LeaderWorkerInnerInitialMessage; }, typeof Schema.Void, typeof UnknownError>; export declare class SharedWorkerUpdateMessagePort extends SharedWorkerUpdateMessagePort_base { } export declare const SharedWorkerRequest: Schema.Union<[typeof SharedWorkerUpdateMessagePort, typeof LeaderWorkerInnerBootStatusStream, typeof LeaderWorkerInnerPushToLeader, typeof LeaderWorkerInnerPullStream, typeof LeaderWorkerInnerStreamEvents, typeof LeaderWorkerInnerExport, typeof LeaderWorkerInnerGetRecreateSnapshot, typeof LeaderWorkerInnerExportEventlog, typeof LeaderWorkerInnerGetLeaderHead, typeof LeaderWorkerInnerGetLeaderSyncState, typeof LeaderWorkerInnerSyncStateStream, typeof LeaderWorkerInnerGetNetworkStatus, typeof LeaderWorkerInnerNetworkStatusStream, typeof LeaderWorkerInnerShutdown, typeof LeaderWorkerInnerExtraDevtoolsMessage, typeof WebmeshWorker.Schema.CreateConnection]>; export type SharedWorkerRequest = typeof SharedWorkerRequest.Type; export {}; //# sourceMappingURL=worker-schema.d.ts.map