UNPKG

@yeci226/hoyoapi

Version:

HoYoAPI is an unofficial API Wrapper library developed to facilitate communication with the official HoYoLab API.

48 lines (47 loc) 1.68 kB
import { LanguageEnum } from '../../language'; import { HTTPRequest } from '../../request'; import { IWikiSearchResult, IWikiEntryPage, IWikiEntryListItem } from './wiki.interface'; type WikiGame = 'hsr' | 'zzz'; /** * WikiModule provides methods to search and retrieve data from the Hoyolab wiki * for Honkai: Star Rail and Zenless Zone Zero. * * @public * @class * @category Module */ export declare class WikiModule { private lang; private readonly searchApi; private readonly entryApi; private readonly entryListApi; private readonly wikiHeaders; /** * @param request - HTTPRequest instance (no auth needed for wiki). * @param lang - Language for wiki responses. * @param game - 'hsr' or 'zzz'. */ constructor(_request: HTTPRequest, lang: LanguageEnum, game: WikiGame); /** * Searches the wiki by keyword. * Returns the first matching entry page ID, or null if not found. * * @param keyword - Character/weapon/item name to search for. */ search(keyword: string): Promise<IWikiSearchResult | null>; /** * Retrieves the full entry page for a given entry_page_id. * * @param entryPageId - The entry_page_id from {@link search}. */ entryPage(entryPageId: string): Promise<IWikiEntryPage | null>; /** * Lists entries in a wiki menu category. * * @param menuId - The menu_id for the category (e.g. characters, weapons). * @param pageNum - Page number (1-indexed). * @param pageSize - Results per page (max 100). */ entryList(menuId: number, pageNum?: number, pageSize?: number): Promise<IWikiEntryListItem[]>; } export {};