/**
 * Event-log encryption primitives for encrypted remote replication.
 *
 * This module defines the `EventLogEncryption` service used by encrypted
 * `EventLogRemote` clients to turn local journal entries into encrypted remote
 * payloads, decrypt encrypted changes received from a server, hash byte data,
 * and create event-log identities. It is useful when events need to be
 * replicated through infrastructure that stores or transports only ciphertext,
 * such as an encrypted event-log server, offline-first synchronization backend,
 * or multi-device replicated store.
 *
 * Encryption keys are deterministically derived from the identity private key
 * material, so the same stable identity is required to decrypt entries across
 * sessions and devices. The public key identifies the replicated log, while the
 * private key material must remain secret and must not be rotated without a
 * migration plan for existing encrypted entries. The default implementation
 * uses Web Crypto AES-GCM with generated initialization vectors that are stored
 * alongside encrypted entries; persisted ciphertext, IVs, entry schemas, and
 * identity key derivation labels are part of the compatibility surface for
 * future event-log encryption versions.
 *
 * @since 4.0.0
 */
import * as Context from "../../Context.ts";
import * as Effect from "../../Effect.ts";
import * as Layer from "../../Layer.ts";
import * as Schema from "../../Schema.ts";
import * as Transferable from "../workers/Transferable.ts";
import { Entry, RemoteEntry } from "./EventJournal.ts";
import type { Identity } from "./EventLog.ts";
/**
 * Schema for an encrypted journal entry paired with the id of the original
 * entry.
 *
 * @category models
 * @since 4.0.0
 */
export declare const EncryptedEntry: Schema.Struct<{
    readonly entryId: Schema.brand<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, "effect/eventlog/EventJournal/EntryId">;
    readonly encryptedEntry: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
}>;
/**
 * Type of an encrypted remote entry, including its remote sequence number,
 * initialization vector, entry id, and encrypted entry bytes.
 *
 * @category models
 * @since 4.0.0
 */
export interface EncryptedRemoteEntry extends Schema.Schema.Type<typeof EncryptedRemoteEntry> {
}
/**
 * Schema for encrypted entries exchanged with a remote event-log server.
 *
 * @category models
 * @since 4.0.0
 */
export declare const EncryptedRemoteEntry: Schema.Struct<{
    readonly sequence: Schema.Number;
    readonly iv: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
    readonly entryId: Schema.brand<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, "effect/eventlog/EventJournal/EntryId">;
    readonly encryptedEntry: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
}>;
declare const EventLogEncryption_base: Context.ServiceClass<EventLogEncryption, "effect/eventlog/EventLogEncryption", {
    readonly encrypt: (identity: Identity["Service"], entries: ReadonlyArray<Entry>) => Effect.Effect<{
        readonly iv: Uint8Array<ArrayBuffer>;
        readonly encryptedEntries: ReadonlyArray<Uint8Array<ArrayBuffer>>;
    }>;
    readonly decrypt: (identity: Identity["Service"], entries: ReadonlyArray<EncryptedRemoteEntry>) => Effect.Effect<Array<RemoteEntry>>;
    readonly sha256String: (data: Uint8Array) => Effect.Effect<string>;
    readonly sha256: (data: Uint8Array) => Effect.Effect<Uint8Array>;
    readonly generateIdentity: Effect.Effect<Identity["Service"]>;
}>;
/**
 * Service that provides identity generation, entry
 * encryption and decryption, and SHA-256 hashing for event-log replication.
 *
 * **When to use**
 *
 * Use to provide cryptographic operations required by encrypted event-log
 * replication.
 *
 * @category services
 * @since 4.0.0
 */
export declare class EventLogEncryption extends EventLogEncryption_base {
}
/**
 * Creates an `EventLogEncryption` service backed by the Web Crypto `SubtleCrypto`
 * APIs from the supplied `Crypto` implementation.
 *
 * @category encryption
 * @since 4.0.0
 */
export declare const makeEncryptionSubtle: (crypto: Crypto) => Effect.Effect<EventLogEncryption["Service"]>;
/**
 * Provides `EventLogEncryption` using `globalThis.crypto`.
 *
 * @category encryption
 * @since 4.0.0
 */
export declare const layerSubtle: Layer.Layer<EventLogEncryption>;
export {};
//# sourceMappingURL=EventLogEncryption.d.ts.map