@yeci226/hoyoapi
Version:
HoYoAPI is an unofficial API Wrapper library developed to facilitate communication with the official HoYoLab API.
78 lines (77 loc) • 2.64 kB
TypeScript
import { LanguageEnum } from '../../language';
import { HTTPRequest } from '../../request';
import { IMimoTask, IMimoExchangeItem, IMimoExchangeResult, IMimoLotteryInfo } from './mimo.interface';
/**
* MimoModule provides methods to interact with Hoyolab's Traveling Mimo event.
* Supports HSR (game_id=6) and ZZZ (game_id=8).
*
* @public
* @class
* @category Module
*/
export declare class MimoModule {
private request;
private lang;
private gameId;
/**
* @param request - HTTPRequest instance with auth cookies set.
* @param lang - Language for API responses.
* @param gameId - Mimo game ID (6 = HSR, 8 = ZZZ).
*/
constructor(request: HTTPRequest, lang: LanguageEnum, gameId: number);
/**
* Fetches the current Mimo version_id for this game.
* Returns null if the event is not active.
*/
getVersionId(): Promise<string | null>;
/**
* Retrieves the list of Mimo tasks for the current version.
*
* @param versionId - The version_id from {@link getVersionId}.
*/
tasks(versionId: string): Promise<IMimoTask[]>;
/**
* Marks a task as finished (triggers completion for click-type tasks).
*
* @param versionId - The current version_id.
* @param taskId - ID of the task to finish.
*/
finishTask(versionId: string, taskId: number): Promise<boolean>;
/**
* Claims the reward points for a completed task.
*
* @param versionId - The current version_id.
* @param taskId - ID of the completed task.
*/
claimTask(versionId: string, taskId: number): Promise<boolean>;
/**
* Completes all pending tasks and claims their rewards in one call.
* Returns the number of tasks successfully claimed.
*/
claimAllTasks(): Promise<number>;
/**
* Retrieves the Mimo shop exchange items.
*
* @param versionId - The current version_id.
*/
exchangeList(versionId: string): Promise<IMimoExchangeItem[]>;
/**
* Exchanges points for a shop item (typically returns a gift code).
*
* @param versionId - The current version_id.
* @param awardId - The award_id of the shop item.
*/
exchange(versionId: string, awardId: string): Promise<IMimoExchangeResult>;
/**
* Gets current lottery state (total points, cost per draw, draws done).
*
* @param versionId - The current version_id.
*/
lotteryInfo(versionId: string): Promise<IMimoLotteryInfo>;
/**
* Performs one lottery draw.
*
* @param versionId - The current version_id.
*/
lottery(versionId: string): Promise<boolean>;
}