diff --git a/src/index.d.ts b/src/index.d.ts index 77f60c1..6f21f60 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -4,6 +4,7 @@ import { EventEmitter } from 'events'; import { Socket } from 'net' import * as Stream from 'stream' import { Agent } from 'http' +import { Transform } from "readable-stream"; type PromiseLike = Promise | void @@ -17,6 +18,8 @@ declare module 'minecraft-protocol' { username: string session?: SessionOption profile?: any + deserializer: FullPacketParser + serializer: Serializer latency: number customPackets: any protocolVersion: number @@ -51,6 +54,24 @@ declare module 'minecraft-protocol' { once(event: `raw.${string}`, handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this } + class FullPacketParser extends Transform { + proto: any + mainType: any + noErrorLogging: boolean + constructor (proto: any, mainType: any, noErrorLogging?: boolean) + + parsePacketBuffer(buffer: Buffer): any + } + + class Serializer extends Transform { + proto: any + mainType: any + queue: Buffer + constructor(proto: any, mainType: any) + + createPacketBuffer(packet: any): any + } + export interface SessionOption { accessToken: string, /** My be needed for mojang auth. Is send by mojang on username + password auth */