import { EventEmitter } from './emitter.js';
import { NostrSub } from './sub.js';
import { NostrSocket } from './socket.js';
import { EventMessage, StoreConfig } from '../types.js';
export declare class NostrStore<T extends Record<string, any>> extends EventEmitter<{
    'commit': string;
    'error': Error;
    'ready': NostrStore<T>;
    'reject': EventMessage<T>;
    'update': NostrStore<T>;
}> {
    readonly _opt: StoreConfig<T>;
    readonly _parser: (data: unknown) => Promise<T>;
    _buffer?: ReturnType<typeof setTimeout>;
    _commit_id: string | null;
    _data: T | null;
    _init: boolean;
    _outbox?: ReturnType<typeof setTimeout>;
    _prev: T | null;
    _socket: NostrSocket;
    _sub: NostrSub | null;
    _updated: number | null;
    constructor(socket: NostrSocket, config?: Partial<StoreConfig<T>>);
    get commit_id(): string;
    get data(): T;
    get is_ready(): boolean;
    get is_stale(): boolean;
    get opt(): StoreConfig<T>;
    get pubkey(): string;
    get socket(): NostrSocket;
    get store(): Map<string, any>;
    get store_id(): string;
    get sub(): NostrSub;
    get updated_at(): number;
    log: {
        debug: (...s: unknown[]) => void | null;
        info: (...s: unknown[]) => void | null;
    };
    _bounce_handler(msg: EventMessage<T>): void;
    _err_handler(err: unknown): Promise<void>;
    _initialize(data: T): void;
    _msg_filter(msg: EventMessage): boolean;
    _msg_handler(msg: EventMessage): Promise<void>;
    _msg_update(data: unknown, created_at: number): Promise<void>;
    _send(method: string, data: unknown): Promise<void>;
    _update(data: T, updated?: number): void;
    _validate(data: T): Promise<boolean>;
    connect(address: string, secret: string): Promise<this>;
    init(address: string, secret: string, store: T): Promise<this>;
    on_update(): Promise<unknown>;
    refresh(): Promise<unknown>;
    keys(): IterableIterator<string>;
    values(): IterableIterator<any>;
    entries(): IterableIterator<[string, any]>;
    toString(): string;
    toJSON(): T;
    [Symbol.iterator](): IterableIterator<[string, any]>;
}
