1 | import Observable from 'zen-observable-ts';
|
2 | import { AbstractPubSubProvider } from './PubSubProvider';
|
3 | import { ProvidertOptions, SubscriptionObserver } from '../types';
|
4 | export declare function mqttTopicMatch(filter: string, topic: string): boolean;
|
5 | export interface MqttProvidertOptions extends ProvidertOptions {
|
6 | clientId?: string;
|
7 | url?: string;
|
8 | }
|
9 | declare class ClientsQueue {
|
10 | private promises;
|
11 | get(clientId: string, clientFactory: (string: any) => Promise<any>): Promise<any>;
|
12 | readonly allClients: string[];
|
13 | remove(clientId: any): void;
|
14 | }
|
15 | export declare class MqttOverWSProvider extends AbstractPubSubProvider {
|
16 | private _clientsQueue;
|
17 | constructor(options?: MqttProvidertOptions);
|
18 | protected readonly clientId: any;
|
19 | protected readonly endpoint: any;
|
20 | protected readonly clientsQueue: ClientsQueue;
|
21 | protected readonly isSSLEnabled: boolean;
|
22 | protected getTopicForValue(value: any): any;
|
23 | getProviderName(): string;
|
24 | onDisconnect({ clientId, errorCode, ...args }: {
|
25 | [x: string]: any;
|
26 | clientId: any;
|
27 | errorCode: any;
|
28 | }): void;
|
29 | newClient({ url, clientId, }: MqttProvidertOptions): Promise<any>;
|
30 | protected connect(clientId: string, options?: MqttProvidertOptions): Promise<any>;
|
31 | protected disconnect(clientId: string): Promise<void>;
|
32 | publish(topics: string[] | string, msg: any): Promise<void>;
|
33 | protected _topicObservers: Map<string, Set<SubscriptionObserver<any>>>;
|
34 | protected _clientIdObservers: Map<string, Set<SubscriptionObserver<any>>>;
|
35 | private _onMessage;
|
36 | subscribe(topics: string[] | string, options?: MqttProvidertOptions): Observable<any>;
|
37 | }
|
38 | export {};
|