import * as WebSocket from "ws";
import { Message } from "./Messages/Message";
import { QueueMessageOptions, amqpqueue, amqpexchange, exchangealgorithm } from "./amqpwrapper";
import { User, QueuedMessage, TokenUser } from "@openiap/openflow-api";
import { ChangeStream } from "mongodb";
import { Span } from "@opentelemetry/api";
import { clientType } from "./Audit";
import express = require("express");
interface IHashTable<T> {
    [key: string]: T;
}
export declare class RegisterExchangeResponse {
    exchangename: string;
    queuename: string;
}
export declare class clsstream {
    stream: ChangeStream;
    id: string;
    callback: any;
    aggregates: object[];
    collectionname: string;
}
export declare class WebSocketServerClient {
    jwt: string;
    _socketObject: WebSocket;
    private _receiveQueue;
    private _sendQueue;
    messageQueue: IHashTable<QueuedMessage>;
    remoteip: string;
    clientagent: clientType;
    clientversion: string;
    created: Date;
    lastheartbeat: Date;
    lastheartbeatstr: string;
    lastheartbeatsec: string;
    metrics: string;
    id: string;
    user: User;
    username: string;
    _queues: amqpqueue[];
    _queuescounter: number;
    _queuescurrent: number;
    _queuescounterstr: string;
    _queuescurrentstr: string;
    _exchanges: amqpexchange[];
    devnull: boolean;
    private _message;
    private _error;
    private _close;
    private _amqpdisconnected;
    private _dbdisconnected;
    private _dbconnected;
    private init_complete;
    static remoteip(req: express.Request): string;
    Initialize(socketObject: WebSocket, req: express.Request): Promise<boolean>;
    private dbdisconnected;
    private dbconnected;
    private amqpdisconnected;
    private close;
    private error;
    queuecount(): number;
    connected(): boolean;
    ping(parent: Span): void;
    private message;
    CloseConsumers(parent: Span): Promise<void>;
    Close(parent: Span): Promise<void>;
    CloseConsumer(user: TokenUser | User, queuename: string, parent: Span): Promise<void>;
    RegisterExchange(user: TokenUser | User, exchangename: string, algorithm: exchangealgorithm, routingkey: string, addqueue: boolean, parent: Span): Promise<RegisterExchangeResponse>;
    CreateConsumer(queuename: string, parent: Span): Promise<string>;
    sleep(ms: any): Promise<unknown>;
    private ProcessQueue;
    Send<T>(message: Message, parent?: Span): Promise<T>;
    private _Send;
    chunkString(str: string, length: number): string[] | null;
    Queue(data: string, queuename: string, options: QueueMessageOptions, span: Span): Promise<any[]>;
    UnWatch(id: string, jwt: string): Promise<void>;
    watches: IHashTable<ClientWatch>;
    Watch(aggregates: object[], collectionname: string, jwt: string, id?: string): Promise<string>;
}
export declare class ClientWatch {
    streamid: string;
    aggregates: object[];
    collectionname: string;
}
export {};
