import { kinds, NostrEvent } from "nostr-tools";
import { EncryptedContentSigner, UnlockedEncryptedContent } from "./encrypted-content.js";
import { KnownEvent } from "./index.js";
/** Type for valid legacy direct messages */
export type LegacyMessage = KnownEvent<kinds.EncryptedDirectMessage>;
/** Type for a legacy direct message with unlocked encrypted content */
export type UnlockedLegacyMessage = LegacyMessage & UnlockedEncryptedContent;
/** Checks if a legacy direct message content is encrypted */
export declare function isLegacyMessageUnlocked<T extends NostrEvent>(event: T): event is T & UnlockedEncryptedContent;
/** Returns the correspondent of a legacy direct message */
export declare function getLegacyMessageCorrespondent<T extends LegacyMessage>(message: T, self: string): string;
export declare function getLegacyMessageCorrespondent<T extends NostrEvent>(message: T, self: string): string | undefined;
/** Returns the receiver of a legacy direct me */
export declare const getLegacyMessageReceiver: typeof getLegacyMessageCorrespondent;
/** @deprecated use {@link getLegacyMessageCorrespondent} instead */
export declare const getLegacyMessageCorraspondant: typeof getLegacyMessageCorrespondent;
/** Returns the sender of a legacy direct message */
export declare function getLegacyMessageSender(message: NostrEvent): string;
/** Returns the parent message id of a legacy message */
export declare function getLegacyMessageParent(message: NostrEvent): string | undefined;
/** Checks if a legacy message is valid */
export declare function isValidLegacyMessage(event: any): event is LegacyMessage;
/**
 * Returns the decrypted content of a direct message
 * @param message - The message to decrypt
 * @param self - The public key of the user
 * @param signer - The signer to use to decrypt the message
 * @returns The decrypted content of the message
 */
export declare function unlockLegacyMessage(message: NostrEvent, self: string, signer: EncryptedContentSigner): Promise<string>;
/** Clears the cached plaintext of a direct message */
export declare function lockLegacyMessage(message: NostrEvent): Promise<void>;
