import 'websocket-polyfill';
import { Buff } from '@cmdcode/buff';
import { SignedEvent } from '@cmdcode/signer';
import { EventEmitter } from './emitter.js';
import { SignedNote, SignerAPI } from '@scrow/core';
import { EventMessage, SocketConfig } from '../types.js';
export declare const SOCKET_DEFAULTS: () => SocketConfig;
export declare class NostrSocket extends EventEmitter<{
    'close': string | undefined;
    'echo': string;
    'eose': string;
    'error': Error;
    'event': EventMessage;
    'notice': string;
    'ready': NostrSocket;
    'reject': [reason: string, envelope: unknown];
    'receipt': [id: string, ok: boolean, reason: string];
}> {
    readonly _filter: Record<string, any>;
    readonly _opt: SocketConfig;
    readonly _signer: SignerAPI;
    readonly _tags: string[][];
    _relay?: string;
    _secret?: Buff;
    _socket?: WebSocket;
    _subbed: boolean;
    _sub_id: string;
    constructor(signer: SignerAPI, options?: Partial<SocketConfig>);
    get channel_id(): string;
    get filter(): Record<string, any>;
    get is_ready(): boolean;
    get is_connected(): boolean;
    get is_subscribed(): boolean;
    get opt(): SocketConfig;
    get pubkey(): string;
    get relay(): string;
    get secret(): Buff;
    get socket(): WebSocket;
    get tags(): string[][];
    debug(...s: unknown[]): void | null;
    info(...s: unknown[]): void | null;
    subscribe(): Promise<void>;
    connect(address?: string, secret?: string): Promise<unknown>;
    _err_handler(err: unknown): void;
    _msg_handler(msg: any): void;
    _open_handler(_event: unknown): Promise<void>;
    _evt_handler(event: unknown): Promise<void>;
    sign(event: Partial<SignedEvent>): SignedEvent;
    on_event(subject: string, handler: (msg: EventMessage) => void | Promise<void>): void;
    delete(id: string): void;
    send(subject: string, body: unknown, envelope?: Partial<SignedEvent>): Promise<unknown>;
    publish(event: SignedNote): void;
    close(reason?: string): void;
}
