import { OnDestroy } from '@angular/core';
import { AuthService } from './auth.service';
import { CookieService } from './cookie.service';
import { SeniorTokenService } from './senior-token.service';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
export interface WebSocketConfig {
    /** Domínio do serviço (ex: 'crmx') */
    domain: string;
    /** Nome do serviço (ex: 'schedule') */
    service: string;
    /** Primitiva/entidade (ex: 'appointment') */
    primitive: string;
    /** Se true, inclui o token do usuário no bind para receber mensagens específicas do usuário */
    userScoped?: boolean;
}
export interface StompMessage<T = any> {
    /** Destino/tópico da mensagem */
    destination: string;
    /** Corpo da mensagem parseado */
    body: T;
    /** Headers da mensagem STOMP */
    headers: Record<string, string>;
}
type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
export declare class WebSocketService implements OnDestroy {
    private authService;
    private cookieService;
    private seniorTokenService;
    private client;
    private readonly destroy$;
    private readonly messages$;
    private readonly connectionState$;
    private stompSubscriptions;
    private pendingSubscriptions;
    private subscriptionCounter;
    private reconnectAttempts;
    private readonly maxReconnectAttempts;
    constructor(authService: AuthService, cookieService: CookieService, seniorTokenService: SeniorTokenService);
    /** Estado atual da conexão */
    get state$(): Observable<ConnectionState>;
    /** Conecta ao WebSocket usando a URL base do cookie */
    connect(): void;
    /** Desconecta do WebSocket */
    disconnect(): void;
    /**
     * Inscreve-se em um tópico baseado na configuração.
     * Padrão do bind: /topic/{tenantDomain}/{token}/{domain}/{service}/{primitive}
     */
    subscribe<T = any>(config: WebSocketConfig): Observable<StompMessage<T>>;
    /** Remove a inscrição de um tópico */
    unsubscribe(config: WebSocketConfig): void;
    ngOnDestroy(): void;
    private buildConnectHeaders;
    private buildWebSocketUrl;
    private buildDestination;
    private onConnected;
    private onDisconnected;
    private doSubscribe;
    static ɵfac: i0.ɵɵFactoryDeclaration<WebSocketService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<WebSocketService>;
}
export {};
