import { SignerAPI } from '../../types/index.js';
import { EventEmitter } from './emitter.js';
import { NostrSocket } from './socket.js';
import { EventMessage, StoreConfig } from '../types.js';
interface EventBus<T extends Record<string, any>> {
    error: Error;
    ready: NostrStore<T>;
    update: NostrStore<T>;
}
export declare class NostrStore<T extends Record<string, any>> {
    readonly _emitter: EventEmitter<EventBus<T>>;
    readonly _opt: StoreConfig<T>;
    readonly _parser: (data: unknown) => Promise<T>;
    _buffer?: ReturnType<typeof setTimeout>;
    _commit_id: string | null;
    _data: T | null;
    _init: boolean;
    _prev: T | null;
    _socket: NostrSocket;
    _updated_at: number | null;
    constructor(signer: SignerAPI, config?: Partial<StoreConfig<T>>);
    get data(): T;
    get hash(): string;
    get is_init(): boolean;
    get is_ready(): boolean;
    get is_stale(): boolean;
    get opt(): StoreConfig<T>;
    get pubkey(): string;
    get socket(): NostrSocket;
    get store(): Map<string, any>;
    get updated_at(): number;
    _filter(msg: EventMessage): boolean;
    _validate(data: T): Promise<boolean>;
    _send(method: string, data: unknown): Promise<unknown>;
    _req_handler(msg: EventMessage): Promise<void>;
    _err_handler(err: unknown): Promise<void>;
    _patch_handler(data: Partial<T>): Promise<void>;
    _post_handler(data: Partial<T>): Promise<void>;
    _update_handler(data: unknown): Promise<void>;
    debug(...s: unknown[]): void | null;
    info(...s: unknown[]): void | null;
    emit<K extends keyof EventBus<T>>(event: K, args: EventBus<T>[K]): void;
    on<K extends keyof EventBus<T>>(event: K, handler: (data: EventBus<T>[K]) => void | Promise<void>): void;
    connect(address: string, secret: string): Promise<unknown>;
    init(address: string, secret: string, store: T): Promise<this>;
    refresh(): Promise<T>;
    patch(data: Partial<T>): Promise<this>;
    post(data: T): Promise<this>;
    keys(): IterableIterator<string>;
    values(): IterableIterator<any>;
    entries(): IterableIterator<[string, any]>;
    toString(): string;
    toJSON(): T;
    [Symbol.iterator](): IterableIterator<[string, any]>;
}
export {};
