✏️ 修正类型

This commit is contained in:
目棃
2024-11-11 13:41:02 +08:00
parent 272f3bc14a
commit d35b94f79f
10 changed files with 42 additions and 42 deletions

View File

@@ -49,7 +49,7 @@ onBeforeMount(async () => {
next.value = TSAvatarBirth.getNextAvatarBirth();
});
function toBirth(type: TGApp.Archive.Birth.RoleItem) {
function toBirth(type: TGApp.Archive.Birth.RoleItem | true): void {
let dateStr;
if (type === true) {
const date = new Date();

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Hutao/index.ts
* @description Hutao 插件入口
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
import {

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Hutao/request/abyssReq.ts
* @description 深渊相关请求
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
import TGHttp from "../../../utils/TGHttp.js";
@@ -9,7 +9,7 @@ const AbyssUrl = `https://homa.snapgenshin.com/Statistics/`;
/**
* @description 获取深渊概览数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {boolean} isLast 是否获取上期数据
* @return {Promise<TGApp.Plugins.Hutao.Abyss.OverviewData>}
*/
@@ -26,7 +26,7 @@ export async function getAbyssOverview(
/**
* @description 获取角色搭配数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {boolean} isLast 是否获取上期数据
* @return {Promise<TGApp.Plugins.Hutao.Abyss.AvatarCollocation[]>}
*/
@@ -43,7 +43,7 @@ export async function getAvatarCollect(
/**
* @description 获取角色持有率数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {boolean} isLast 是否获取上期数据
* @returns {Promise<TGApp.Plugins.Hutao.Abyss.AvatarHold[]>}
*/
@@ -60,7 +60,7 @@ export async function getAvatarHoldRate(
/**
* @description 获取角色上场率数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {boolean} isLast 是否获取上期数据
* @return {Promise<TGApp.Plugins.Hutao.Abyss.AvatarUp[]>}
*/
@@ -77,7 +77,7 @@ export async function getAvatarUpRate(
/**
* @description 获取角色使用率
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {boolean} isLast 是否获取上期数据
* @return {Promise<TGApp.Plugins.Hutao.Abyss.AvatarUse[]>}
*/
@@ -94,7 +94,7 @@ export async function getAvatarUseRate(
/**
* @description 获取队伍搭配数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {boolean} isLast 是否获取上期数据
* @return {Promise<TGApp.Plugins.Hutao.Abyss.TeamCombination[]>}
*/

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Hutao/request/combatReq.ts
* @description 幻想真境剧诗相关请求
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
import TGHttp from "../../../utils/TGHttp.js";
@@ -9,7 +9,7 @@ const CombatUrl = "https://homa.snapgenshin.com/RoleCombat/";
/**
* @description 获取数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {boolean} isLast
* @return {Promise<TGApp.Plugins.Hutao.Combat.Data>}
*/
@@ -26,7 +26,7 @@ export async function getCombatStatistic(
/**
* @description 上传数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {TGApp.Plugins.Hutao.Combat.UploadData} data
* @returns {Promise<TGApp.Plugins.Hutao.Combat.UploadResponse>}
*/

View File

@@ -1,13 +1,13 @@
/**
* @file plugins/Hutao/types/Combat.d.ts
* @description 幻想真境剧诗
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
declare namespace TGApp.Plugins.Hutao.Combat {
/**
* @description 上传返回
* @since Beta v0.6.2
* @since Beta v0.6.3
* @interface UploadResponse
* @extends TGApp.Plugins.Hutao.Base.Response
* @return UploadResponse
@@ -16,7 +16,7 @@ declare namespace TGApp.Plugins.Hutao.Combat {
/**
* @description 上传数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @interface UploadData
* @property {number} Version
* @property {string} Uid
@@ -35,7 +35,7 @@ declare namespace TGApp.Plugins.Hutao.Combat {
/**
* @description 数据获取返回
* @since Beta v0.6.2
* @since Beta v0.6.3
* @interface Response
* @extends TGApp.Plugins.Hutao.Base.Response
* @property {Data} data
@@ -47,7 +47,7 @@ declare namespace TGApp.Plugins.Hutao.Combat {
/**
* @description 数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @interface Data
* @property {number} RecordTotal 总数
* @property {Array<TGApp.Plugins.Hutao.Base.Rate>} BackupAvatarRates 使用率

View File

@@ -6,7 +6,7 @@
/**
* @description 将本地数据转为上传用的数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {TGApp.Sqlite.Abyss.SingleTable} data 本地数据
* @returns {TGApp.Plugins.Hutao.Abyss.RecordUpload} 上传用的数据
*/

View File

@@ -1,12 +1,12 @@
/**
* @file plugins/Hutao/utils/combatUtil.ts
* @description 将本地数据转为上传用的数据
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
/**
* @description 将本地数据转为上传用的数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {number[]} avatars 角色
* @param {number} schedule 期数
* @param {number} uid UID

View File

@@ -1,12 +1,12 @@
/**
* @file types/Game/Combat.d.ts
* @description 幻想真境剧诗类型定义
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
/**
* @description 幻想真境剧诗相关类型
* @since Beta v0.6.2
* @since Beta v0.6.3
* @namespace TGApp.Game.Combat
* @memberOf TGApp.Game
*/
@@ -14,7 +14,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 幻想真境剧诗数据返回类型
* @interface Response
* @since Beta v0.6.2
* @since Beta v0.6.3
* @extends TGApp.BBS.Response.BaseWithData
* @property {FullData} data
* @return Response
@@ -26,7 +26,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 返回完整数据类型
* @interface FullData
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {boolean} is_unlock 是否解锁
* @property {Record<string,string>} links 相关链接
* @property {Array<Combat>} data 挑战数据
@@ -41,7 +41,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 角色数据
* @interface Avatar
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {number} avatar_id 角色id
* @property {number} avatar_type 角色武器类型 // todo
* @property {string} name 角色名称
@@ -64,7 +64,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 简要角色
* @interface AvatarMini
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {number} avatar_id 角色id
* @property {number} avatar_icon 角色图标
* @property {string} value 值
@@ -81,7 +81,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description Buff
* @interface Buff
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {string} name 名称
* @property {string} icon 图标
* @property {number} level 等级
@@ -98,7 +98,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description Buff助益
* @interface BuffEffect
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {string} icon 图标
* @property {string} name 名称
* @property {string} desc 描述
@@ -113,7 +113,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 卡片
* @interface Card
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {string} icon 图标
* @property {string} name 名称
* @property {string} desc 描述 // todo 带 <color>
@@ -132,7 +132,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 时间
* @interface DateTime
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {number} year 年份
* @property {number} month 月份
* @property {number} day 日期
@@ -153,7 +153,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 状态
* @interface Stat
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {number} difficulty_id 难度等级
* @property {number} max_round_id 最多层数
* @property {number} heraldry 纹章数
@@ -178,7 +178,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 敌人
* @interface Enemy
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {string} name 名称
* @property {string} icon 图标
* @property {number} level 等级
@@ -193,7 +193,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 单期挑战数据
* @interface Combat
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {Detail} detail 挑战详情
* @property {Stat} stat 挑战状态
* @property {Schedule} schedule 挑战期数
@@ -212,7 +212,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 挑战详情
* @interface Detail
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {Array<RoundData>} rounds_data 轮次数据
* @property {Stat} detail_stat 详细状态
* @property {string} lineup_link 未知链接
@@ -230,7 +230,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 轮次数据
* @since Beta v0.6.2
* @since Beta v0.6.3
* @interface RoundData
* @property {Array<Avatar>} avatars 角色
* @property {Array<Card>} choice_cards 选中卡片
@@ -258,7 +258,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 总体buff
* @interface SplendourBuff
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {object} summary 概况
* @property {number} summary.total_level 总等级
* @property {string} summary.desc 描述
@@ -276,7 +276,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 战斗数据
* @interface FightStatisic
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {AvatarMini} max_defeat_avatar 击败最多敌人
* @property {AvatarMini} max_damage_avatar 最高伤害输出
* @property {AvatarMini} max_take_damage_avatar 最高承受伤害
@@ -299,7 +299,7 @@ declare namespace TGApp.Game.Combat {
/**
* @description 期数
* @interface Schedule
* @since Beta v0.6.2
* @since Beta v0.6.3
* @property {string} start_time 开始时间(秒级时间戳)
* @property {string} end_time 结束时间(秒级时间戳)
* @property {number} schedule_type 类型 // 1-本期。2-上期

View File

@@ -1,7 +1,7 @@
/**
* @file web/request/getRoleCombat.ts
* @description 真境剧诗
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
import TGHttp from "../../utils/TGHttp.js";
@@ -10,7 +10,7 @@ import TGUtils from "../utils/TGUtils.js";
/**
* @description 获取剧诗信息
* @since Beta v.0.6.2
* @since Beta v.0.6.3
* @param {TGApp.App.Account.Cookie} cookie
* @param {TGApp.Sqlite.Account.Game} account
* @returns {Promise<TGApp.Game.Combat.Combat[]|TGApp.BBS.Response.Base|false>}

View File

@@ -1,7 +1,7 @@
/**
* @file web/utils/tools.ts
* @description 应用用到的工具函数
* @since Beta v0.6.2
* @since Beta v0.6.3
*/
import TGConstant from "../constant/TGConstant.js";
@@ -42,7 +42,7 @@ export function transCookie(cookie: Record<string, string>): string {
/**
* @description ds 算法需要数据转换后的字符串是按照字典序排序的
* @since Beta v0.6.2
* @since Beta v0.6.3
* @param {Record<string, string|number>} obj object
* @returns {string} query string
*/