import { Peer } from '../core'; export declare class PubSub { private parent; constructor(parent: Peer); private checkOnlineAndEnabled; publish(topics: string | string[], messages: any | any[]): Promise; /** * Subscribe the given handler to a pubsub topic * * @param topic - The topic to listen on. * @param handler - The handler to subscribe. * * @example Subscribe a handler to a topic * * const handler = (message) => { } * await peer.pubsub.subscribe(topic, handler) */ subscribe(topics: string | string[], handler: Function): Promise; /** * Unsubscribes from a pubsub topic * * @param topic - The topic to listen on. * @param handler - The handler to unsubscribe from. * * @example Unsubscribe a topic for all handlers * * await peer.pubsub.unsubscribe(topic, undefined) * * @example Unsubscribe a topic for 1 handler * * await peer.pubsub.unsubscribe(topic, handler) */ unsubscribe(topic: string, handler?: Function): Promise; ls(): Promise; peers(topic: string): Promise; setMaxListeners(n: number): Promise | undefined; }