import * as WebSocket from "ws";
import { Message } from "./Messages/Message";
import { QueueMessageOptions, amqpqueue, amqpexchange, exchangealgorithm } from "./amqpwrapper";
import { Base, User, mapFunc, reduceFunc, finalizeFunc, 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 _amqpdisconnected;
    private _dbdisconnected;
    private _dbconnected;
    static remoteip(req: express.Request): string;
    constructor(socketObject: WebSocket, req: any);
    private dbdisconnected;
    private dbconnected;
    private amqpdisconnected;
    private open;
    private close;
    private error;
    queuecount(): number;
    connected(): boolean;
    ping(parent: Span): void;
    private _message;
    private message;
    CloseConsumers(parent: Span): Promise<void>;
    Close(): 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): Promise<T>;
    private _Send;
    chunkString(str: string, length: number): string[] | null;
    Queue(data: string, queuename: string, options: QueueMessageOptions): Promise<any[]>;
    Query<T extends Base>(collection: string, query: any, projection?: any, orderby?: any, top?: number, skip?: number): Promise<any[]>;
    MapReduce(collection: string, map: mapFunc, reduce: reduceFunc, finalize: finalizeFunc, query: any, out: string | any, scope: any): Promise<any>;
    Insert<T extends Base>(collection: string, model: any): Promise<any>;
    Update<T extends Base>(collection: string, model: any): Promise<any>;
    UpdateMany<T extends Base>(collection: string, query: any, document: any): Promise<any>;
    Delete(collection: string, id: any): Promise<void>;
    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 {};
