import { EventSigner } from "./types.js"; import type { EventOperation } from "./types.js"; import { EncryptionMethod } from "../helpers/encrypted-content.js"; import { KnownEvent, KnownEventTemplate, KnownUnsignedEvent } from "../helpers/event.js"; import { MetaTagOptions } from "../operations/event.js"; import { modifyHiddenTags, modifyPublicTags, modifyTags } from "../operations/tags.js"; /** Creates a blank event template with the given kind and random "d" tag if addressable */ export declare function blankEventTemplate(kind: K): KnownEventTemplate; /** Converts a nostr event to an event template and updates the created_at timestamp */ export declare function toEventTemplate(event: KnownEvent): KnownEventTemplate; /** Shared mutable signer container passed through the factory chain */ type SignerRef = { signer?: EventSigner; }; /** The base class for building or modifying events */ export declare class EventFactory = KnownEventTemplate> extends Promise { /** Create a new event factory from a kind */ static fromKind(kind: K): EventFactory; /** Create a new event factory from a nostr event */ static fromEvent(event: KnownEvent): EventFactory>; /** Shared mutable reference to the signer, propagated through all chain links */ protected _signerRef: SignerRef; /** The signer used to sign the event (reads from shared ref) */ protected get signer(): EventSigner | undefined; protected set signer(value: EventSigner | undefined); /** Custom .then method that wraps the resulting promise in a new event factory */ protected chain(operation: EventOperation): this; /** Sets the event signer to use when building this event */ as(signer: EventSigner): this; /** Strips the pubkey, sig, and id from the event */ strip(): EventFactory; /** Stamps the pubkey onto the event template */ stamp(signer?: EventSigner | undefined): EventFactory>; /** Signs the event using a signer interface and returns a Promise */ sign(signer?: EventSigner | undefined): Promise>; /** Sets the event kind and casts the result to a {@link KnownEventTemplate} */ kind(kind: Kind): EventFactory>; /** Sets the event content */ content(content: string): this; /** Set the event created_at timestamp in seconds. if no value is provided, the current unix timestamp will be used */ created(created?: number | Date): this; /** Sets the meta tags for the event */ meta(options: MetaTagOptions): this; /** Sets the NIP-31 alt tag for the event */ alt(alt: string): this; /** Sets the NIP-40 expiration timestamp for the event */ expiration(timestamp: number): this; /** Sets the NIP-36 content-warning tag for the event */ contentWarning(warning: string | boolean): this; /** Sets the NIP-70 "-" tag for the event */ protected(isProtected: boolean): this; /** Modifies the events public and optional hidden tags */ modifyTags(...args: Parameters): this; /** Modifies the events public tags array */ modifyPublicTags(...args: Parameters): this; /** Modifies the events hidden tags array */ modifyHiddenTags(...args: Exclude[1], undefined>[]): this; /** Sets the encrypted content of the event */ encryptedContent(target: string, content: string, override?: EncryptionMethod): this; } export {};