mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 13:45:37 -04:00
Added error events
This commit is contained in:
parent
566b766f84
commit
747924d359
3
src/index.d.ts
vendored
3
src/index.d.ts
vendored
@ -1,6 +1,7 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { Socket } from 'net'
|
import { Socket } from 'net'
|
||||||
import * as Stream from 'stream'
|
import * as Stream from 'stream'
|
||||||
|
import { on } from 'cluster';
|
||||||
|
|
||||||
declare module 'minecraft-protocol' {
|
declare module 'minecraft-protocol' {
|
||||||
export class Client extends EventEmitter {
|
export class Client extends EventEmitter {
|
||||||
@ -18,6 +19,7 @@ declare module 'minecraft-protocol' {
|
|||||||
unregisterChannel(name: string): void
|
unregisterChannel(name: string): void
|
||||||
write(name: string, params: any): void
|
write(name: string, params: any): void
|
||||||
writeChannel(channel: any, 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: 'packet', handler: (data: any, packetMeta: PacketMeta) => void): this
|
||||||
on(event: 'raw', 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
|
on(event: 'session', handler: (session: any) => void): this
|
||||||
@ -47,6 +49,7 @@ declare module 'minecraft-protocol' {
|
|||||||
onlineModeExceptions: object
|
onlineModeExceptions: object
|
||||||
playerCount: number
|
playerCount: number
|
||||||
on(event: 'connection', handler: (client: Client) => void): this
|
on(event: 'connection', handler: (client: Client) => void): this
|
||||||
|
on(event: 'error', listener: (error: Error) => void): this
|
||||||
on(event: 'login', handler: (client: Client) => void): this
|
on(event: 'login', handler: (client: Client) => void): this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user