export declare class RMQObject { vhost: string; objectType: "queue" | "exchange" | "binding"; protected cluster?: Cluster; setCluster(cluster: Cluster): void; } export interface Arguments { [k: string]: any; } export interface QueueDefinition { name: string; vhost: string; durable: boolean; auto_delete: boolean; arguments: Arguments; } export declare class Queue extends RMQObject implements QueueDefinition { name: string; durable: boolean; auto_delete: boolean; arguments: Arguments; constructor(name: string, opts?: Partial); static fromDefinition(def: QueueDefinition): Queue; toDefinition(): QueueDefinition; } export declare type ExchangeType = "direct" | "topic" | "fanout" | "x-consistent-hash"; export interface ExchangeDefinition extends QueueDefinition { type: ExchangeType; internal: boolean; } export declare class Exchange extends Queue { type: ExchangeType; internal: boolean; constructor(name: string, type: ExchangeType, opts?: Partial); static fromDefinition(def: ExchangeDefinition): Exchange; toDefinition(): ExchangeDefinition; bindTo(other: Queue, opts?: BindingOptions): Binding; } export interface BindingOptions { routing_key?: string | number; arguments?: Arguments; } export interface BindingDefinition { vhost: string; source: string; destination: string; destination_type: string; routing_key: string | number; arguments: Arguments; } export declare class Binding extends RMQObject implements BindingDefinition { source: string; sourceObject?: Queue | Exchange; destination: string; destinationObject?: Queue | Exchange; destination_type: "queue" | "exchange"; routing_key: string | number; arguments: Arguments; constructor(); toDefinition(): BindingDefinition; } export declare class Cluster { queues: { [name: string]: Queue; }; exchanges: { [name: string]: Exchange; }; bindings: Binding[]; static loadClusterFromDefinitions(defn: { queues: QueueDefinition[]; exchanges: ExchangeDefinition[]; bindings: BindingDefinition[]; }): Cluster; addQueue(name: string | QueueDefinition): Queue; addExchange(definition: ExchangeDefinition): Exchange; addExchange(name: string, type: ExchangeType, opts?: ExchangeDefinition): Exchange; addBinding(source: string | Exchange, destination: string | Queue, opts?: BindingOptions): Binding; generateConfig(): object; }