UNPKG

xlicore

Version:

Currently only used for my own launcher, proper docs will come later (hopefully).

29 lines (28 loc) 1.18 kB
import * as DraslAuthenticate from '../types/meta/auth/drasl/authenticate.js'; import * as DraslInvalidate from '../types/meta/auth/drasl/invalidate.js'; import * as DraslRefresh from '../types/meta/auth/drasl/refresh.js'; import { launchCredentials } from '../types/meta/auth/launchCredentials.js'; export type DraslOpts = { /** Drasl server root. Example: `https://drasl.unmojang.org` */ server: string; /** `.super_secret.json` file's directory */ saveDir?: string; }; type LoginCredentials = { username: string; password: string; }; export declare class DraslAuth { opts: DraslOpts; authserver: string; authFilepath: string | undefined; constructor(opts: DraslOpts); init(creds: LoginCredentials): Promise<launchCredentials>; first(creds: LoginCredentials): Promise<DraslAuthenticate.Response>; refresh(body: DraslRefresh.Request): Promise<DraslRefresh.Response>; invalidate(body: DraslInvalidate.Request): Promise<void>; writeJson(json: DraslAuthenticate.Response): Promise<void>; validate(json: DraslAuthenticate.Response): Promise<boolean>; signout(creds: LoginCredentials): Promise<void>; } export {};