Skip to content

Commit

Permalink
fix: upgrade Aedes.d.ts and Client to extends from EventEmitter (mosc…
Browse files Browse the repository at this point in the history
  • Loading branch information
cjimenezsaiz authored Apr 22, 2021
1 parent e3aa214 commit aa8a661
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion types/client.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { IncomingMessage } from 'http'
import { PublishPacket, SubscribePacket, Subscription, Subscriptions, UnsubscribePacket } from './packet'
import { Connection } from './instance'
import { EventEmitter } from 'events'

export interface Client {
export interface Client extends EventEmitter {
id: Readonly<string>
clean: Readonly<boolean>
version: Readonly<number>
Expand Down
3 changes: 2 additions & 1 deletion types/instance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Duplex } from 'stream'
import { Socket } from 'net'
import { Client } from './client'
import type { AedesPublishPacket, ConnectPacket, ConnackPacket, Subscription, PingreqPacket, PublishPacket, PubrelPacket } from './packet'
import { EventEmitter } from 'events'

type LastHearthbeatTimestamp = Date;

Expand Down Expand Up @@ -56,7 +57,7 @@ export interface AedesOptions {
published?: PublishedHandler
}

export interface Aedes {
export interface Aedes extends EventEmitter {
id: Readonly<string>
connectedClients: Readonly<number>
closed: Readonly<boolean>
Expand Down

0 comments on commit aa8a661

Please sign in to comment.