-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathindex.d.ts
70 lines (59 loc) · 2.22 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import {
MqttClient,
IClientOptions,
IClientPublishOptions,
IClientSubscribeOptions,
ISubscriptionGrant,
ISubscriptionMap,
} from 'mqtt';
export * from 'mqtt/types/lib/client-options';
export * from 'mqtt/types/lib/store';
export {
// mqtt/types/lib/client
ISubscriptionGrant,
ISubscriptionRequest,
ISubscriptionMap,
OnMessageCallback,
OnPacketCallback,
OnErrorCallback,
IStream,
// mqtt-packet
QoS,
PacketCmd,
IPacket,
IConnectPacket,
IPublishPacket,
IConnackPacket,
ISubscription,
ISubscribePacket,
ISubackPacket,
IUnsubscribePacket,
IUnsubackPacket,
IPubackPacket,
IPubcompPacket,
IPubrelPacket,
IPubrecPacket,
IPingreqPacket,
IPingrespPacket,
IDisconnectPacket,
Packet
} from 'mqtt'
export interface IMqttClient extends MqttClient {}
export declare class AsyncMqttClient extends MqttClient {
constructor (client: IMqttClient);
public subscribe (topic: string | string[], opts: IClientSubscribeOptions): Promise<ISubscriptionGrant[]>
public subscribe (topic: string | string[] | ISubscriptionMap): Promise<ISubscriptionGrant[]>
/* original */ public subscribe (topic: string | string[], opts: IClientSubscribeOptions, callback: never): this
/* original */ public subscribe (topic: string | string[] | ISubscriptionMap, callback: never): this
public unsubscribe (topic: string | string[]): Promise<void>
/* original */ public unsubscribe (topic: string | string[], callback: never): this;
public publish (topic: string, message: string | Buffer, opts: IClientPublishOptions): Promise<void>
public publish (topic: string, message: string | Buffer): Promise<void>
/* original */ public publish (topic: string, message: string | Buffer, opts: IClientPublishOptions, callback: never): this
/* original */ public publish (topic: string, message: string | Buffer, callback: never): this
public end (force?: boolean): Promise<void>
/* original */ public end (force: boolean, callback: never): this;
}
export declare function connect (brokerUrl?: string | any, opts?: IClientOptions): AsyncMqttClient
export declare function connectAsync (brokerUrl: string | any, opts?: IClientOptions, allowRetries?: boolean): Promise<AsyncMqttClient>
export { AsyncMqttClient as AsyncClient }