import MessagePack from '../utils/msgpack'; import { AmqpChannelPoolService } from './amqp-channel-pool-service'; export declare type BroadcastTarget = 'all' | 'pc' | 'mobile'; export declare const BroadcastTargets: string[]; export default class PushService { static broadcastExchange: { name: { all: string; pc: string; mobile: string; }; options: { durable: boolean; }; type: string; }; static playerPushExchange: { name: string; options: { durable: boolean; }; type: string; }; static msgpack: MessagePack; static encode(obj: any): Buffer; static decode(buf: any): any; private static DEFAULT_EXCHANGE_OPTIONS; private static autoDeleteTriggerQueue; private channelPool; constructor(); initialize(channelPool: AmqpChannelPoolService): Promise; purge(): Promise; deleteExchange(exchange: string, options?: any): Promise; /** * bind specific exchange wrapper * @param destination * @param source * @param pattern * @param sourceType * @param sourceOpts * @returns {Promise} */ bindExchange(destination: string, source: string, pattern?: string, sourceType?: string, sourceOpts?: any): Promise; /** * unbind exchange wrapper * @param destination * @param source * @param pattern * @returns {Promise} */ unbindExchange(destination: string, source: string, pattern?: string): Promise; /** * publish message to a player * @param pid * @param msg * @param options * @returns {Promise} */ unicast(pid: string, msg: any, options?: any): Promise; /** * publish message to specific exchange * @param exchange * @param msg * @param routingKey * @param options * @returns {Promise} */ multicast(exchange: string, msg: any, routingKey?: string, options?: any): Promise; /** * publish message to global fanout exchange * @param msg message to broadcast. message should be MessagePack encodable. * @param options publish options * @returns {Promise} */ broadcast(msg: any, options?: any): Promise; }