import { EventTemplate } from "nostr-tools";
import { Deferred } from "applesauce-core/promise";
import { ISigner } from "../interop.js";
/** A NIP-49 (Private Key Encryption) signer */
export declare class PasswordSigner implements ISigner {
    key: Uint8Array | null;
    ncryptsec?: string;
    nip04: {
        encrypt: (pubkey: string, plaintext: string) => Promise<string>;
        decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
    };
    nip44: {
        encrypt: (pubkey: string, plaintext: string) => Promise<string>;
        decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
    };
    get unlocked(): boolean;
    constructor();
    unlockPromise?: Deferred<void>;
    protected requestUnlock(): Deferred<void> | undefined;
    /** Sets the ncryptsec from the key and password */
    setPassword(password: string): Promise<void>;
    /** Tests if the provided password is correct by decrypting the ncryptsec */
    testPassword(password: string): Promise<void>;
    /** Unlocks the signer by decrypting the ncryptsec using the provided password */
    unlock(password: string): Promise<void>;
    /** Locks the signer by removing the unencrypted key from memory */
    lock(): void;
    getPublicKey(): Promise<string>;
    signEvent(event: EventTemplate): Promise<import("nostr-tools").VerifiedEvent>;
    nip04Encrypt(pubkey: string, plaintext: string): Promise<string>;
    nip04Decrypt(pubkey: string, ciphertext: string): Promise<string>;
    nip44Encrypt(pubkey: string, plaintext: string): Promise<string>;
    nip44Decrypt(pubkey: string, ciphertext: string): Promise<string>;
    /** Creates a PasswordSigner from a hex private key or NIP-19 nsec and password */
    static fromPrivateKey(privateKey: Uint8Array | string, password: string): Promise<PasswordSigner>;
    /** Creates a PasswordSigner from a ncryptsec and unlocks it with the provided password */
    static fromNcryptsec(ncryptsec: string, password?: string): Promise<PasswordSigner>;
}
