Skip to content

Commit

Permalink
fix(types): subscribe definition (#1527)
Browse files Browse the repository at this point in the history
  • Loading branch information
redboltz committed Jul 14, 2023
1 parent d71b000 commit debb7d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions types/lib/client-options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ export interface IClientSubscribeOptions {
userProperties?: UserProperties
}
}
export interface IClientSubscribeProperties {
/*
* MQTT 5.0 properies object of subscribe
* */
properties?: {
subscriptionIdentifier?: number,
userProperties?: UserProperties
}
}
export interface IClientReconnectOptions {
/**
* a Store for the incoming packets
Expand Down
7 changes: 6 additions & 1 deletion types/lib/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
IClientOptions,
IClientPublishOptions,
IClientSubscribeOptions,
IClientSubscribeProperties,
IClientReconnectOptions
} from './client-options'
import { Store } from './store'
Expand Down Expand Up @@ -164,7 +165,11 @@ export declare class MqttClient extends events.EventEmitter {
*/
public subscribe (topic:
string
| string[], opts: IClientSubscribeOptions, callback?: ClientSubscribeCallback): this
| string[]
| ISubscriptionMap,
opts:
IClientSubscribeOptions
| IClientSubscribeProperties, callback?: ClientSubscribeCallback): this
public subscribe (topic:
string
| string[]
Expand Down

0 comments on commit debb7d9

Please sign in to comment.