From 31bd5d295ebf89afe2a5c875fb5b3b3a7b9a314e Mon Sep 17 00:00:00 2001 From: u9g <43508353+u9g@users.noreply.github.com> Date: Sat, 21 Aug 2021 07:10:58 -0400 Subject: [PATCH] add missing types (#891) * Export id on a new interface for servers * add compressionThreshold --- src/index.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index a5852db..a8b060c 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -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