🚸 活动icon点击事件,调整类型声明

This commit is contained in:
目棃
2024-12-20 21:11:01 +08:00
parent 2c2d9d319c
commit 6494a85397
10 changed files with 75 additions and 326 deletions

View File

@@ -1,151 +1,10 @@
/**
* @file types/BBS/Account.d.ts
* @description BBS 账户相关类型定义文件
* @since Beta v0.6.0
* @since Beta v0.6.7
*/
/**
* @description 米游社账户信息
* @since Beta v0.6.0
* @namespace TGApp.BBS.Account
* @memberof TGApp.BBS
*/
declare namespace TGApp.BBS.Account {
/**
* @description stoken 验证获取的用户信息
* @interface VerifySTokenInfo
* @since Alpha v0.1.5
* @property {string} aid 账号 id
* @property {string} mid mid
* @property {string} account_name 账号名称
* @property {string} email 邮箱
* @property {number} is_email_verify 是否验证邮箱 // 0 未验证 1 已验证
* @property {string} area_code 手机区号 // '+86'
* @property {string} safe_mobile 手机号 // 部分明文,中间隐藏
* @property {string} realname 真实姓名 // 最后一位明文,其他隐藏
* @property {string} identity_code 身份证号 // 头尾三位明文,其他隐藏
* @property {string} rebind_area_code 重新绑定手机区号
* @property {string} rebind_mobile 重新绑定手机号
* @property {string} rebind_mobile_time 重新绑定手机时间
* @property {unknown[]} links 账号绑定信息
* @return VerifySTokenInfo
*/
interface VerifySTokenInfo {
aid: string;
mid: string;
account_name: string;
email: string;
is_email_verify: number;
area_code: string;
safe_mobile: string;
realname: string;
identity_code: string;
rebind_area_code: string;
rebind_mobile: string;
rebind_mobile_time: string;
links: unknown[];
}
/**
* @description 通过 gameToken 获取 stoken 返回的用户信息
* @interface getStokenByGameTokenInfo
* @since Beta v0.3.0
* @property {string} aid 账号 id
* @property {string} mid mid
* @property {string} account_name 账号名称
* @property {string} email 邮箱
* @property {number} is_email_verify 是否验证邮箱 // 0 未验证 1 已验证
* @property {string} area_code 手机区号 // '+86'
* @property {string} mobile 手机号 // 部分明文,中间隐藏
* @property {string} safe_area_code 安全手机区号
* @property {string} safe_mobile 安全手机号
* @property {string} realname 真实姓名 // 最后一位明文,其他隐藏
* @property {string} identity_code 身份证号 // 头尾三位明文,其他隐藏
* @property {string} rebind_area_code 重新绑定手机区号
* @property {string} rebind_mobile 重新绑定手机号
* @property {string} rebind_mobile_time 重新绑定手机时间
* @property {unknown[]} links 账号绑定信息
* @property {string} country 国家
* @return getStokenByGameTokenInfo
*/
interface getStokenByGameTokenInfo {
aid: string;
mid: string;
account_name: string;
email: string;
is_email_verify: number;
area_code: string;
mobile: string;
safe_area_code: string;
safe_mobile: string;
realname: string;
identity_code: string;
rebind_area_code: string;
rebind_mobile: string;
rebind_mobile_time: string;
links: unknown[];
country: string;
}
/**
* @description 通过 sToken 获取 actionTicket 返回数据里的用户信息
* @interface getActionTicketBySTokenInfo
* @since Beta v0.3.4
* @property {boolean} is_realname 是否实名认证
* @property {string} mobile 手机号
* @property {string} safe_mobile 安全手机号
* @property {string} account_id 账号 id
* @property {string} account_name 账号名称
* @property {string} email 邮箱
* @property {boolean} is_email_verify 是否验证邮箱
* @property {string} area_code 手机区号
* @property {string} safe_area_code 安全手机区号
* @property {string} real_name 真实姓名
* @property {string} identity_code 身份证号
* @property {string} create_time 创建时间
* @property {string} create_ip 创建 ip
* @property {string} change_pwd_time 修改密码时间
* @property {string} nickname 昵称
* @property {number} user_icon_id 用户头像 id
* @property {number} safe_level 安全等级
* @property {string} black_endtime 黑名单结束时间
* @property {string} black_note 黑名单备注
* @property {number} gender 性别
* @property {number} real_stat 实名状态
* @property {string} apple_name 苹果账号名称
* @property {string} sony_name 索尼账号名称
* @property {string} tap_name tap 账号名称
* @property {string} reactivate_ticket 重新激活 ticket
* @return getActionTicketBySTokenInfo
*/
interface getActionTicketBySTokenInfo {
is_realname: boolean;
mobile: string;
safe_mobile: string;
account_id: string;
account_name: string;
email: string;
is_email_verify: boolean;
area_code: string;
safe_area_code: string;
real_name: string;
identity_code: string;
create_time: string;
create_ip: string;
change_pwd_time: string;
nickname: string;
user_icon_id: number;
safe_level: number;
black_endtime: string;
black_note: string;
gender: number;
real_stat: number;
apple_name: string;
sony_name: string;
tap_name: string;
reactivate_ticket: string;
}
/**
* @description 游戏账号类型
* @interface GameAccount

View File

@@ -4,12 +4,6 @@
* @since Beta v0.3.7
*/
/**
* @description 导航相关类型定义
* @since Beta v0.3.7
* @namespace TGApp.BBS.Navigator
* @memberof TGApp.BBS
*/
declare namespace TGApp.BBS.Navigator {
/**
* @description 导航列表返回响应类型
@@ -160,19 +154,16 @@ declare namespace TGApp.BBS.Navigator {
* @property {number} data[].count.discuss - 热门话题讨论数
* @return HotTopic
*/
interface HotTopic {
type HotTopic = {
position: number;
data: Array<{
topic_id: number;
image: string;
topic_name: string;
post_name: string;
count: {
view: number;
discuss: number;
};
count: { view: number; discuss: number };
}>;
}
};
/**
* @description 游戏接待
@@ -214,7 +205,7 @@ declare namespace TGApp.BBS.Navigator {
* @property {unknown} data.user_status - 游戏接待用户状态
* @return GameReception
*/
interface GameReception {
type GameReception = {
position: number;
data: {
config: {
@@ -224,10 +215,7 @@ declare namespace TGApp.BBS.Navigator {
description: string;
icon: string;
status: string;
rules: {
game_level: number;
community_level: number;
};
rules: { game_level: number; community_level: number };
questionnaire: {
questionnaire_type: number;
questionnaire_url: string;
@@ -246,15 +234,8 @@ declare namespace TGApp.BBS.Navigator {
filename: string;
pkg_version_name: string;
};
detail_servlet: {
type: number;
normal_servlet: unknown;
customize_detail: unknown;
};
pre_register_count: {
show_count: boolean;
count: string;
};
detail_servlet: { type: number; normal_servlet: unknown; customize_detail: unknown };
pre_register_count: { show_count: boolean; count: string };
is_top: boolean;
last_update_time: string;
app_store_switch: number;
@@ -263,7 +244,7 @@ declare namespace TGApp.BBS.Navigator {
};
user_status: unknown;
};
}
};
/**
* @description 兑换码接口返回数据
@@ -273,11 +254,7 @@ declare namespace TGApp.BBS.Navigator {
* @property {CodeData[]} data.code_list - 兑换码数据
* @return CodeResponse
*/
interface CodeResponse extends TGApp.BBS.Response.BaseWithData {
data: {
code_list: CodeData[];
};
}
type CodeResponse = TGApp.BBS.Response.BaseWithData & { data: { code_list: Array<CodeData> } };
/**
* @description 兑换码数据
@@ -289,10 +266,5 @@ declare namespace TGApp.BBS.Navigator {
* @property {string} to_get_time - 过期时间,时间戳(单位:秒)
* @return CodeData
*/
interface CodeData {
title: string;
code: string;
img: string;
to_get_time: string;
}
type CodeData = { title: string; code: string; img: string; to_get_time: string };
}

View File

@@ -4,12 +4,6 @@
* @since Beta v0.6.0
*/
/**
* @description BBS 返回数据类型定义
* @since Beta v0.6.0
* @namespace TGApp.BBS.Response
* @memberof TGApp.BBS
*/
declare namespace TGApp.BBS.Response {
/**
* @description 基础返回类型,设计米游社接口请求都是这个类型
@@ -20,11 +14,7 @@ declare namespace TGApp.BBS.Response {
* @property {never} data - 响应数据
* @return Base
*/
interface Base {
retcode: number;
message: string;
data: never;
}
type Base = { retcode: number; message: string; data: never };
/**
* @description 基础返回类型-带有 data 的
@@ -35,121 +25,5 @@ declare namespace TGApp.BBS.Response {
* @property {any} data - 响应数据
* @return BaseWithData
*/
interface BaseWithData {
retcode: 0;
message: string;
data: any;
}
/**
* @description 根据 stoken 获取 ltoken 的响应数据
* @interface getLTokenBySToken
* @since Alpha v0.1.5
* @extends BaseWithData
* @property {string} data.ltoken - ltoken 值
* @return getLTokenBySToken
*/
interface getLTokenBySToken extends BaseWithData {
data: {
ltoken: string;
};
}
/**
* @description 根据 stoken 获取 cookie_token 的响应数据
* @interface getCookieTokenBySToken
* @since Alpha v0.1.5
* @extends BaseWithData
* @property {string} data.uid - 用户 uid
* @property {string} data.cookie_token - cookie_token 值
* @return getCookieTokenBySToken
*/
interface getCookieTokenBySToken extends BaseWithData {
data: {
uid: string;
cookie_token: string;
};
}
/**
* @description 通过 stoken 验证用户信息的返回类型
* @interface verifyUserInfoBySToken
* @since Alpha v0.1.5
* @extends BaseWithData
* @property {TGApp.BBS.Account.VerifySTokenInfo} data.user_info - 用户信息
* @property {unknown} data.realname_info - 实名信息
* @property {boolean} data.need_realperson - 是否需要实名认证
* @return verifyUserInfoBySToken
*/
interface verifyUserInfoBySToken extends BaseWithData {
data: {
user_info: TGApp.BBS.Account.VerifySTokenInfo;
realname_info: unknown;
need_realperson: boolean;
};
}
/**
* @description 通过 sToken 获取 actionTicket 的返回类型
* @interface getActionTicketBySToken
* @since Beta v0.3.4
* @extends BaseWithData
* @property {string} data.ticket - actionTicket 值
* @property {boolean} data.is_verified - 是否验证
* @property {TGApp.BBS.Account.getActionTicketBySTokenInfo} data.account_info - 用户信息
* @return getActionTicketBySToken
*/
interface getActionTicketBySToken extends BaseWithData {
data: {
ticket: string;
is_verified: boolean;
account_info: TGApp.BBS.Account.getActionTicketBySTokenInfo;
};
}
/**
* @description 获取 deviceFp 的返回类型
* @interface getDeviceFp
* @since Beta v0.3.6
* @extends BaseWithData
* @property {string} data.device_fp - deviceFp 值
* @property {number} data.code - code 值
* @property {string} data.msg - msg 值
* @return getDeviceFp
*/
interface getDeviceFp extends BaseWithData {
data: {
device_fp: string;
code: number;
msg: string;
};
}
/**
* @description 获取游戏账户数据
* @interface getGameAccounts
* @since Beta v0.6.0
* @extends BaseWithData
* @property {TGApp.BBS.Account.GameAccount[]} data.list - 返回数据
* @returns getGameAccounts
*/
interface getGameAccounts extends BaseWithData {
data: {
list: TGApp.BBS.Account.GameAccount[];
};
}
/**
* @description 获取登录 ticket
* @interface getAuthTicketByGameBiz
* @since Beta v0.6.0
* @extends BaseWithData
* @property {string} data.ticket
* @returns getAuthTicketByGameBiz
*/
interface getAuthTicketByGameBiz extends BaseWithData {
data: {
ticket: string;
};
}
type BaseWithData = { retcode: 0; message: string; data: unknown };
}