Skip to content

Commit

Permalink
Fix EventMap
Browse files Browse the repository at this point in the history
  • Loading branch information
yassernasc committed Jan 6, 2025
1 parent b2ae297 commit a2a98cb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export interface rinfo {
size: number
}

export class Socket<T extends EventMap> extends EventEmitter<T> {
export class Socket extends EventEmitter<{
message: [string | Buffer, rinfo]
}> {
constructor(opts?: { ipv6Only?: boolean; reuseAddress?: boolean })

address(): { address: string; family: string; port: number } | null
Expand Down Expand Up @@ -77,7 +79,7 @@ export class Socket<T extends EventMap> extends EventEmitter<T> {
send(msg: string | Buffer, cb: (err: Error) => void): Promise<void>
}

export function createSocket<T>(
export function createSocket(
opts?: { ipv6Only?: boolean; reuseAddress?: boolean } | string,
cb?: (message: Buffer, address: rinfo) => void
): Socket<T>
): Socket

0 comments on commit a2a98cb

Please sign in to comment.