✏️ 完善基本 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,11 +1,10 @@
/** /**
* @file plugins Mys utils doGameLogin * @file plugins/Mys/utils/doGameLogin
* @todo 完善
* @description 获取 gameToken曲线获取 stoken * @description 获取 gameToken曲线获取 stoken
* @author BTMuli <bt-muli@outlook.com>
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
// tauri
import { http } from "@tauri-apps/api"; import { http } from "@tauri-apps/api";
const device = crypto.randomUUID(); const device = crypto.randomUUID();
@@ -13,10 +12,10 @@ const device = crypto.randomUUID();
/** /**
* @description 获取登录二维码 * @description 获取登录二维码
* @since Beta v0.3.0 * @since Beta v0.3.0
* @returns {Promise<TGApp.Plugins.Mys.GameLogin.GetLoginQrData|TGApp.Plugins.Mys.Base.Response>} * @returns {Promise<TGApp.Plugins.Mys.GameLogin.GetLoginQrData|TGApp.BBS.Response.Base>}
*/ */
export async function getLoginQr(): Promise< export async function getLoginQr(): Promise<
TGApp.Plugins.Mys.GameLogin.GetLoginQrData | TGApp.Plugins.Mys.Base.Response TGApp.Plugins.Mys.GameLogin.GetLoginQrData | TGApp.BBS.Response.Base
> { > {
const url = "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/fetch"; const url = "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/fetch";
const data = { const data = {
@@ -24,7 +23,7 @@ export async function getLoginQr(): Promise<
device, device,
}; };
return await http return await http
.fetch<TGApp.Plugins.Mys.GameLogin.GetLoginQrResponse>(url, { .fetch<TGApp.Plugins.Mys.GameLogin.GetLoginQrResponse | TGApp.BBS.Response.Base>(url, {
method: "POST", method: "POST",
body: http.Body.json(data), body: http.Body.json(data),
}) })
@@ -38,16 +37,16 @@ export async function getLoginQr(): Promise<
* @description 获取登录状态 * @description 获取登录状态
* @since Beta v0.3.0 * @since Beta v0.3.0
* @param {string} ticket 二维码 ticket * @param {string} ticket 二维码 ticket
* @returns {Promise<TGApp.Plugins.Mys.GameLogin.GetLoginStatusData | TGApp.Plugins.Mys.Base.Response>} * @returns {Promise<TGApp.Plugins.Mys.GameLogin.GetLoginStatusData | TGApp.BBS.Response.Base>}
*/ */
export async function getLoginStatus( export async function getLoginStatus(
ticket: string, ticket: string,
): Promise<TGApp.Plugins.Mys.GameLogin.GetLoginStatusData | TGApp.Plugins.Mys.Base.Response> { ): Promise<TGApp.Plugins.Mys.GameLogin.GetLoginStatusData | TGApp.BBS.Response.Base> {
const url = "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/query"; const url = "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/query";
const data = { app_id: "4", device, ticket }; const data = { app_id: "4", device, ticket };
console.log(data); console.log(data);
return await http return await http
.fetch<TGApp.Plugins.Mys.GameLogin.GetLoginStatusResponse>(url, { .fetch<TGApp.Plugins.Mys.GameLogin.GetLoginStatusResponse | TGApp.BBS.Response.Base>(url, {
method: "POST", method: "POST",
body: http.Body.json(data), body: http.Body.json(data),
}) })

View File

@@ -1,11 +1,9 @@
/** /**
* @file plugins Mys request getEmojis.ts * @file plugins/Mys/request/getEmojis.ts
* @description Mys 表情包请求函数集合 * @description Mys 表情包请求函数集合
* @author BTMuli <bt-muli@outlook.com>
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
// tauri
import { http } from "@tauri-apps/api"; import { http } from "@tauri-apps/api";
/** /**
@@ -15,16 +13,18 @@ import { http } from "@tauri-apps/api";
*/ */
export async function getEmojis(): Promise<Record<string, string> | TGApp.BBS.Response.Base> { export async function getEmojis(): Promise<Record<string, string> | TGApp.BBS.Response.Base> {
const url = "https://bbs-api-static.miyoushe.com/misc/api/emoticon_set"; const url = "https://bbs-api-static.miyoushe.com/misc/api/emoticon_set";
return await http.fetch<TGApp.Plugins.Mys.Emoji.Response>(url).then((res) => { return await http
if (res.data.retcode === 0) { .fetch<TGApp.Plugins.Mys.Emoji.Response | TGApp.BBS.Response.Base>(url)
const emojis: Record<string, string> = {}; .then((res) => {
res.data.data.list.forEach((series) => { if (res.data.retcode === 0) {
series.list.forEach((emoji) => { const emojis: Record<string, string> = {};
emojis[emoji.name] = emoji.icon; res.data.data.list.forEach((series) => {
series.list.forEach((emoji) => {
emojis[emoji.name] = emoji.icon;
});
}); });
}); return emojis;
return emojis; }
} return res.data;
return res.data; });
});
} }

View File

@@ -1,29 +0,0 @@
/**
* @file plugins Mys types Base.d.ts
* @description Mys 插件基础类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.1
*/
/**
* @description Mys 插件基础类型
* @since Alpha v0.2.1
* @namespace Base
* @return Base
*/
declare namespace TGApp.Plugins.Mys.Base {
/**
* @description Mys Response 统一接口
* @since Alpha v0.2.1
* @interface Response
* @property {number} retcode 状态码
* @property {string} message 状态信息
* @property {any} data 数据
* @return Response
*/
export interface Response {
retcode: number;
message: string;
data: any;
}
}

View File

@@ -1,27 +1,27 @@
/** /**
* @file plugins Mys types Emoji.d.ts * @file plugins/Mys/types/Emoji.d.ts
* @description Mys 表情包类型声明文件 * @description Mys 表情包类型声明文件
* @author BTMuli <bt-muli@outlook.com>
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
/** /**
* @description Mys 表情包类型 * @description Mys 表情包类型
* @since Beta v0.3.0 * @since Beta v0.3.0
* @namespace Emoji * @namespace TGApp.Plugins.Mys.Emoji
* return Emoji * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.Emoji { declare namespace TGApp.Plugins.Mys.Emoji {
/** /**
* @description 获取表情包列表返回 * @description 获取表情包列表返回
* @since Beta v0.3.0 * @since Beta v0.3.0
* @interface Response * @interface Response
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {Series[]} data.list 表情包列表 * @property {Series[]} data.list 表情包列表
* @property {unknown} data.recently_emoticon 最近使用的表情包 * @property {unknown} data.recently_emoticon 最近使用的表情包
* @return Response * @return Response
*/ */
export interface Response extends TGApp.Plugins.Mys.Base.Response { interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: { data: {
list: Series[]; list: Series[];
recently_emoticon: unknown; recently_emoticon: unknown;
@@ -43,7 +43,7 @@ declare namespace TGApp.Plugins.Mys.Emoji {
* @property {boolean} is_available 表情包系列是否可用 * @property {boolean} is_available 表情包系列是否可用
* @return Series * @return Series
*/ */
export interface Series { interface Series {
id: number; id: number;
name: string; name: string;
icon: string; icon: string;
@@ -70,7 +70,7 @@ declare namespace TGApp.Plugins.Mys.Emoji {
* @property {unknown[]} keywords 表情包关键词 * @property {unknown[]} keywords 表情包关键词
* @return EmojiItem * @return EmojiItem
*/ */
export interface EmojiItem { interface EmojiItem {
id: number; id: number;
name: string; name: string;
icon: string; icon: string;

View File

@@ -1,5 +1,5 @@
/** /**
* @file plugins Mys types Gacha.d.ts * @file plugins/Mys/types/Gacha.d.ts
* @description Mys 插件卡池类型定义文件 * @description Mys 插件卡池类型定义文件
* @since Beta v0.3.3 * @since Beta v0.3.3
*/ */
@@ -7,19 +7,20 @@
/** /**
* @description Mys 卡池类型定义 * @description Mys 卡池类型定义
* @since Beta v0.3.3 * @since Beta v0.3.3
* @namespace Gacha * @namespace TGApp.Plugins.Mys.Gacha
* @return Gacha * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.Gacha { declare namespace TGApp.Plugins.Mys.Gacha {
/** /**
* @description 获取卡池信息返回 * @description 获取卡池信息返回
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @interface Response * @interface Response
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {Data[]} data.list 卡池数据 * @property {Data[]} data.list 卡池数据
* @return Response * @return Response
*/ */
interface Response extends TGApp.Plugins.Mys.Base.Response { interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: { data: {
list: Data[]; list: Data[];
}; };

View File

@@ -1,26 +1,26 @@
/** /**
* @file plugins Mys types GameLogin.d.ts * @file plugins/Mys/types/GameLogin.d.ts
* @description Mys 插件 Game 登录类型定义文件 * @description Mys 插件 Game 登录类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
/** /**
* @description Mys 插件 Game 登录类型 * @description Mys 插件 Game 登录类型
* @since Beta v0.3.0 * @since Beta v0.3.0
* @namespace GameLogin * @namespace TGApp.Plugins.Mys.GameLogin
* @return GameLogin * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.GameLogin { declare namespace TGApp.Plugins.Mys.GameLogin {
/** /**
* @description 获取登录二维码返回数据 * @description 获取登录二维码返回数据
* @since Beta v0.3.0 * @since Beta v0.3.0
* @interface GetLoginQrResponse * @interface GetLoginQrResponse
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {GetLoginQrData} data 数据 * @property {GetLoginQrData} data 数据
* @return GetLoginQrResponse * @return GetLoginQrResponse
*/ */
export interface GetLoginQrResponse extends TGApp.Plugins.Mys.Base.Response { interface GetLoginQrResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: GetLoginQrData; data: GetLoginQrData;
} }
@@ -31,7 +31,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin {
* @property {string} url 二维码链接 * @property {string} url 二维码链接
* @return GetLoginQrData * @return GetLoginQrData
*/ */
export interface GetLoginQrData { interface GetLoginQrData {
url: string; url: string;
} }
@@ -39,11 +39,12 @@ declare namespace TGApp.Plugins.Mys.GameLogin {
* @description 获取登录状态返回数据 * @description 获取登录状态返回数据
* @since Beta v0.3.0 * @since Beta v0.3.0
* @interface GetLoginStatusResponse * @interface GetLoginStatusResponse
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {GetLoginStatusData} data 数据 * @property {GetLoginStatusData} data 数据
* @return GetLoginStatusResponse * @return GetLoginStatusResponse
*/ */
export interface GetLoginStatusResponse extends TGApp.Plugins.Mys.Base.Response { interface GetLoginStatusResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: GetLoginStatusData; data: GetLoginStatusData;
} }
@@ -55,7 +56,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin {
* @property {StatusPayload} payload 状态数据 * @property {StatusPayload} payload 状态数据
* @return GetLoginStatusData * @return GetLoginStatusData
*/ */
export interface GetLoginStatusData { interface GetLoginStatusData {
stat: string; stat: string;
payload: StatusPayload; payload: StatusPayload;
} }
@@ -69,7 +70,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin {
* @property {string} raw 序列化数据,反序列化后是 {uid: string, token: string} * @property {string} raw 序列化数据,反序列化后是 {uid: string, token: string}
* @return StatusPayload * @return StatusPayload
*/ */
export interface StatusPayload { interface StatusPayload {
ext: string; ext: string;
proto: string; proto: string;
raw: string; raw: string;
@@ -83,7 +84,7 @@ declare namespace TGApp.Plugins.Mys.GameLogin {
* @property {string} token 用户 token * @property {string} token 用户 token
* @return StatusPayloadRaw * @return StatusPayloadRaw
*/ */
export interface StatusPayloadRaw { interface StatusPayloadRaw {
uid: string; uid: string;
token: string; token: string;
} }

View File

@@ -1,26 +1,26 @@
/** /**
* @file plugins Mys types Lottery.d.ts * @file plugins/Mys/types/Lottery.d.ts
* @description Mys 插件抽奖类型定义文件 * @description Mys 插件抽奖类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.1 * @since Alpha v0.2.1
*/ */
/** /**
* @description Mys 插件抽奖类型 * @description Mys 插件抽奖类型
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @namespace Lottery * @namespace TGApp.Plugins.Mys.Lottery
* @return Lottery * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.Lottery { declare namespace TGApp.Plugins.Mys.Lottery {
/** /**
* @description 抽奖返回数据 * @description 抽奖返回数据
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @interface Response * @interface Response
* @extends TGApp.Plugins.Mys.Base.Response; * @extends TGApp.BBS.Response.Base
* @property {FullData} data.show_lottery 抽奖数据 * @property {FullData} data.show_lottery 抽奖数据
* @return Response * @return Response
*/ */
export interface Response extends TGApp.Plugins.Mys.Base.Response { interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: { data: {
show_lottery: FullData; show_lottery: FullData;
}; };
@@ -47,7 +47,7 @@ declare namespace TGApp.Plugins.Mys.Lottery {
* @property {string} now_time 当前时间 * @property {string} now_time 当前时间
* @return FullData * @return FullData
*/ */
export interface FullData { interface FullData {
id: string; id: string;
creator: TGApp.Plugins.Mys.User.Post; creator: TGApp.Plugins.Mys.User.Post;
draw_time: string; draw_time: string;
@@ -77,7 +77,7 @@ declare namespace TGApp.Plugins.Mys.Lottery {
* @property {string} id 奖励 ID * @property {string} id 奖励 ID
* @return Reward * @return Reward
*/ */
export interface Reward { interface Reward {
reward_name: string; reward_name: string;
winner_number: number; winner_number: number;
scheduled_winner_number: number; scheduled_winner_number: number;
@@ -98,7 +98,7 @@ declare namespace TGApp.Plugins.Mys.Lottery {
* @property {RenderReward[]} rewards 奖励列表 * @property {RenderReward[]} rewards 奖励列表
* @return RenderCard * @return RenderCard
*/ */
export interface RenderCard { interface RenderCard {
id: string; id: string;
upWay: string; upWay: string;
status: string; status: string;
@@ -117,7 +117,7 @@ declare namespace TGApp.Plugins.Mys.Lottery {
* @property {TGApp.Plugins.Mys.User.Post[]} users 用户列表 * @property {TGApp.Plugins.Mys.User.Post[]} users 用户列表
* @return RenderReward * @return RenderReward
*/ */
export interface RenderReward { interface RenderReward {
name: string; name: string;
win: number; win: number;
goal: number; goal: number;

View File

@@ -1,26 +1,26 @@
/** /**
* @file plugins Mys types news.d.ts * @file plugins/Mys/types/news.d.ts
* @description Mys 插件咨讯类型定义文件 * @description Mys 插件咨讯类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.1 * @since Alpha v0.2.1
*/ */
/** /**
* @description Mys 插件咨讯类型 * @description Mys 插件咨讯类型
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @namespace News * @namespace TGApp.Plugins.Mys.News
* @return News * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.News { declare namespace TGApp.Plugins.Mys.News {
/** /**
* @description 咨讯返回数据 * @description 咨讯返回数据
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @interface Response * @interface Response
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {FullData} data 咨讯数据 * @property {FullData} data 咨讯数据
* @return Response * @return Response
*/ */
export interface Response extends TGApp.Plugins.Mys.Base.Response { interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: FullData; data: FullData;
} }
@@ -33,7 +33,7 @@ declare namespace TGApp.Plugins.Mys.News {
* @property {Item[]} list 咨讯列表 * @property {Item[]} list 咨讯列表
* @return FullData * @return FullData
*/ */
export interface FullData { interface FullData {
last_id: number; last_id: number;
is_last: boolean; is_last: boolean;
list: Item[]; list: Item[];
@@ -66,7 +66,7 @@ declare namespace TGApp.Plugins.Mys.News {
* @property {Meta} news_meta 元数据 * @property {Meta} news_meta 元数据
* @returns Item * @returns Item
*/ */
export interface Item { interface Item {
post: TGApp.Plugins.Mys.Post.Post; post: TGApp.Plugins.Mys.Post.Post;
forum: TGApp.Plugins.Mys.Post.Forum; forum: TGApp.Plugins.Mys.Post.Forum;
topics: TGApp.Plugins.Mys.Post.Topic[]; topics: TGApp.Plugins.Mys.Post.Topic[];
@@ -99,7 +99,7 @@ declare namespace TGApp.Plugins.Mys.News {
* @property {string} end_at_sec 活动结束时间戳,单位秒 * @property {string} end_at_sec 活动结束时间戳,单位秒
* @return Meta * @return Meta
*/ */
export interface Meta { interface Meta {
activity_status: number; activity_status: number;
start_at_sec: string; start_at_sec: string;
end_at_sec: string; end_at_sec: string;
@@ -130,7 +130,7 @@ declare namespace TGApp.Plugins.Mys.News {
* @property {number} data.view 帖子浏览数 * @property {number} data.view 帖子浏览数
* @return RenderCard * @return RenderCard
*/ */
export interface RenderCard { interface RenderCard {
title: string; title: string;
cover: string; cover: string;
postId: number; postId: number;
@@ -162,7 +162,7 @@ declare namespace TGApp.Plugins.Mys.News {
* @property {string} colorCss 活动状态按钮背景色 * @property {string} colorCss 活动状态按钮背景色
* @returns RenderStatus * @returns RenderStatus
*/ */
export interface RenderStatus { interface RenderStatus {
status: string; status: string;
colorCss: string; colorCss: string;
} }

View File

@@ -1,26 +1,26 @@
/** /**
* @file plugins Mys types Obc.d.ts * @file plugins/Mys/types/Obc.d.ts
* @description Mys obc 类型定义文件 * @description Mys obc 类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.1 * @since Alpha v0.2.1
*/ */
/** /**
* @description Mys obc 类型 * @description Mys obc 类型
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @namespace Obc * @namespace TGApp.Plugins.Mys.Obc
* @return Obc * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.Obc { declare namespace TGApp.Plugins.Mys.Obc {
/** /**
* @description Mys obc 返回数据 * @description Mys obc 返回数据
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @interface Response * @interface Response
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {Obc[]} data.list obc 列表 * @property {Obc[]} data.list obc 列表
* @return Response * @return Response
*/ */
export interface Response extends TGApp.Plugins.Mys.Base.Response { interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: { data: {
list: Obc[]; list: Obc[];
}; };
@@ -39,7 +39,7 @@ declare namespace TGApp.Plugins.Mys.Obc {
* @property {unknown[]} list 列表 * @property {unknown[]} list 列表
* @return Data * @return Data
*/ */
export interface Data { interface Data {
id: number; id: number;
name: string; name: string;
parent_id: number; parent_id: number;

View File

@@ -1,26 +1,26 @@
/** /**
* @file plugins Mys types Position.d.ts * @file plugins/Mys/types/Position.d.ts
* @description Mys 插件热点追踪接口 * @description Mys 插件热点追踪接口
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.1 * @since Alpha v0.2.1
*/ */
/** /**
* @description Mys 插件热点追踪类型 * @description Mys 插件热点追踪类型
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @namespace Position * @namespace TGApp.Plugins.Mys.Position
* @return Position * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.Position { declare namespace TGApp.Plugins.Mys.Position {
/** /**
* @description 热点追踪信息的返回类型 * @description 热点追踪信息的返回类型
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @interface Response * @interface Response
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {ObcItem[]} data.list obc 列表 * @property {ObcItem[]} data.list obc 列表
* @return Response * @return Response
*/ */
export interface Response extends TGApp.Plugins.Mys.Obc.Response { interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: { data: {
list: ObcItem[]; list: ObcItem[];
}; };
@@ -34,7 +34,7 @@ declare namespace TGApp.Plugins.Mys.Position {
* @property {Data[]} list 列表 * @property {Data[]} list 列表
* @return ObcItem * @return ObcItem
*/ */
export interface ObcItem extends TGApp.Plugins.Mys.Obc.Data { interface ObcItem extends TGApp.Plugins.Mys.Obc.Data {
list: Data[]; list: Data[];
} }
@@ -57,7 +57,7 @@ declare namespace TGApp.Plugins.Mys.Position {
* @property {string} end_time 结束时间 // 1680465599000 * @property {string} end_time 结束时间 // 1680465599000
* @return Data * @return Data
*/ */
export interface Data { interface Data {
recommend_id: number; recommend_id: number;
content_id: number; content_id: number;
title: string; title: string;
@@ -88,7 +88,7 @@ declare namespace TGApp.Plugins.Mys.Position {
* @property {number} time.endStamp 结束时间戳 * @property {number} time.endStamp 结束时间戳
* @return RenderCard * @return RenderCard
*/ */
export interface RenderCard { interface RenderCard {
title: string; title: string;
postId: number; postId: number;
icon: string; icon: string;

View File

@@ -1,5 +1,5 @@
/** /**
* @file plugins Mys types post.d.ts * @file plugins/Mys/types/post.d.ts
* @description Mys 插件帖子类型定义文件 * @description Mys 插件帖子类型定义文件
* @since Beta v0.3.3 * @since Beta v0.3.3
*/ */
@@ -7,19 +7,20 @@
/** /**
* @description Mys 插件帖子类型 * @description Mys 插件帖子类型
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @namespace Post * @namespace TGApp.Plugins.Mys.Post
* @return Post * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.Post { declare namespace TGApp.Plugins.Mys.Post {
/** /**
* @description 帖子返回数据 * @description 帖子返回数据
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @interface Response * @interface Response
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {FullData} data.post 帖子数据 * @property {FullData} data.post 帖子数据
* @return Response * @return Response
*/ */
export interface Response extends TGApp.Plugins.Mys.Base.Response { interface Response extends TGApp.BBS.Response.Base {
retcode: 0;
data: { data: {
post: FullData; post: FullData;
}; };
@@ -52,7 +53,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {TGApp.Plugins.Mys.News.Meta} news_meta 咨讯元数据,可能为 null * @property {TGApp.Plugins.Mys.News.Meta} news_meta 咨讯元数据,可能为 null
* @return FullData * @return FullData
*/ */
export interface FullData { interface FullData {
post: Post; post: Post;
forum: Forum; forum: Forum;
topics: Topic[]; topics: Topic[];
@@ -121,7 +122,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {number} selected_comment 是否选择评论 * @property {number} selected_comment 是否选择评论
* @return Post * @return Post
*/ */
export interface Post { interface Post {
game_id: number; game_id: number;
post_id: string; post_id: string;
f_forum_id: number; f_forum_id: number;
@@ -175,7 +176,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {unknown} forum_cate 版块分类,可能为 null * @property {unknown} forum_cate 版块分类,可能为 null
* @return Forum * @return Forum
*/ */
export interface Forum { interface Forum {
id: number; id: number;
name: string; name: string;
icon: string; icon: string;
@@ -197,7 +198,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {number} content_type 内容类型 * @property {number} content_type 内容类型
* @return Topic * @return Topic
*/ */
export interface Topic { interface Topic {
id: number; id: number;
name: string; name: string;
cover: string; cover: string;
@@ -219,7 +220,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {number} forward_num 转发数 * @property {number} forward_num 转发数
* @return Stat * @return Stat
*/ */
export interface Stat { interface Stat {
view_num: number; view_num: number;
reply_num: number; reply_num: number;
like_num: number; like_num: number;
@@ -249,7 +250,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {boolean} is_deleted 是否已删除 * @property {boolean} is_deleted 是否已删除
* @return Image * @return Image
*/ */
export interface Image { interface Image {
url: string; url: string;
height: number; height: number;
width: number; width: number;
@@ -278,7 +279,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {number} answer_num 回答数 * @property {number} answer_num 回答数
* @return HelpSys * @return HelpSys
*/ */
export interface HelpSys { interface HelpSys {
top_up: unknown | null; top_up: unknown | null;
top_n: unknown[]; top_n: unknown[];
answer_num: number; answer_num: number;
@@ -293,7 +294,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {string[]} images 图片 URL * @property {string[]} images 图片 URL
* @return Content * @return Content
*/ */
export interface PostContent { interface PostContent {
describe: string; describe: string;
images?: string[]; images?: string[];
} }
@@ -330,7 +331,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {string} attributes.link 链接 * @property {string} attributes.link 链接
* @return StructuredContent * @return StructuredContent
*/ */
export interface StructuredContent { interface StructuredContent {
insert: insert:
| { | {
image?: string; image?: string;
@@ -386,7 +387,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {number} review_status 审核状态 * @property {number} review_status 审核状态
* @return StructuredVod * @return StructuredVod
*/ */
export interface StructuredVod { interface StructuredVod {
id: number; id: number;
duration: number; duration: number;
cover: string; cover: string;
@@ -422,7 +423,7 @@ declare namespace TGApp.Plugins.Mys.Post {
* @property {number} landing_url_type 落地链接类型 * @property {number} landing_url_type 落地链接类型
* @return StructuredLinkCard * @return StructuredLinkCard
*/ */
export interface StructuredLinkCard { interface StructuredLinkCard {
link_type: number; link_type: number;
origin_url: string; origin_url: string;
landing_url: string; landing_url: string;

View File

@@ -1,26 +1,26 @@
/** /**
* @file plugins Mys types user.ts * @file plugins/Mys/types/user.ts
* @description Mys 插件用户类型定义文件 * @description Mys 插件用户类型定义文件
* @author BTMuli <bt-muli@outlook.com>
* @since Alpha v0.2.2 * @since Alpha v0.2.2
*/ */
/** /**
* @description Mys 插件用户类型 * @description Mys 插件用户类型
* @since Alpha v0.2.2 * @since Alpha v0.2.2
* @namespace User * @namespace TGApp.Plugins.Mys.User
* @return User * @memberof TGApp.Plugins.Mys
*/ */
declare namespace TGApp.Plugins.Mys.User { declare namespace TGApp.Plugins.Mys.User {
/** /**
* @description 主页用户信息返回 * @description 主页用户信息返回
* @since Alpha v0.2.1 * @since Alpha v0.2.1
* @interface HomeResponse * @interface HomeResponse
* @extends TGApp.Plugins.Mys.Base.Response * @extends TGApp.BBS.Response.Base
* @property {Home} data 用户信息 * @property {Home} data 用户信息
* @return HomeResponse * @return HomeResponse
*/ */
export interface HomeResponse extends TGApp.Plugins.Mys.Base.Response { interface HomeResponse extends TGApp.BBS.Response.Base {
retcode: 0;
data: Home; data: Home;
} }
@@ -45,7 +45,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {number} audit_info.nickname_status 昵称审核状态 * @property {number} audit_info.nickname_status 昵称审核状态
* @return Home * @return Home
*/ */
export interface Home { interface Home {
user_info: Info; user_info: Info;
follow_relation: unknown; follow_relation: unknown;
auth_relations: unknown[]; auth_relations: unknown[];
@@ -86,7 +86,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {string} ip_region 用户 IP 地区 * @property {string} ip_region 用户 IP 地区
* @return Info * @return Info
*/ */
export interface Info { interface Info {
uid: string; uid: string;
nickname: string; nickname: string;
introduce: string; introduce: string;
@@ -112,7 +112,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {string} label 认证标签 * @property {string} label 认证标签
* @return Certification * @return Certification
*/ */
export interface Certification { interface Certification {
type: number; type: number;
label: string; label: string;
} }
@@ -126,7 +126,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {number} game_id 游戏 ID * @property {number} game_id 游戏 ID
* @return LevelExp * @return LevelExp
*/ */
export interface LevelExp { interface LevelExp {
level: number; level: number;
exp: number; exp: number;
game_id: number; game_id: number;
@@ -147,7 +147,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {string} follow_collection_cnt 收藏数 * @property {string} follow_collection_cnt 收藏数
* @return Archive * @return Archive
*/ */
export interface Archive { interface Archive {
like_num: string; like_num: string;
post_num: string; post_num: string;
replypost_num: string; replypost_num: string;
@@ -192,7 +192,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {number} created_at 创建时间 * @property {number} created_at 创建时间
* @return Community * @return Community
*/ */
export interface Community { interface Community {
is_realname: boolean; is_realname: boolean;
agree_status: boolean; agree_status: boolean;
silent_end_time: number; silent_end_time: number;
@@ -244,7 +244,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {string} pendant 用户挂件 URL可能为 "" * @property {string} pendant 用户挂件 URL可能为 ""
* @return Post * @return Post
*/ */
export interface Post { interface Post {
uid: string; uid: string;
nickname: string; nickname: string;
introduce: string; introduce: string;
@@ -269,7 +269,7 @@ declare namespace TGApp.Plugins.Mys.User {
* @property {boolean} is_collected 是否收藏 * @property {boolean} is_collected 是否收藏
* @returns {SelfOperation} * @returns {SelfOperation}
*/ */
export interface SelfOperation { interface SelfOperation {
attitude: number; attitude: number;
is_collected: boolean; is_collected: boolean;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request genAuthkey.ts * @file web/request/genAuthkey.ts
* @description 生成 authkey * @description 生成 authkey
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
@@ -29,7 +29,7 @@ export async function genAuthkey(
}; };
const header = TGUtils.User.getHeader(cookie, "POST", JSON.stringify(data), "lk2", true); const header = TGUtils.User.getHeader(cookie, "POST", JSON.stringify(data), "lk2", true);
return await http return await http
.fetch<TGApp.Game.Gacha.AuthkeyResponse>(url, { .fetch<TGApp.Game.Gacha.AuthkeyResponse | TGApp.BBS.Response.Base>(url, {
method: "POST", method: "POST",
headers: header, headers: header,
body: http.Body.json(data), body: http.Body.json(data),

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request getAbyss.ts * @file web/request/getAbyss.ts
* @description 获取深渊信息 * @description 获取深渊信息
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
@@ -27,7 +27,7 @@ export async function getAbyss(
const params = { role_id, schedule_type, server: account.region }; const params = { role_id, schedule_type, server: account.region };
const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
return await http return await http
.fetch<TGApp.Game.Abyss.Response>(url, { .fetch<TGApp.Game.Abyss.Response | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
headers: header, headers: header,
query: params, query: params,

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request getCookieToken.ts * @file web/request/getCookieToken.ts
* @description 获取 Cookie Token 的请求函数 * @description 获取 Cookie Token 的请求函数
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
@@ -28,7 +28,7 @@ export async function getCookieTokenBySToken(
const params = { stoken: Stoken }; const params = { stoken: Stoken };
const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
return await http return await http
.fetch<TGApp.BBS.Response.getCookieTokenBySToken>(url, { .fetch<TGApp.BBS.Response.getCookieTokenBySToken | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
headers: header, headers: header,
query: params, query: params,
@@ -53,7 +53,7 @@ export async function getCookieTokenByGameToken(
const url = "https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoByGameToken"; const url = "https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoByGameToken";
const data = { account_id: Number(accountId), game_token: gameToken }; const data = { account_id: Number(accountId), game_token: gameToken };
return await http return await http
.fetch<TGApp.BBS.Response.getCookieTokenByGameToken>(url, { .fetch<TGApp.BBS.Response.getCookieTokenByGameToken | TGApp.BBS.Response.Base>(url, {
method: "POST", method: "POST",
body: http.Body.json(data), body: http.Body.json(data),
}) })

View File

@@ -1,11 +1,9 @@
/** /**
* @file web request getGachaLog.ts * @file web/request/getGachaLog.ts
* @description 获取抽卡记录请求函数 * @description 获取抽卡记录请求函数
* @author BTMuli <bt-muli@outlook.com>
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
// tauri
import { http } from "@tauri-apps/api"; import { http } from "@tauri-apps/api";
/** /**
@@ -33,7 +31,7 @@ export async function getGachaLog(
end_id: endId, end_id: endId,
}; };
return await http return await http
.fetch<TGApp.Game.Gacha.GachaLogResponse>(url, { .fetch<TGApp.Game.Gacha.GachaLogResponse | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
query: params, query: params,
}) })

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request getGameAccounts.ts * @file web/request/getGameAccounts.ts
* @description 获取游戏账号信息相关请求函数 * @description 获取游戏账号信息相关请求函数
* @since Alpha v0.1.5 * @since Alpha v0.1.5
*/ */
@@ -65,7 +65,7 @@ async function getGameAccounts(
): Promise<TGApp.BBS.Response.Base | TGApp.User.Account.Game[]> { ): Promise<TGApp.BBS.Response.Base | TGApp.User.Account.Game[]> {
const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
return await http return await http
.fetch<TGApp.User.Account.GameResponse>(url, { .fetch<TGApp.User.Account.GameResponse | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
headers: header, headers: header,
query: params, query: params,

View File

@@ -1,5 +1,5 @@
/** /**
* @file core utils getGameRecord.ts * @file core/utils/getGameRecord.ts
* @description 获取游戏数据的函数 * @description 获取游戏数据的函数
* @since Alpha v0.2.1 * @since Alpha v0.2.1
*/ */
@@ -30,7 +30,7 @@ export async function getGameRecord(
const params = { role_id: user.gameUid, server: user.region }; const params = { role_id: user.gameUid, server: user.region };
const header = TGUtils.User.getHeader(ck, "GET", params, "common"); const header = TGUtils.User.getHeader(ck, "GET", params, "common");
return await http return await http
.fetch<TGApp.Game.Record.Response>(url, { .fetch<TGApp.Game.Record.Response | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
headers: header, headers: header,
query: params, query: params,

View File

@@ -1,7 +1,6 @@
/** /**
* @file web request getLToken.ts * @file web/request/getLToken.ts
* @description 获取 ltoken 的请求 * @description 获取 ltoken 的请求
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
@@ -29,7 +28,7 @@ export async function getLTokenBySToken(
const params = { stoken: Stoken }; const params = { stoken: Stoken };
const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
return await http return await http
.fetch<TGApp.BBS.Response.getLTokenBySToken>(url, { .fetch<TGApp.BBS.Response.getLTokenBySToken | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
headers: header, headers: header,
query: params, query: params,

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request getRoleList.ts * @file web/request/getRoleList.ts
* @description 获取游戏角色列表的请求方法 * @description 获取游戏角色列表的请求方法
* @since Alpha v0.2.0 * @since Alpha v0.2.0
*/ */
@@ -33,7 +33,7 @@ export async function getGameRoleListByLToken(
}; };
const header = TGUtils.User.getHeader(ck, "POST", JSON.stringify(data), "common"); const header = TGUtils.User.getHeader(ck, "POST", JSON.stringify(data), "common");
return await http return await http
.fetch<TGApp.Game.Character.ListResponse>(url, { .fetch<TGApp.Game.Character.ListResponse | TGApp.BBS.Response.Base>(url, {
method: "POST", method: "POST",
headers: header, headers: header,
body: http.Body.json(data), body: http.Body.json(data),

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request getStoken.ts * @file web/request/getStoken.ts
* @description 获取 stoken * @description 获取 stoken
* @since Beta v0.3.0 * @since Beta v0.3.0
*/ */
@@ -25,7 +25,7 @@ export async function getStokenByGameToken(
"x-rpc-app_id": TGConstant.BBS.APP_ID, "x-rpc-app_id": TGConstant.BBS.APP_ID,
}; };
return await http return await http
.fetch<TGApp.BBS.Response.getStokenByGameToken>(url, { .fetch<TGApp.BBS.Response.getStokenByGameToken | TGApp.BBS.Response.Base>(url, {
method: "POST", method: "POST",
headers: header, headers: header,
body: http.Body.json(data), body: http.Body.json(data),

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request getTokens.ts * @file web/request/getTokens.ts
* @description 获取游戏 Token * @description 获取游戏 Token
* @since Alpha v0.1.5 * @since Alpha v0.1.5
*/ */
@@ -29,7 +29,7 @@ export async function getTokensByLoginTicket(
const params = { login_ticket: ticket, token_types: 3, uid }; const params = { login_ticket: ticket, token_types: 3, uid };
const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); const header = TGUtils.User.getHeader(cookie, "GET", params, "common");
return await http return await http
.fetch<TGApp.BBS.Response.getTokens>(url, { .fetch<TGApp.BBS.Response.getTokens | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
headers: header, headers: header,
query: params, query: params,

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request getUserInfo.ts * @file web/request/getUserInfo.ts
* @description 获取用户信息请求 * @description 获取用户信息请求
* @since Beta v0.3.4 * @since Beta v0.3.4
*/ */
@@ -28,7 +28,7 @@ export async function getUserInfoByCookie(
const params = { gids: "2" }; const params = { gids: "2" };
const header = TGUtils.User.getHeader(cookie, "GET", params, "common", true); const header = TGUtils.User.getHeader(cookie, "GET", params, "common", true);
return await http return await http
.fetch<TGApp.Plugins.Mys.User.HomeResponse>(url, { .fetch<TGApp.Plugins.Mys.User.HomeResponse | TGApp.BBS.Response.Base>(url, {
method: "GET", method: "GET",
headers: header, headers: header,
query: params, query: params,

View File

@@ -1,5 +1,5 @@
/** /**
* @file web request verifyLToken.ts * @file web/request/verifyLToken.ts
* @description 验证 stoken 的请求函数 * @description 验证 stoken 的请求函数
* @since Alpha v0.1.5 * @since Alpha v0.1.5
*/ */
@@ -28,7 +28,7 @@ export async function verifyLToken(
const data = { ltoken }; const data = { ltoken };
const header = TGUtils.User.getHeader(cookie, "POST", data, "common"); const header = TGUtils.User.getHeader(cookie, "POST", data, "common");
return await http return await http
.fetch<TGApp.BBS.Response.verifyUserInfoBySToken>(url, { .fetch<TGApp.BBS.Response.verifyUserInfoBySToken | TGApp.BBS.Response.Base>(url, {
method: "POST", method: "POST",
headers: header, headers: header,
body: http.Body.json(data), body: http.Body.json(data),