# @vermaysha/hoyolab-api
# Table of contents
# Enumerations
- AbyssScheduleEnum
- DiaryEnum
- DiaryMonthEnum
- GamesEnum
- GenshinRegion
- HonkaiRegion
- HsrRegion
- LanguageEnum
# Deprecated Classes
# Internal Classes
# Main Classes
# Module Classes
# Interfaces
- ICookie
- IDailyAwardItem
- IDailyClaim
- IDailyInfo
- IDailyReward
- IDailyRewards
- IGame
- IGamesList
- IGenshinCharacterAvatarFull
- IGenshinCharacterBase
- IGenshinCharacterConstellation
- IGenshinCharacterCostume
- IGenshinCharacterReliquaries
- IGenshinCharacterReliquariesAffix
- IGenshinCharacterReliquariesSet
- IGenshinCharacterRole
- IGenshinCharacterSummary
- IGenshinCharacterWeapon
- IGenshinCharacters
- IGenshinDailyNote
- IGenshinDiaryBase
- IGenshinDiaryDetail
- IGenshinDiaryHistory
- IGenshinDiaryInfo
- IGenshinOptions
- IGenshinRecord
- IGenshinRecordAvatar
- IGenshinRecordHome
- IGenshinRecordStat
- IGenshinRecordWorldExploration
- IGenshinSpiralAbyss
- IGenshinSpiralAbyssAvatar
- IGenshinSpiralAbyssBattle
- IGenshinSpiralAbyssFloor
- IGenshinSpiralAbyssLevel
- IGenshinSpiralAbyssRank
- IHi3Options
- IHoyolabOptions
- IHsrOptions
- IRedeemCode
- IResponse
# Type Aliases
# Functions
# Type Aliases
# BaseType
Ƭ BaseType: Object
Represents the base type that can be used for properties in a request body, request header, or request parameter.
# Index signature
▪ [x: string
]: string
| number
| boolean
| null
| undefined
| string
[] | number
[] | never
[]
# Defined in
src/request/request.inteface.ts:5 (opens new window)
# CacheKey
Ƭ CacheKey: Object
# Type declaration
Name | Type |
---|---|
body | object |
method | string |
params | object |
url | string |
# Defined in
src/request/request.cache.ts:4 (opens new window)
# RequestBodyType
Ƭ RequestBodyType: BaseType
Represents the type that can be used for the body of a request.
# Defined in
src/request/request.inteface.ts:20 (opens new window)
# RequestHeaderType
Ƭ RequestHeaderType: BaseType
Represents the type that can be used for the headers of a request.
# Defined in
src/request/request.inteface.ts:25 (opens new window)
# RequestParamType
Ƭ RequestParamType: BaseType
Represents the type that can be used for the parameters of a request.
# Defined in
src/request/request.inteface.ts:30 (opens new window)
# Functions
# delay
▸ delay(second
): Promise
<void
>
Delays the execution of the code for a specified number of seconds.
# Parameters
Name | Type | Description |
---|---|---|
second | number | The number of seconds to delay. |
# Returns
Promise
<void
>
A Promise that resolves after the specified number of seconds.
# Defined in
src/request/request.helper.ts:33 (opens new window)
# generateDS
▸ generateDS(): string
Generates a dynamic secret (DS) string for use in the Genshin Impact API.
# Returns
string
The generated DS string.
# Defined in
src/request/request.helper.ts:8 (opens new window)
# getGenshinRegion
▸ getGenshinRegion(uid
): GenshinRegion
Get Genshin Impact region based on UID.
Throws
HoyolabError
when the UID is invalid.
# Parameters
Name | Type | Description |
---|---|---|
uid | number | User ID. |
# Returns
Region for the UID.
# Defined in
src/games/gi/gi.helper.ts:11 (opens new window)
# getHi3Region
▸ getHi3Region(uid
): HonkaiRegion
Gets the Honkai region from a given UID.
Function
Throws
- If the UID is invalid.
# Parameters
Name | Type | Description |
---|---|---|
uid | number | The UID to get the Honkai region for. |
# Returns
- The Honkai region for the given UID.
# Defined in
src/games/hi/hi.helper.ts:11 (opens new window)
# getHsrRegion
▸ getHsrRegion(uid
): HsrRegion
Get Server Region by UID
# Parameters
Name | Type | Description |
---|---|---|
uid | number | number UID |