/// <reference types="node" />
import * as amqplib from "amqplib";
import * as url from "url";
import { Span } from "@opentelemetry/api";
declare type QueueOnMessage = (msg: string, options: QueueMessageOptions, ack: any, done: any) => void;
export declare type QueueMessageOptions = {
    correlationId: string;
    replyTo: string;
    consumerTag: string;
    routingkey: string;
    exchange: string;
};
declare type AssertQueue = {
    consumerCount: number;
    messageCount: number;
    queue: string;
};
export declare class Deferred<T> {
    promise: Promise<T>;
    reject: any;
    resolve: any;
    constructor();
}
export declare class amqpqueue {
    queue: string;
    queuename: string;
    callback: QueueOnMessage;
    ok: AssertQueue;
    QueueOptions: any;
    consumerTag: string;
}
export declare class amqpexchange {
    exchange: string;
    algorithm: string;
    routingkey: string;
    queue: amqpqueue;
    callback: QueueOnMessage;
    ok: amqplib.Replies.AssertExchange;
    ExchangeOptions: any;
}
export declare class amqpwrapper {
    private conn;
    private channel;
    private connectionstring;
    AssertExchangeOptions: any;
    AssertQueueOptions: amqplib.any;
    private activecalls;
    private exchanges;
    private replyqueue;
    private static _instance;
    static Instance(): amqpwrapper;
    static SetInstance(instance: amqpwrapper): void;
    constructor(connectionstring: string);
    private timeout;
    queuemessagecounter: object;
    incqueuemessagecounter(queuename: string): number;
    connect(): Promise<void>;
    RemoveQueueConsumer(queue: amqpqueue, parent: Span): Promise<void>;
    AddQueueConsumer(queuename: string, QueueOptions: any, jwt: string, callback: QueueOnMessage, parent: Span): Promise<amqpqueue>;
    AddExchangeConsumer(exchange: string, algorithm: string, routingkey: string, ExchangeOptions: any, jwt: string, callback: QueueOnMessage, parent: Span): Promise<amqpexchange>;
    OnMessage(sender: amqpqueue, msg: amqplib.ConsumeMessage, callback: QueueOnMessage): void;
    sendWithReply(exchange: string, queue: string, data: any, expiration: number, correlationId: string): Promise<string>;
    sendWithReplyTo(exchange: string, queue: string, replyTo: string, data: any, expiration: number, correlationId: string): Promise<void>;
    send(exchange: string, queue: string, data: any, expiration: number, correlationId: string): Promise<void>;
    generateUuid(): string;
    static parseurl(amqp_url: any): url.UrlWithParsedQuery;
    checkQueue(queuename: string): Promise<boolean>;
    checkQueueConsumerCount(queuename: string): Promise<boolean>;
    static getvhosts(amqp_url: any): Promise<any>;
    static getqueues(amqp_url: string, vhost?: string): Promise<any>;
    static getqueue(amqp_url: string, vhost: string, queuename: any): Promise<any>;
    static deletequeue(amqp_url: string, vhost: string, queuename: any): Promise<any>;
}
export {};
