blox-api
Version:
Roblox web API wrapper for Node.js
67 lines (66 loc) • 2.03 kB
TypeScript
import { GroupReference } from "./GroupReference";
/**
* Configuration options for [[RobloxClient]]
*/
export interface IRobloxClientOptions {
/**
* URI for the cache, see https://github.com/lukechilds/keyv#official-storage-adapters for supported adapters.
* Defaults to storing data in-memory
*/
cacheUri?: string;
/**
* URI for persistent storage, see https://github.com/lukechilds/keyv#official-storage-adapters for supported adapters.
* Defaults to using [keyv-file](https://www.npmjs.com/package/keyv-file)
*/
storageUri?: string;
/**
* Name of file to save persistent data when [[storageUri]] is not set.
* Defaults to roblox.json
*/
storageFileName?: string;
/**
* ID of the user for this client.
* This is only needed when loading sessions for multiple accounts
*/
userId?: string;
}
export declare class RobloxClient {
/**
* Current user session, created by [[login]]
*/
private session?;
/**
* Cache storage backed by [Keyv](https://github.com/lukechilds/keyv)
*/
private cacheKeyv;
/**
* Persistent storage of session cookies back by [Keyv](https://github.com/lukechilds/keyv)
*/
private storageKeyv;
/**
* Configration set in the [[constructor]]
*/
private options;
/**
* Create a new [[RobloxClient]]
*
* @param options Configuration options for a [[RobloxClient]]
*/
constructor(options?: IRobloxClientOptions);
/**
* Authenticate the account to access secured endpoints
*
* @param cookie .ROBLOSECURITY cookie for the account
*/
login(cookie: string): Promise<void>;
/**
* Returns information about the currently logged-in user
*/
getCurrentUserInfo(): Promise<import("../lib/user").IUserInfo>;
/**
* Returns a [[GroupReference]] to the provided group ID
*
* @param groupId The ID of the group
*/
getGroupFromId(groupId: number): GroupReference;
}