import type { EventContent, TrustedEvent, EventTemplate } from "./Events.js"; export type Encrypt = (x: string) => Promise; export type EncryptableUpdates = Partial; export type DecryptedEvent = TrustedEvent & { plaintext: EncryptableUpdates; }; export declare const asDecryptedEvent: (event: TrustedEvent, plaintext?: EncryptableUpdates) => DecryptedEvent; /** * Represents an encryptable event with optional updates. */ export declare class Encryptable { readonly event: Partial; readonly updates: EncryptableUpdates; /** * Creates an instance of Encryptable. * @param event - An EventTemplate with optional tags and content. * @param updates - Plaintext updates to be applied to the event content. * @example * Here's an example which enables updating a private mute list: * ``` * const event = {kind: 10000, content: "", tags: []} // An event, only kind is required * const encryptable = new Encryptable(event, {content: JSON.stringify([["e", "bad word"]])}) * const eventTemplate = await encryptable.reconcile(myEncryptFunction) * ``` */ constructor(event: Partial, updates: EncryptableUpdates); /** * Encrypts plaintext updates and merges them into the event template. * @param encrypt - The encryption function to be used. * @returns A promise that resolves to the reconciled and encrypted event. */ reconcile(encrypt: Encrypt): Promise; } //# sourceMappingURL=Encryptable.d.ts.map