import { Patient } from '../../icc-api/model/Patient';
import { AbstractFilter } from '../filters/filters';
import { User } from '../../icc-api/model/User';
import { IccAuthApi } from '../../icc-api';
import { Service } from '../../icc-api/model/Service';
import { HealthElement } from '../../icc-api/model/HealthElement';
import { MaintenanceTask } from '../../icc-api/model/MaintenanceTask';
import { HealthcareParty } from '../../icc-api/model/HealthcareParty';
import { Device } from '../../icc-api/model/Device';
import { Contact } from '../../icc-api/model/Contact';
import { Message } from '../../icc-api/model/Message';
import { Topic } from '../../icc-api/model/Topic';
export type EventTypes = 'CREATE' | 'UPDATE' | 'DELETE';
export type SubscriptionOptions = {
    connectionMaxRetry?: number;
    connectionRetryIntervalMs?: number;
    debug?: boolean;
};
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'Patient', eventTypes: EventTypes[], filter: AbstractFilter<Patient> | undefined, eventFired: (entity: Patient) => Promise<void>, options: SubscriptionOptions, decryptor: (encrypted: Patient) => Promise<Patient>): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'Service', eventTypes: EventTypes[], filter: AbstractFilter<Service> | undefined, eventFired: (entity: Service) => Promise<void>, options: SubscriptionOptions, decryptor: (encrypted: Service) => Promise<Service>): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'Contact', eventTypes: EventTypes[], filter: AbstractFilter<Contact> | undefined, eventFired: (entity: Contact) => Promise<void>, options: SubscriptionOptions, decryptor: (encrypted: Contact) => Promise<Contact>): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'HealthElement', eventTypes: EventTypes[], filter: AbstractFilter<HealthElement> | undefined, eventFired: (entity: HealthElement) => Promise<void>, options: SubscriptionOptions, decryptor: (encrypted: HealthElement) => Promise<HealthElement>): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'Message', eventTypes: EventTypes[], filter: AbstractFilter<Message> | undefined, eventFired: (entity: Message) => Promise<void>, options: SubscriptionOptions, decryptor: (encrypted: Message) => Promise<Message>): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'Topic', eventTypes: EventTypes[], filter: AbstractFilter<Topic> | undefined, eventFired: (entity: Topic) => Promise<void>, options: SubscriptionOptions, decryptor: (encrypted: Topic) => Promise<Topic>): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'User', eventTypes: EventTypes[], filter: AbstractFilter<User> | undefined, eventFired: (entity: User) => Promise<void>, options: SubscriptionOptions): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'MaintenanceTask', eventTypes: EventTypes[], filter: AbstractFilter<MaintenanceTask> | undefined, eventFired: (entity: MaintenanceTask) => Promise<void>, options: SubscriptionOptions, decryptor: (encrypted: MaintenanceTask) => Promise<MaintenanceTask>): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'HealthcareParty', eventTypes: EventTypes[], filter: AbstractFilter<HealthcareParty> | undefined, eventFired: (entity: HealthcareParty) => Promise<void>, options: SubscriptionOptions): Promise<WebSocketWrapper>;
export declare function subscribeToEntityEvents(basePath: string, authApi: IccAuthApi, entityClass: 'Device', eventTypes: EventTypes[], filter: AbstractFilter<Device> | undefined, eventFired: (entity: Device) => Promise<void>, options: SubscriptionOptions): Promise<WebSocketWrapper>;
export type ConnectionStatus = 'NOT_CONNECTED' | 'CONNECTED' | 'CLOSED' | 'ERROR';
export type StatusCallback = (ws: WebSocketWrapper) => void;
export type ErrorStatusCallback = (ws: WebSocketWrapper, error?: Error) => void;
export type ConnectionStatusFunction = {
    [K in ConnectionStatus]: K extends 'ERROR' ? ErrorStatusCallback : StatusCallback;
};
export type ConnectionStatusFunctions = {
    [K in ConnectionStatus]?: K extends 'ERROR' ? Array<ErrorStatusCallback> : Array<StatusCallback>;
};
export type WebSocketWrapperMessageCallback = (data: any) => void;
export declare class WebSocketWrapper {
    private readonly url;
    private readonly authProvider;
    private readonly maxRetries;
    private readonly retryDelay;
    private readonly statusCallbacks;
    private readonly messageCallback;
    private readonly debug;
    private readonly pingLifetime;
    private socket;
    private retries;
    private closed;
    private lastPingReceived;
    private intervalIds;
    private readonly methodPath;
    private constructor();
    static create(url: string, authProvider: WebSocketAuthProvider, maxRetries?: number, retryDelay?: number, statusCallbacks?: ConnectionStatusFunctions, messageCallback?: WebSocketWrapperMessageCallback, debug?: boolean): Promise<WebSocketWrapper>;
    send(data: Buffer | ArrayBuffer | string): void;
    close(): void;
    addStatusCallback(status: ConnectionStatus, callback: ConnectionStatusFunction[ConnectionStatus]): void;
    private connect;
    private callStatusCallbacks;
}
interface WebSocketAuthProvider {
    getBearerToken(): Promise<string | undefined>;
}
export {};
