✏️ 完善基本 Response 类型 #51

This commit is contained in:
BTMuli
2023-10-26 18:58:06 +08:00
parent 1d408b5d24
commit 9a221f9b64
33 changed files with 266 additions and 238 deletions

View File

@@ -1,10 +1,15 @@
/**
* @file types BBS Announcement.d.ts
* @file types/BBS/Announcement.d.ts
* @description 从 BBS 获取到的游戏内公告类型定义文件
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.1.5
*/
/**
* @description 游戏内公告类型定义
* @since Alpha v0.1.5
* @namespace TGApp.BBS.Announcement
* @memberof TGApp.BBS
*/
declare namespace TGApp.BBS.Announcement {
/**
* @description 公告列表返回响应类型
@@ -14,7 +19,8 @@ declare namespace TGApp.BBS.Announcement {
* @property {ListData} data - 公告列表数据
* @return ListResponse
*/
export interface ListResponse extends TGApp.BBS.Response.Base {
interface ListResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: ListData;
}
@@ -26,7 +32,8 @@ declare namespace TGApp.BBS.Announcement {
* @property {ContentData} data - 公告内容数据
* @return ContentResponse
*/
export interface ContentResponse extends TGApp.BBS.Response.Base {
interface ContentResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: ContentData;
}
@@ -48,7 +55,7 @@ declare namespace TGApp.BBS.Announcement {
* @property {unknown} static_sign - 静态签名
* @return ListData
*/
export interface ListData {
interface ListData {
list: ListItem[];
total: number;
type_list: ListType[];
@@ -73,7 +80,7 @@ declare namespace TGApp.BBS.Announcement {
* @property {number} pic_total - 图片总数
* @return ContentData
*/
export interface ContentData {
interface ContentData {
list: ContentItem[];
total: number;
pic_list: unknown[];
@@ -89,7 +96,7 @@ declare namespace TGApp.BBS.Announcement {
* @property {string} type_label - 公告类型标签
* @return ListItem
*/
export interface ListItem {
interface ListItem {
list: AnnoSingle[];
type_id: number;
type_label: string;
@@ -121,7 +128,7 @@ declare namespace TGApp.BBS.Announcement {
* @property {boolean} extra_remind 是否有额外提醒
* @return AnnoSingle
*/
export interface AnnoSingle {
interface AnnoSingle {
ann_id: number;
title: string;
subtitle: string;
@@ -153,7 +160,7 @@ declare namespace TGApp.BBS.Announcement {
* @property {string} mi18n_name 公告类型国际化名称
* @return ListType
*/
export interface ListType {
interface ListType {
id: number;
name: string;
mi18n_name: string;
@@ -171,7 +178,7 @@ declare namespace TGApp.BBS.Announcement {
* @property {string} lang 公告语言
* @return ContentItem
*/
export interface ContentItem {
interface ContentItem {
ann_id: number;
title: string;
subtitle: string;

View File

@@ -21,9 +21,9 @@ declare namespace TGApp.BBS.Response {
* @return Base
*/
interface Base {
retcode: number;
retcode: Pick<number, 0>;
message: string;
data: any;
data: never;
}
/**
@@ -48,6 +48,7 @@ declare namespace TGApp.BBS.Response {
* @return getTokens
*/
interface getTokens extends Base {
retcode: 0;
data: {
list: getTokensRes[];
};
@@ -62,6 +63,7 @@ declare namespace TGApp.BBS.Response {
* @return getLTokenBySToken
*/
interface getLTokenBySToken extends Base {
retcode: 0;
data: {
ltoken: string;
};
@@ -77,6 +79,7 @@ declare namespace TGApp.BBS.Response {
* @return getCookieTokenBySToken
*/
interface getCookieTokenBySToken extends Base {
retcode: 0;
data: {
uid: string;
cookie_token: string;
@@ -94,6 +97,7 @@ declare namespace TGApp.BBS.Response {
* @return verifyUserInfoBySToken
*/
interface verifyUserInfoBySToken extends Base {
retcode: 0;
data: {
user_info: TGApp.BBS.Account.VerifySTokenInfo;
realname_info: unknown;
@@ -110,6 +114,7 @@ declare namespace TGApp.BBS.Response {
* @return getStokenByGameToken
*/
interface getStokenByGameToken extends Base {
retcode: 0;
data: getStokenByGameTokenData;
}
@@ -144,6 +149,7 @@ declare namespace TGApp.BBS.Response {
* @return getCookieTokenByGameToken
*/
interface getCookieTokenByGameToken extends Base {
retcode: 0;
data: {
uid: string;
cookie_token: string;
@@ -161,6 +167,7 @@ declare namespace TGApp.BBS.Response {
* @return getActionTicketBySToken
*/
interface getActionTicketBySToken extends Base {
retcode: 0;
data: {
ticket: string;
is_verified: boolean;

View File

@@ -1,10 +1,15 @@
/**
* @file types Game Abyss.d.ts
* @file types/Game/Abyss.d.ts
* @description 游戏深渊相关类型定义文件
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.2.0
*/
/**
* @description 深渊数据相关类型
* @since Alpha v0.2.0
* @namespace TGApp.Game.Abyss
* @memberof TGApp.Game
*/
declare namespace TGApp.Game.Abyss {
/**
* @description 深渊数据返回类型
@@ -14,7 +19,8 @@ declare namespace TGApp.Game.Abyss {
* @property {FullData} data - 深渊数据
* @return Response
*/
export interface Response extends TGApp.BBS.Response.Base {
interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: FullData;
}
@@ -39,7 +45,7 @@ declare namespace TGApp.Game.Abyss {
* @property {boolean} is_unlock - 是否解锁
* @return FullData
*/
export interface FullData {
interface FullData {
schedule_id: number;
start_time: string;
end_time: string;
@@ -67,7 +73,7 @@ declare namespace TGApp.Game.Abyss {
* @property {number} rarity - 角色星级
* @return CharacterData
*/
export interface CharacterData {
interface CharacterData {
avatar_id: number;
avatar_icon: string;
value: number;
@@ -87,7 +93,7 @@ declare namespace TGApp.Game.Abyss {
* @property {Level[]} levels - 层内关卡数据
* @return Floor
*/
export interface Floor {
interface Floor {
index: number;
icon: string;
is_unlock: boolean;
@@ -107,7 +113,7 @@ declare namespace TGApp.Game.Abyss {
* @property {Battle[]} battles - 关卡内战斗数据
* @return Level
*/
export interface Level {
interface Level {
index: number;
star: number;
max_star: number;
@@ -123,7 +129,7 @@ declare namespace TGApp.Game.Abyss {
* @property {CharacterInfo[]} avatars - 角色信息
* @return Battle
*/
export interface Battle {
interface Battle {
index: number;
timestamp: string;
avatars: CharacterInfo[];
@@ -139,7 +145,7 @@ declare namespace TGApp.Game.Abyss {
* @property {number} rarity - 角色星级
* @return CharacterInfo
*/
export interface CharacterInfo {
interface CharacterInfo {
id: number;
icon: string;
level: number;

View File

@@ -1,10 +1,15 @@
/**
* @file types Game Calculate.d.ts
* @file types/Game/Calculate.d.ts
* @description 养成计算器相关类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.1
*/
/**
* @description 养成计算器相关类型定义命名空间
* @since Alpha v0.2.1
* @namespace TGApp.Game.Calculate
* @memberof TGApp.Game
*/
declare namespace TGApp.Game.Calculate {
/**
* @description 获取同步角色列表返回
@@ -15,7 +20,8 @@ declare namespace TGApp.Game.Calculate {
* @property {Array<AvatarListItem>} data.list - 角色列表
* @return SyncAvatarListResponse
*/
export interface SyncAvatarListResponse extends TGApp.BBS.Response.Base {
interface SyncAvatarListResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: {
list: AvatarListItem[];
};
@@ -35,7 +41,7 @@ declare namespace TGApp.Game.Calculate {
* @property {number} level_current - 角色当前等级
* @return AvatarListItem
*/
export interface AvatarListItem {
interface AvatarListItem {
id: number;
name: string;
icon: string;
@@ -55,7 +61,8 @@ declare namespace TGApp.Game.Calculate {
* @property {AvatarDetail} data - 角色详情
* @return SyncAvatarDetailResponse
*/
export interface SyncAvatarDetailResponse extends TGApp.BBS.Response.Base {
interface SyncAvatarDetailResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: TGApp.Game.Calculate.AvatarDetail;
}
@@ -68,7 +75,7 @@ declare namespace TGApp.Game.Calculate {
* @property {AvatarDetailRelic[]} reliquary_list - 角色圣遗物列表
* @return AvatarDetail
*/
export interface AvatarDetail {
interface AvatarDetail {
skill_list: AvatarDetailSkill[];
weapon: AvatarDetailWeapon;
reliquary_list: AvatarDetailRelic[];
@@ -86,7 +93,7 @@ declare namespace TGApp.Game.Calculate {
* @property {number} level_current - 技能当前等级
* @return AvatarDetailSkill
*/
export interface AvatarDetailSkill {
interface AvatarDetailSkill {
id: number;
group_id: number;
name: string;
@@ -108,7 +115,7 @@ declare namespace TGApp.Game.Calculate {
* @property {number} level_current - 武器当前等级
* @return AvatarDetailWeapon
*/
export interface AvatarDetailWeapon {
interface AvatarDetailWeapon {
id: number;
name: string;
icon: string;
@@ -131,7 +138,7 @@ declare namespace TGApp.Game.Calculate {
* @property {number} max_level - 圣遗物最大等级
* @return AvatarDetailRelic
*/
export interface AvatarDetailRelic {
interface AvatarDetailRelic {
id: number;
name: string;
icon: string;

View File

@@ -1,10 +1,15 @@
/**
* @file types Game Character.d.ts
* @file types/Game/Character.d.ts
* @description 游戏角色相关类型定义文件
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.2.0
*/
/**
* @description 游戏角色相关类型定义命名空间
* @since Alpha v0.2.0
* @namespace TGApp.Game.Character
* @memberof TGApp.Game
*/
declare namespace TGApp.Game.Character {
/**
* @description 角色列表数据返回类型
@@ -15,7 +20,8 @@ declare namespace TGApp.Game.Character {
* @property {ListRole} data.role - 角色信息
* @return ListResponse
*/
export interface ListResponse extends TGApp.BBS.Response.Base {
interface ListResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: {
avatars: ListItem[];
role: ListRole;
@@ -43,7 +49,7 @@ declare namespace TGApp.Game.Character {
* @property {unknown} external
* @return ListItem
*/
export interface ListItem {
interface ListItem {
id: number;
image: string;
icon: string;
@@ -71,7 +77,7 @@ declare namespace TGApp.Game.Character {
* @property {number} level - 角色等级
* @return ListRole
*/
export interface ListRole {
interface ListRole {
AvatarUrl: string;
nickname: string;
region: string;
@@ -94,7 +100,7 @@ declare namespace TGApp.Game.Character {
* @property {number} affix_level - 武器精炼等级
* @return LIWeapon
*/
export interface LIWeapon {
interface LIWeapon {
id: number;
name: string;
icon: string;
@@ -121,7 +127,7 @@ declare namespace TGApp.Game.Character {
* @property {TGApp.Game.Constant.EnumRelic} pos_name - 圣遗物位置名称
* @return LIRelic
*/
export interface LIRelic {
interface LIRelic {
id: number;
name: string;
icon: string;
@@ -142,7 +148,7 @@ declare namespace TGApp.Game.Character {
* @property {string} affixes[].effect - 圣遗物套装效果
* @return RelicSet
*/
export interface RelicSet {
interface RelicSet {
id: number;
name: string;
affixes: Array<{
@@ -163,7 +169,7 @@ declare namespace TGApp.Game.Character {
* @property {number} pos - 命座位置
* @return LIConstellation
*/
export interface LIConstellation {
interface LIConstellation {
id: number;
name: string;
icon: string;
@@ -181,7 +187,7 @@ declare namespace TGApp.Game.Character {
* @property {string} icon - 时装图标
* @return LICostume
*/
export interface LICostume {
interface LICostume {
id: number;
name: string;
icon: string;

View File

@@ -1,10 +1,15 @@
/**
* @file types Game DailyNotes.d.ts
* @file types/Game/DailyNotes.d.ts
* @description 获取实时便笺数据类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.2
*/
/**
* @description 获取实时便笺数据
* @since Alpha v0.2.2
* @namespace TGApp.Game.DailyNotes
* @memberof TGApp.Game
*/
declare namespace TGApp.Game.DailyNotes {
/**
* @description 便笺数据返回
@@ -14,7 +19,8 @@ declare namespace TGApp.Game.DailyNotes {
* @property {FullInfo} data - 便笺数据
* @return Response
*/
export interface Response extends TGApp.BBS.Response.Base {
interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: FullInfo;
}
@@ -40,7 +46,7 @@ declare namespace TGApp.Game.DailyNotes {
* @property {Transform} transformer - 便笺数据转换器
* @return FullInfo
*/
export interface FullInfo {
interface FullInfo {
current_resin: number;
max_resin: number;
resin_recovery_time: string;
@@ -68,7 +74,7 @@ declare namespace TGApp.Game.DailyNotes {
* @property {string} remained_time - 剩余时间(秒)
* @return Expedition
*/
export interface Expedition {
interface Expedition {
avatar_side_icon: string;
status: string;
remained_time: string;
@@ -85,7 +91,7 @@ declare namespace TGApp.Game.DailyNotes {
* @property {string} last_job_id - 上次任务 ID
* @return Transform
*/
export interface Transform {
interface Transform {
obtained: boolean;
recovery_time: TransformTime;
wiki: string;
@@ -104,7 +110,7 @@ declare namespace TGApp.Game.DailyNotes {
* @property {boolean} reached - 是否已达到恢复时间
* @return TransformTime
*/
export interface TransformTime {
interface TransformTime {
Day: number;
Hour: number;
Minute: number;

View File

@@ -1,10 +1,15 @@
/**
* @file types Game Gacha.d.ts
* @file types/Game/Gacha.d.ts
* @description 游戏抽卡相关类型定义文件
* @author BTMuli<bt-muli@outlook.com>
* @since Beta v0.3.0
*/
/**
* @description 游戏抽卡相关类型定义命名空间
* @since Beta v0.3.0
* @namespace TGApp.Game.Gacha
* @memberof TGApp.Game
*/
declare namespace TGApp.Game.Gacha {
/**
* @description 获取 authkey 返回类型
@@ -16,7 +21,8 @@ declare namespace TGApp.Game.Gacha {
* @property {string} data.authkey - authkey
* @return AuthkeyResponse
*/
export interface AuthkeyResponse extends TGApp.BBS.Response.Base {
interface AuthkeyResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: {
sign_type: number;
authkey_ver: number;
@@ -35,7 +41,8 @@ declare namespace TGApp.Game.Gacha {
* @property {GachaItem[]} data.list - 抽卡记录列表
* @return GachaLogResponse
*/
export interface GachaLogResponse extends TGApp.BBS.Response.Base {
interface GachaLogResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: {
page: number;
size: number;
@@ -60,7 +67,7 @@ declare namespace TGApp.Game.Gacha {
* @property {string} id - 抽卡记录 id
* @return GachaItem
*/
export interface GachaItem {
interface GachaItem {
uid: string;
gacha_type: string;
item_id: string;

View File

@@ -1,10 +1,15 @@
/**
* @file types Game Record.d.ts
* @file types/Game/Record.d.ts
* @description 原神战绩相关类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.2
*/
/**
* @description 原神战绩相关类型定义命名空间
* @since Alpha v0.2.2
* @namespace TGApp.Game.Record
* @memberof TGApp.Game
*/
declare namespace TGApp.Game.Record {
/**
* @description 原神战绩数据返回类型
@@ -14,7 +19,8 @@ declare namespace TGApp.Game.Record {
* @property {FullData} data - 原神战绩数据
* @return Response
*/
export interface Response extends TGApp.BBS.Response.Base {
interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: FullData;
}
@@ -30,7 +36,7 @@ declare namespace TGApp.Game.Record {
* @property {Home[]} homes - 尘歌壶信息
* @return FullData
*/
export interface FullData {
interface FullData {
role: Role;
avatars: Avatar[];
stats: Stats;
@@ -49,7 +55,7 @@ declare namespace TGApp.Game.Record {
* @property {number} level - 等级
* @return Role
*/
export interface Role {
interface Role {
AvatarUrl: string;
nickname: string;
region: string;
@@ -72,7 +78,7 @@ declare namespace TGApp.Game.Record {
* @property {boolean} is_chosen - 角色是否展示
* @return Avatar
*/
export interface Avatar {
interface Avatar {
id: number;
image: string;
name: string;
@@ -107,7 +113,7 @@ declare namespace TGApp.Game.Record {
* @property {number} hydroculus_number - 水神瞳数量
* @return Stats
*/
export interface Stats {
interface Stats {
active_day_number: number;
achievement_number: number;
anemoculus_number: number;
@@ -145,7 +151,7 @@ declare namespace TGApp.Game.Record {
* @property {string} cover - 封面 URL
* @return WorldExplore
*/
export interface WorldExplore {
interface WorldExplore {
level: number;
exploration_percentage: number;
icon: string;
@@ -170,7 +176,7 @@ declare namespace TGApp.Game.Record {
* @property {string} icon - 图标
* @return WorldOffering
*/
export interface WorldOffering {
interface WorldOffering {
name: string;
level: number;
icon: string;
@@ -190,7 +196,7 @@ declare namespace TGApp.Game.Record {
* @property {string} comfort_level_icon - 洞天仙力等级图标
* @return Home
*/
export interface Home {
interface Home {
level: number;
visit_num: number;
comfort_num: number;

View File

@@ -1,10 +1,15 @@
/**
* @file types User Account.d.ts
* @file types/User/Account.d.ts
* @description 用户账号相关类型定义文件
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.1.5
*/
/**
* @description 用户账号相关类型定义命名空间
* @since Alpha v0.1.5
* @namespace TGApp.User.Account
* @memberof TGApp.User
*/
declare namespace TGApp.User.Account {
/**
* @description 游戏账号返回类型
@@ -14,7 +19,8 @@ declare namespace TGApp.User.Account {
* @property {Game[]} data.list 游戏账号列表
* @return GameResponse
*/
export interface GameResponse extends TGApp.BBS.Response.Base {
interface GameResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: {
list: Game[];
};
@@ -34,7 +40,7 @@ declare namespace TGApp.User.Account {
* @property {string} region_name 游戏区域名称
* @return Game
*/
export interface Game {
interface Game {
game_biz: string;
game_uid: string;
is_chosen: boolean;