import * as Context from "../Context.ts"; import * as Effect from "../Effect.ts"; import * as Layer from "../Layer.ts"; import * as RpcServer from "../rpc/RpcServer.ts"; import type * as Scope from "../Scope.ts"; import * as Stream from "../Stream.ts"; import { type EntryId, type RemoteId } from "./EventJournal.ts"; import type { EncryptedBatch, EncryptedRemoteBatch } from "./EventLogEncryption.ts"; import { type StoreId, type WriteAck } from "./EventLogMessage.ts"; /** * Provides RPC handlers for the encrypted event-log server. * * **Details** * * Decodes and persists writes through `Storage`, acknowledging their stored * sequences. Change streams encode stored batches, excluding this connection's * writes. * * @stability unstable * @category layers * @since 4.0.0 */ export declare const layerRpcHandlers: Layer.Layer | import("../rpc/Rpc.ts").Handler<"EventLog.Changes"> | import("../rpc/Rpc.ts").Handler<"EventLog.Hello"> | import("../rpc/Rpc.ts").Handler<"EventLog.WriteChunked"> | import("../rpc/Rpc.ts").Handler<"EventLog.WriteSingle">, never, Storage>; /** * Provides an encrypted event-log RPC server using `EventLogRemoteRpcs` and the * encrypted server RPC handlers. * * **When to use** * * Use when you need an encrypted event-log RPC server for encrypted * `EventLogRemote` replication over an existing `RpcServer.Protocol`. * * **Details** * * This layer installs `EventLogRemoteRpcs` on the provided RPC server protocol * and wires those RPCs to `layerRpcHandlers`. Encrypted batches, session * authentication bindings, remote ids, and change streams are delegated to * `Storage`. * * @see {@link layerRpcHandlers} for the encrypted handler layer without installing an RPC server protocol * @see {@link Storage} for the storage service required by this layer * @see {@link layerStorageMemory} for the process-local in-memory storage layer * * @stability unstable * @category layers * @since 4.0.0 */ export declare const layer: Layer.Layer; declare const Storage_base: Context.ServiceClass; /** * Lowest assigned sequence (default 0). Overestimating skips entries. */ readonly firstSequence?: number | undefined; readonly getOrCreateSessionAuthBinding: (publicKey: string, signingPublicKey: Uint8Array) => Effect.Effect>; readonly write: (publicKey: string, storeId: StoreId, batches: ReadonlyArray) => Effect.Effect>; readonly entrySequences: (publicKey: string, storeId: StoreId, entryIds: ReadonlyArray) => Effect.Effect>; readonly changes: (publicKey: string, storeId: StoreId, startSequence: number) => Stream.Stream; }>; /** * Defines the backing store service used by the encrypted event-log server. * * **When to use** * * Use to provide durable encrypted event-log persistence for an encrypted * event-log server layer. * * **Details** * * It provides the server remote id, stores session authentication bindings, * persists encrypted batches, and streams encrypted changes for a public key and * store id. * * A batch owns one remote sequence per entry, starting at its `sequence`. * `write` stores a batch unless every one of its entry ids is already stored, * which makes retried writes idempotent, and returns the batches it stored. * `entrySequences` returns the sequence each entry was first stored at, so * skipped batches can still be acknowledged. `changes` streams every batch * whose last sequence is at or after `startSequence`, followed by newly stored * batches. * * @stability unstable * @category services * @since 4.0.0 */ export declare class Storage extends Storage_base { } /** * Creates an in-memory encrypted server `Storage`. * * **Details** * * Data, session authentication bindings, and streams are process-local and are * released with the surrounding scope. * * @stability unstable * @category constructors * @since 4.0.0 */ export declare const makeStorageMemory: Effect.Effect; /** * Provides encrypted server `Storage` using the in-memory implementation. * * @stability unstable * @category layers * @since 4.0.0 */ export declare const layerStorageMemory: Layer.Layer; export {}; //# sourceMappingURL=EventLogServerEncrypted.d.ts.map