From d06386e0f36b3bd010b6bf0d9918e7885b7e9e08 Mon Sep 17 00:00:00 2001 From: Jarco Date: Sat, 21 Jan 2023 04:19:20 +0100 Subject: [PATCH] added onMsaCode to ClientOptions (#335) * added onMsaCode to ClientOptions * Import the type instead of declaring it --- index.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index 46328f5..c21708b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,6 @@ import EventEmitter from "events" import { Realm } from "prismarine-realms" +import { ServerDeviceCodeResponse } from "prismarine-auth" declare module "bedrock-protocol" { type Version = '1.19.50' | '1.19.41 | 1.19.40' | '1.19.31' | '1.19.30' | '1.19.22' | '1.19.21' | '1.19.20' | '1.19.11' | '1.19.10' | '1.19.2' | '1.19.1' | '1.18.31' | '1.18.30' | '1.18.12' | '1.18.11' | '1.18.10' | '1.18.2' | '1.18.1' | '1.18.0' | '1.17.41' | '1.17.40' | '1.17.34' | '1.17.30' | '1.17.11' | '1.17.10' | '1.17.0' | '1.16.220' | '1.16.210' | '1.16.201' @@ -47,6 +48,8 @@ declare module "bedrock-protocol" { realms?: RealmsOptions // the path to store authentication caches, defaults to .minecraft profilesFolder?: string | false + // Called when microsoft authorization is needed when not provided it will the information log to the console instead + onMsaCode?: (data: ServerDeviceCodeResponse) => void; } export interface ServerOptions extends Options { @@ -80,7 +83,7 @@ declare module "bedrock-protocol" { sendBuffer(buffer: Buffer, immediate?: boolean) } - type PlayStatus = + type PlayStatus = | 'login_success' // # Displays "Could not connect: Outdated client!" | 'failed_client' @@ -104,7 +107,7 @@ declare module "bedrock-protocol" { readonly entityId: BigInt /** - * Close the connection, leave the server. + * Close the connection, leave the server. */ close() @@ -115,7 +118,7 @@ declare module "bedrock-protocol" { } /** - * `Player` represents a player connected to the server. + * `Player` represents a player connected to the server. */ export class Player extends Connection { /** @@ -132,7 +135,7 @@ declare module "bedrock-protocol" { disconnect(reason: string, hide?: boolean) /** - * Close the connection. Already called by disconnect. Call this to manually close RakNet connection. + * Close the connection. Already called by disconnect. Call this to manually close RakNet connection. */ close() @@ -197,7 +200,7 @@ declare module "bedrock-protocol" { export interface RealmsOptions { realmId?: string - realmInvite?: string + realmInvite?: string pickRealm?: (realms: Realm[]) => Realm }