enka-network-api
Version:
Enka-network API wrapper for Genshin Impact.
47 lines (46 loc) • 1.75 kB
TypeScript
import { LanguageCode } from "../../client/CachedAssetsManager";
import { EnkaClient } from "../../client/EnkaClient";
import { TextAssets } from "./TextAssets";
import { Gender } from "../character/CharacterData";
import { Paths } from "../../utils/ts_utils";
export type GenshinPlatform = "MOBILE" | "PC" | "PS";
export interface UserInfo {
travelerGender?: Gender;
travelerNickname?: string;
platform?: GenshinPlatform;
}
export interface DynamicData {
paramList: number[];
userInfo: UserInfo | null;
}
export declare class DynamicTextAssets extends TextAssets {
readonly dynamicData: DynamicData;
constructor(id: number, data: Partial<DynamicData>, enka: EnkaClient, convertToHtmlFormat?: boolean, directory?: string);
/**
* @param replaceWith an empty array is the same as an array containing all paths
* @throws AssetsNotFoundError
*/
getReplacedData(replaceWith?: Paths<DynamicData>[], lang?: LanguageCode): {
text: string;
usedParamIndices: number[];
};
/**
* @returns null instead of throwing AssetsNotFoundError.
*/
getNullableReplacedData(replaceWith?: (keyof DynamicData)[], lang?: LanguageCode): {
text: string;
usedParamIndices: number[];
} | null;
/**
* @throws AssetsNotFoundError
*/
getReplacedText(replaceWith?: (keyof DynamicData)[], lang?: LanguageCode): string;
/**
* @returns null instead of throwing AssetsNotFoundError.
*/
getNullableReplacedText(replaceWith?: (keyof DynamicData)[], lang?: LanguageCode): string | null;
/**
* @returns new instance of DynamicTextAssets with provided `userInfo`.
*/
copyWithUserInfo(userInfo: UserInfo): DynamicTextAssets;
}