import { NgZone, OnDestroy } from '@angular/core';
import { Any, PlainObject } from '@angular-ru/cdk/typings';
import { Observable, ReplaySubject, Subject } from 'rxjs';
import { WebsocketHandler } from '../interfaces/websocket-handler';
import { WebsocketMessage } from '../interfaces/websocket-message';
import { WebsocketConfig } from './websocket-config';
import * as i0 from "@angular/core";
declare type WebSocketMessage = string | ArrayBuffer | Blob | ArrayBufferView;
export declare const PLAIN_TEXT: PlainObject;
export declare const BINARY: PlainObject;
export declare abstract class AbstractWebsocketClient<K extends string | PlainObject> implements WebsocketHandler<K>, OnDestroy {
    private readonly wsConfig;
    private readonly ngZone;
    private connected;
    private socket$;
    private socketSubscription;
    private handlerPath;
    protected readonly messages$: Subject<WebsocketMessage<K, Any>>;
    connected$: ReplaySubject<Event>;
    disconnected$: ReplaySubject<Event>;
    destroy$: Subject<boolean>;
    protected constructor(wsConfig: WebsocketConfig, ngZone: NgZone);
    get isConnected(): boolean;
    get isDisconnected(): boolean;
    get connectionPath(): string;
    private get webSocketSubjectConfig();
    private static isArrayBuffer;
    abstract get baseUrl(): string;
    onConnected(_event?: Event): void;
    onDisconnected(_event?: Event): void;
    connect(path: string): void;
    disconnect(): void;
    on<T = void>(type: K): Observable<T>;
    single<T = void>(type: K): Observable<T>;
    sendMessage<T>(type: K, data: T): void;
    ngOnDestroy(): void;
    protected serialize(message: WebsocketMessage<K, Any>): WebSocketMessage;
    protected deserialize({ data }: MessageEvent): WebsocketMessage<Any, Any>;
    private onOpenObserver;
    private onCloseObserver;
    private _connect;
    private reconnect;
    private completeStoppedSocket;
    private socketUnsubscribe;
    static ɵfac: i0.ɵɵFactoryDeclaration<AbstractWebsocketClient<any>, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AbstractWebsocketClient<any>>;
}
export {};
//# sourceMappingURL=abstract-websocket.client.d.ts.map