Added error events

This commit is contained in:
Shayne Hartford 2018-10-03 07:43:40 -04:00 committed by GitHub
parent 566b766f84
commit 747924d359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

3
src/index.d.ts vendored
View File

@ -1,6 +1,7 @@
import { EventEmitter } from 'events';
import { Socket } from 'net'
import * as Stream from 'stream'
import { on } from 'cluster';
declare module 'minecraft-protocol' {
export class Client extends EventEmitter {
@ -18,6 +19,7 @@ declare module 'minecraft-protocol' {
unregisterChannel(name: string): void
write(name: string, params: any): void
writeChannel(channel: any, params: any): void
on(event: 'error', listener: (error: Error) => void): this
on(event: 'packet', handler: (data: any, packetMeta: PacketMeta) => void): this
on(event: 'raw', handler: (data: any, packetMeta: PacketMeta) => void): this
on(event: 'session', handler: (session: any) => void): this
@ -47,6 +49,7 @@ declare module 'minecraft-protocol' {
onlineModeExceptions: object
playerCount: number
on(event: 'connection', handler: (client: Client) => void): this
on(event: 'error', listener: (error: Error) => void): this
on(event: 'login', handler: (client: Client) => void): this
}