import { EventEmitter } from './emitter.js';
import { NostrSocket } from './socket.js';
import { EventFilter, EventMessage, SubscribeConfig } from '../types.js';
import { SignedEvent } from '../../types/index.js';
export declare class NostrSub extends EventEmitter<{
    'cancel': NostrSub;
    'event': SignedEvent;
    'message': EventMessage;
    'ready': NostrSub;
}> {
    readonly _echo: boolean;
    readonly _socket: NostrSocket;
    readonly _sub_id: string;
    _envelope: Partial<SignedEvent>;
    _filter: EventFilter;
    _init: boolean;
    constructor(socket: NostrSocket, config: SubscribeConfig);
    get envelope(): Partial<SignedEvent>;
    get filter(): EventFilter;
    get id(): string;
    get is_echo(): boolean;
    get is_ready(): boolean;
    cancel(): void;
    on_msg<T>(subject: string, handler: (msg: EventMessage<T>) => void | Promise<void>): void;
    send<T>(subject: string, body: T, envelope?: Partial<SignedEvent>, recovery?: boolean): Promise<unknown>;
    update(filter?: EventFilter): Promise<NostrSub>;
    when_cancel(): Promise<unknown>;
    when_ready(): Promise<unknown>;
}
