import * as WebSocket from "ws";
import { Message } from "./Messages/Message";
import { QueueMessageOptions, amqpqueue } from "./amqpwrapper";
import { Base, User, mapFunc, reduceFunc, finalizeFunc, QueuedMessage } from "@openiap/openflow-api";
import { ChangeStream } from "mongodb";
import { Span } from "@opentelemetry/api";
interface IHashTable<T> {
    [key: string]: T;
}
export declare class clsstream {
    stream: ChangeStream;
    id: string;
    callback: any;
}
export declare class WebSocketServerClient {
    jwt: string;
    private _socketObject;
    private _receiveQueue;
    private _sendQueue;
    messageQueue: IHashTable<QueuedMessage>;
    remoteip: string;
    clientagent: string;
    clientversion: string;
    lastheartbeat: Date;
    metrics: string;
    id: string;
    user: User;
    _queues: amqpqueue[];
    devnull: boolean;
    commandcounter: object;
    inccommandcounter(command: string): number;
    constructor(socketObject: WebSocket, req: any);
    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(queuename: string, parent: Span): Promise<void>;
    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[];
    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>;
    streams: clsstream[];
    streamcount(): number;
    CloseStreams(): Promise<void>;
    CloseStream(id: string): Promise<void>;
    UnWatch(id: string, jwt: string): Promise<void>;
    Watch(aggregates: object[], collectionname: string, jwt: string): Promise<string>;
}
export {};
