add missing types (#891)

* Export id on a new interface for servers

* add compressionThreshold
This commit is contained in:
u9g 2021-08-21 07:10:58 -04:00 committed by GitHub
parent 4dc08372c8
commit 31bd5d295e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

9
src/index.d.ts vendored
View file

@ -19,6 +19,7 @@ declare module 'minecraft-protocol' {
uuid: string
protocolVersion: number
version: string
compressionThreshold: string
connect(port: number, host: string): void
setSocket(socket: Socket): void
end(reason: string): void
@ -68,12 +69,16 @@ declare module 'minecraft-protocol' {
playerCount: number
writeToClients(clients: Client[], name: string, params: any): void
close(): void
on(event: 'connection', handler: (client: Client) => void): this
on(event: 'connection', handler: (client: ServerClient) => void): this
on(event: 'error', listener: (error: Error) => void): this
on(event: 'login', handler: (client: Client) => void): this
on(event: 'login', handler: (client: ServerClient) => void): this
on(event: 'listening', listener: () => void): this
}
export interface ServerClient extends Client {
id: number
}
export interface ServerOptions {
'online-mode'?: boolean
checkTimeoutInterval?: number