🌈 style(eslint): 第一次过 eslint

姑且先把能过的 ts 文件给过了,明天再过其余的 ts 文件跟 vue

Signed-off-by: BTMuli <BT-Muli@outlook.com>
(cherry picked from commit b7392bddea895b8b8cc1cad5ba0403d2dc738643)
This commit is contained in:
BTMuli
2023-04-06 02:23:02 +08:00
parent 3b28f57278
commit 6ec12bf664
52 changed files with 2103 additions and 2100 deletions

View File

@@ -19,19 +19,19 @@
* @property {string} completed_time - 成就完成时间
* @property {number} progress - 成就进度
* @property {string} version - 成就版本
* @return Achievement
* @returns {Achievement}
*/
export interface Achievement {
id: number;
series: number;
order: number;
name: string;
description: string;
reward: number;
completed: boolean;
completed_time: string | null;
progress: number;
version: string;
id: number
series: number
order: number
name: string
description: string
reward: number
completed: boolean
completed_time: string | null
progress: number
version: string
}
/**
@@ -49,16 +49,16 @@ export interface Achievement {
* @property {string} card - 成就系列奖励,这边是名片名称
* @description 像是天地万象这种一直更新的成就系列,这边的 version 可能为 undefined
* @property {string} icon - 成就系列图标
* @return AchievementSeries
* @returns {AchievementSeries}
*/
export interface AchievementSeries {
id: number;
order: number;
name: string;
version: string;
achievements: number[];
total_count: number;
completed_count: number;
card?: string;
icon: string;
id: number
order: number
name: string
version: string
achievements: number[]
total_count: number
completed_count: number
card?: string
icon: string
}

View File

@@ -2,18 +2,31 @@
* @file interface Base
* @description interface Base
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha
* @since Alpha v0.1.2
*/
/**
* @description 定义一个 Map<T> 接口
* @since Alpha
* @since Alpha v0.1.2
* @description 该接口的方法实现在 TGMap<T> 中
* @see TGMap
* @interface Map
* @template T
* @return Map
* @returns {Map<T>}
*/
export interface Map<T> {
[key: number]: T;
export type Map<T> = Record<number, T>;
/**
* @description 定义 IndexedDB 数据库配置
* @since Alpha v0.1.2
* @interface DBConfig
* @property {string} storeName 数据库名称
* @property {string} keyPath 数据库主键
* @property {string[]} indexes 数据库索引
* @returns {DBConfig}
*/
export interface DBConfig {
storeName: string
keyPath: string
indexes: string[]
}

View File

@@ -13,12 +13,12 @@
* @property {string} characterCard 角色卡
* @property {string} actionCard 行动卡
* @property {string} monsterCard 魔物卡
* @return BaseCardType
* @returns {BaseCardType}
*/
export enum BaseCardType {
characterCard = "角色牌",
actionCard = "行动牌",
monsterCard = "魔物牌",
characterCard = "角色牌",
actionCard = "行动牌",
monsterCard = "魔物牌",
}
/**
@@ -38,16 +38,16 @@ export enum BaseCardType {
* @property {unknown} info 卡牌信息
* @property {unknown} skills 卡牌技能,仅角色卡与魔物卡有
* @property {unknown} affect 卡牌效果,仅行动卡有
* @return BaseCard
* @returns {BaseCard}
*/
export interface BaseCard {
name: string;
id: number;
type: BaseCardType;
icon: { normal: string; special?: string };
info: unknown;
skills?: unknown;
affect?: unknown;
name: string
id: number
type: BaseCardType
icon: { normal: string, special?: string }
info: unknown
skills?: unknown
affect?: unknown
}
/**
@@ -70,28 +70,28 @@ export interface BaseCard {
* @property {string} skills[].cost.value 花费值
* @description 当技能类型为 “召唤物” 时,会有以下属性
* @property {number} skills[].count 可用次数
* @return CharacterCard
* @returns {CharacterCard}
*/
export interface CharacterCard extends BaseCard {
type: BaseCardType.characterCard;
info: {
element: EnumElement;
weapon: EnumWeapon;
camp: EnumCamp;
source: string;
title: string;
description: string;
};
skills: {
name: string;
type: string;
description: string;
cost: {
type: string;
value: string;
};
count?: number;
}[];
type: BaseCardType.characterCard
info: {
element: EnumElement
weapon: EnumWeapon
camp: EnumCamp
source: string
title: string
description: string
}
skills: Array<{
name: string
type: string
description: string
cost: {
type: string
value: string
}
count?: number
}>
}
/**
@@ -109,20 +109,20 @@ export interface CharacterCard extends BaseCard {
* @description 当类型为“天赋”时,可能会有以下属性
* @property {string} info.charge 充能
* @property {string} affect 卡牌效果
* @return ActionCard
* @returns {ActionCard}
*/
export interface ActionCard extends BaseCard {
type: BaseCardType.actionCard;
info: {
actionType: EnumActionType;
actionTag: EnumActionTag;
actionCost: EnumActionCost;
source: string;
title: string;
description: string;
charge?: string;
};
affect: string;
type: BaseCardType.actionCard
info: {
actionType: EnumActionType
actionTag: EnumActionTag
actionCost: EnumActionCost
source: string
title: string
description: string
charge?: string
}
affect: string
}
/**
@@ -144,25 +144,25 @@ export interface ActionCard extends BaseCard {
* @property {string} skills[].cost.type 花费类型
* @property {string} skills[].cost.value 花费值
* @description 当技能类型为 “召唤物” 时,会有以下属性
* @return MonsterCard
* @returns {MonsterCard}
*/
export interface MonsterCard extends BaseCard {
type: BaseCardType.monsterCard;
info: {
element: EnumElement;
weapon: EnumWeapon;
camp: EnumCamp;
source: string;
};
skills: {
name: string;
type: string;
description: string;
cost: {
type: string;
value: string;
};
}[];
type: BaseCardType.monsterCard
info: {
element: EnumElement
weapon: EnumWeapon
camp: EnumCamp
source: string
}
skills: Array<{
name: string
type: string
description: string
cost: {
type: string
value: string
}
}>
}
/**
@@ -173,12 +173,12 @@ export interface MonsterCard extends BaseCard {
* @property {EnumElement} element 元素
* @property {EnumWeapon} weapon 武器
* @property {EnumCamp} camp 阵营
* @return CharacterCardType
* @returns {CharacterCardType}
*/
export interface CharacterCardType {
element: EnumElement;
weapon: EnumWeapon;
camp: EnumCamp;
element: EnumElement
weapon: EnumWeapon
camp: EnumCamp
}
/**
@@ -189,12 +189,12 @@ export interface CharacterCardType {
* @property {EnumActionType} actionType 类型
* @property {EnumActionTag} actionTag 标签
* @property {EnumActionCost} actionCost 花费
* @return ActionCardType
* @returns {ActionCardType}
*/
export interface ActionCardType {
actionType: EnumActionType;
actionTag: EnumActionTag;
actionCost: EnumActionCost;
actionType: EnumActionType
actionTag: EnumActionTag
actionCost: EnumActionCost
}
/**
@@ -209,16 +209,16 @@ export interface ActionCardType {
* @property {string} anemo 风元素
* @property {string} geo 岩元素
* @property {string} dendro 草元素
* @return EnumElement
* @returns {EnumElement}
*/
export enum EnumElement {
pyro = "火元素",
hydro = "水元素",
cryo = "冰元素",
electro = "雷元素",
anemo = "风元素",
geo = "岩元素",
dendro = "草元素",
pyro = "火元素",
hydro = "水元素",
cryo = "冰元素",
electro = "雷元素",
anemo = "风元素",
geo = "岩元素",
dendro = "草元素",
}
/**
@@ -232,20 +232,20 @@ export enum EnumElement {
* @property {string} bow 弓
* @property {string} catalyst 法器
* @property {string} other 其他武器
* @return EnumWeapon
* @returns {EnumWeapon}
*/
export enum EnumWeapon {
sword = "单手剑",
claymore = "双手剑",
pole = "长柄武器",
bow = "弓",
catalyst = "法器",
other = "其他武器",
sword = "单手剑",
claymore = "双手剑",
pole = "长柄武器",
bow = "弓",
catalyst = "法器",
other = "其他武器",
}
/**
* @description 角色牌阵营
* @enum EnumCamp
* @enum {EnumCamp}
* @since Alpha
* @see CharacterCardType
* @property {string} mondstadt 蒙德
@@ -254,15 +254,15 @@ export enum EnumWeapon {
* @property {string} sumeru 须弥
* @property {string} fatui 愚人众
* @property {string} monster 魔物
* @return EnumCamp
* @returns {EnumCamp}
*/
export enum EnumCamp {
mondstadt = "蒙德",
liyue = "璃月",
inazuma = "稻妻",
sumeru = "须弥",
fatui = "愚人众",
monster = "魔物",
mondstadt = "蒙德",
liyue = "璃月",
inazuma = "稻妻",
sumeru = "须弥",
fatui = "愚人众",
monster = "魔物",
}
/**
@@ -273,12 +273,12 @@ export enum EnumCamp {
* @property {string} equipment 装备牌
* @property {string} event 事件牌
* @property {string} support 支援牌
* @return EnumActionType
* @returns {EnumActionType}
*/
export enum EnumActionType {
equipment = "装备牌",
event = "事件牌",
support = "支援牌",
equipment = "装备牌",
event = "事件牌",
support = "支援牌",
}
/**
@@ -295,18 +295,18 @@ export enum EnumActionType {
* @property {string} filed 场地
* @property {string} elementResonance 元素共鸣
* @property {string} other 其他标签
* @return EnumActionTag
* @returns {EnumActionTag}
*/
export enum EnumActionTag {
weapon = "武器",
artifact = "圣遗物",
talent = "天赋",
food = "料理",
item = "道具",
partner = "伙伴",
filed = "场地",
elementResonance = "元素共鸣",
other = "其他标签",
weapon = "武器",
artifact = "圣遗物",
talent = "天赋",
food = "料理",
item = "道具",
partner = "伙伴",
filed = "场地",
elementResonance = "元素共鸣",
other = "其他标签",
}
/**
@@ -322,15 +322,15 @@ export enum EnumActionTag {
* @property {string} cost5 花费5
* @property {string} cost6 花费6
* @property {string} other 其他花费
* @return EnumActionCost
* @returns {EnumActionCost}
*/
export enum EnumActionCost {
cost0 = "花费0",
cost1 = "花费1",
cost2 = "花费2",
cost3 = "花费3",
cost4 = "花费4",
cost5 = "花费5",
cost6 = "花费6",
other = "其他花费",
cost0 = "花费0",
cost1 = "花费1",
cost2 = "花费2",
cost3 = "花费3",
cost4 = "花费4",
cost5 = "花费5",
cost6 = "花费6",
other = "其他花费",
}

View File

@@ -16,14 +16,14 @@
* @property {string} profile - 名片 Profile 图路径
* @property {number} type - 名片类型 (0: 其他1: 成就2角色3纪行4活动)
* @property {string} source - 名片来源
* @return NameCard
* @returns {NameCard}
*/
export interface NameCard {
name: string;
description: string;
icon: string;
bg: string;
profile: string;
type: string;
source: string;
name: string
description: string
icon: string
bg: string
profile: string
type: string
source: string
}