fix(types): complete type definitions (#1053)

Complete the type definitions to prevent errors.
This commit is contained in:
jojomatik 2023-01-15 14:37:32 +01:00 committed by GitHub
parent 38eecb5aa1
commit 2fc4b917d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
src/index.d.ts vendored
View file

@ -37,7 +37,7 @@ declare module 'minecraft-protocol' {
writeChannel(channel: any, params: any): void writeChannel(channel: any, params: any): void
signMessage(message: string, timestamp: BigInt, salt?: number): Buffer signMessage(message: string, timestamp: BigInt, salt?: number): Buffer
verifyMessage(publicKey: Buffer | KeyObject, packet: object): boolean verifyMessage(publicKey: Buffer | KeyObject, packet: object): boolean
reportPlayer(uuid: string, reason: 'FALSE_REPORTING' | 'HATE_SPEECH' | 'TERRORISM_OR_VIOLENT_EXTREMISM' | 'CHILD_SEXUAL_EXPLOITATION_OR_ABUSE' | 'IMMINENT_HARM' | 'NON_CONSENSUAL_INTIMATE_IMAGERY' | 'HARASSMENT_OR_BULLYING' | 'DEFAMATION_IMPERSONATION_FALSE_INFORMATION' | 'SELF_HARM_OR_SUICIDE' | 'ALCOHOL_TOBACCO_DRUGS', signatures: Buffer[], comment?: string) reportPlayer(uuid: string, reason: 'FALSE_REPORTING' | 'HATE_SPEECH' | 'TERRORISM_OR_VIOLENT_EXTREMISM' | 'CHILD_SEXUAL_EXPLOITATION_OR_ABUSE' | 'IMMINENT_HARM' | 'NON_CONSENSUAL_INTIMATE_IMAGERY' | 'HARASSMENT_OR_BULLYING' | 'DEFAMATION_IMPERSONATION_FALSE_INFORMATION' | 'SELF_HARM_OR_SUICIDE' | 'ALCOHOL_TOBACCO_DRUGS', signatures: Buffer[], comment?: string): Promise<true>
on(event: 'error', listener: (error: Error) => PromiseLike): this on(event: 'error', listener: (error: Error) => PromiseLike): this
on(event: 'packet', handler: (data: any, packetMeta: PacketMeta, buffer: Buffer, fullBuffer: Buffer) => PromiseLike): this on(event: 'packet', handler: (data: any, packetMeta: PacketMeta, buffer: Buffer, fullBuffer: Buffer) => PromiseLike): this
on(event: 'raw', handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this on(event: 'raw', handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this
@ -47,7 +47,7 @@ declare module 'minecraft-protocol' {
on(event: 'connect', handler: () => PromiseLike): this on(event: 'connect', handler: () => PromiseLike): this
on(event: string, handler: (data: any, packetMeta: PacketMeta) => PromiseLike): this on(event: string, handler: (data: any, packetMeta: PacketMeta) => PromiseLike): this
on(event: `raw.${string}`, handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this on(event: `raw.${string}`, handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this
on(event: 'playerChat', handler: ({ formattedMessage, message, type, sender, senderName, senderTeam, verified })) on(event: 'playerChat', handler: ({ formattedMessage: string, message: string, type: string, sender: string, senderName: string, senderTeam: string, verified?: boolean })): this
once(event: 'error', listener: (error: Error) => PromiseLike): this once(event: 'error', listener: (error: Error) => PromiseLike): this
once(event: 'packet', handler: (data: any, packetMeta: PacketMeta, buffer: Buffer, fullBuffer: Buffer) => PromiseLike): this once(event: 'packet', handler: (data: any, packetMeta: PacketMeta, buffer: Buffer, fullBuffer: Buffer) => PromiseLike): this
once(event: 'raw', handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this once(event: 'raw', handler: (buffer: Buffer, packetMeta: PacketMeta) => PromiseLike): this