diff --git a/index.d.ts b/index.d.ts index c43febc..75976de 100644 --- a/index.d.ts +++ b/index.d.ts @@ -8,7 +8,9 @@ export interface rinfo { size: number } -export class Socket extends EventEmitter { +export class Socket extends EventEmitter<{ + message: [string | Buffer, rinfo] +}> { constructor(opts?: { ipv6Only?: boolean; reuseAddress?: boolean }) address(): { address: string; family: string; port: number } | null @@ -77,7 +79,7 @@ export class Socket extends EventEmitter { send(msg: string | Buffer, cb: (err: Error) => void): Promise } -export function createSocket( +export function createSocket( opts?: { ipv6Only?: boolean; reuseAddress?: boolean } | string, cb?: (message: Buffer, address: rinfo) => void -): Socket +): Socket