import { kinds, NostrEvent, UnsignedEvent } from "nostr-tools";
import { EventMemory } from "../event-store/event-memory.js";
import { EncryptedContentSigner } from "./encrypted-content.js";
import { KnownEvent } from "./event.js";
/**
 * An internal event set to keep track of seals and rumors
 * This is intentionally isolated from the main applications event store so to prevent seals and rumors from being leaked
 */
export declare const internalGiftWrapEvents: EventMemory;
export type Rumor = UnsignedEvent & {
    id: string;
};
/** Used to store a reference to the seal event on gift wraps (downstream) or the seal event on rumors (upstream[]) */
export declare const SealSymbol: unique symbol;
/** Used to store a reference to the rumor on seals (downstream) */
export declare const RumorSymbol: unique symbol;
/** Used to store a reference to the parent gift wrap event on seals (upstream) */
export declare const GiftWrapSymbol: unique symbol;
/** A gift wrap event that knows its seal event */
export type UnlockedGiftWrapEvent = KnownEvent<kinds.GiftWrap> & {
    /** Downstream seal event */
    [SealSymbol]: UnlockedSeal;
};
/** A seal that knows its parent gift wrap event */
export type UnlockedSeal = KnownEvent<kinds.Seal> & {
    /** Upstream gift wrap event */
    [SealSymbol]: UnlockedGiftWrapEvent;
    /** Downstream rumor event */
    [RumorSymbol]: Rumor;
};
/** Checks if an event is a rumor (normal event with "id" and no "sig") */
export declare function isRumor(event: any): event is Rumor;
/** Returns all the parent gift wraps for a seal event */
export declare function getSealGiftWrap(seal: UnlockedSeal): UnlockedGiftWrapEvent;
export declare function getSealGiftWrap(seal: NostrEvent): UnlockedGiftWrapEvent | undefined;
/** Returns all the parent seals for a rumor event */
export declare function getRumorSeals(rumor: Rumor): UnlockedSeal[];
/** Returns all the parent gift wraps for a rumor event */
export declare function getRumorGiftWraps(rumor: Rumor): UnlockedGiftWrapEvent[];
/** Checks if a seal event is locked and casts it to the {@link UnlockedSeal} type */
export declare function isSealUnlocked(seal: NostrEvent): seal is UnlockedSeal;
/** Returns if a gift-wrap event or gift-wrap seal is locked */
export declare function isGiftWrapUnlocked(gift: NostrEvent): gift is UnlockedGiftWrapEvent;
/**
 * Gets the rumor from a seal event
 * @throws {Error} If the author of the rumor event does not match the author of the seal
 */
export declare function getSealRumor(seal: UnlockedSeal): Rumor;
export declare function getSealRumor(seal: NostrEvent): Rumor | undefined;
/** Returns the seal event in a gift-wrap -> seal (downstream) */
export declare function getGiftWrapSeal(gift: UnlockedGiftWrapEvent): UnlockedSeal;
export declare function getGiftWrapSeal(gift: NostrEvent): NostrEvent | undefined;
/** Returns the unsigned rumor in the gift-wrap -> seal -> rumor (downstream) */
export declare function getGiftWrapRumor(gift: UnlockedGiftWrapEvent): Rumor;
export declare function getGiftWrapRumor(gift: NostrEvent): Rumor | undefined;
/**
 * Unlocks a seal event and returns the rumor event
 * @throws {Error} If the author of the rumor event does not match the author of the seal
 */
export declare function unlockSeal(seal: NostrEvent, signer: EncryptedContentSigner): Promise<Rumor>;
/**
 * Unlocks and returns the unsigned seal event in a gift-wrap
 * @throws {Error} If the author of the rumor event does not match the author of the seal
 */
export declare function unlockGiftWrap(gift: NostrEvent, signer: EncryptedContentSigner): Promise<Rumor>;
/** Locks a gift-wrap event and seals its seal event */
export declare function lockGiftWrap(gift: NostrEvent): void;
