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