mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-25 05:29:45 +08:00
🎨 代码格式化
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarCollect.ts
|
||||
* @description 获取角色搭配数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarHoldRate.ts
|
||||
* @description Hutao API 获取角色持有率数据请求方法
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarUpRate.ts
|
||||
* @description 获取角色上场率数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarUseRate.ts
|
||||
* @description 获取角色使用率
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getOverview.ts
|
||||
* @description 获取深渊概览数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getTeamCollect.ts
|
||||
* @description 获取队伍搭配数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request uploadData.ts
|
||||
* @description Hutao 数据上传请求函数集合
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
/**
|
||||
* @file plugins Mys index.ts
|
||||
* @description Mys plugin index
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// Api
|
||||
import MysApi from "./api";
|
||||
// Post
|
||||
import getPostData from "./request/getPostData";
|
||||
import parsePost from "./utils/parsePost";
|
||||
// Gacha
|
||||
import getGachaData from "./request/getGachaData";
|
||||
import getGachaCard from "./utils/getGachaCard";
|
||||
// Position
|
||||
import getPositionData from "./request/getPositionData";
|
||||
import getPositionCard from "./utils/getPositionCard";
|
||||
// News
|
||||
import getNewsList from "./request/getNewsList";
|
||||
import { getNoticeCard, getActivityCard, getNewsCard } from "./utils/getNewsCard";
|
||||
// Lottery
|
||||
import getLotteryData from "./request/getLotteryData";
|
||||
import getLotteryCard from "./utils/getLotteryCard";
|
||||
// User
|
||||
import { getLoginQr, getLoginStatus } from "./request/doGameLogin";
|
||||
import getGachaData from "./request/getGachaData";
|
||||
import getLotteryData from "./request/getLotteryData";
|
||||
import getNewsList from "./request/getNewsList";
|
||||
import getPositionData from "./request/getPositionData";
|
||||
import getPostData from "./request/getPostData";
|
||||
import getGachaCard from "./utils/getGachaCard";
|
||||
import getLotteryCard from "./utils/getLotteryCard";
|
||||
import { getNoticeCard, getActivityCard, getNewsCard } from "./utils/getNewsCard";
|
||||
import getPositionCard from "./utils/getPositionCard";
|
||||
import parsePost from "./utils/parsePost";
|
||||
|
||||
const Mys = {
|
||||
Api: MysApi,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getGachaData.ts
|
||||
* @description Mys 抽卡请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys interface getLotteryData.ts
|
||||
* @description Mys 插件抽奖接口
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getNewsList.ts
|
||||
* @description Mys 插件咨讯请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getPositionData.ts
|
||||
* @description Mys 插件热点追踪请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getPostData.ts
|
||||
* @description Mys帖子请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
import { score } from "wcag-color";
|
||||
import * as colorConvert from "color-convert";
|
||||
import { score } from "wcag-color";
|
||||
|
||||
/**
|
||||
* @description 给定两个16进制颜色值,确认两者是否相近
|
||||
@@ -215,10 +215,10 @@ function LinkTextParser(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLSpa
|
||||
throw new Error(`[LinkTextParser] data.insert is not a string: ${JSON.stringify(data)}`);
|
||||
}
|
||||
if (data.attributes == null) {
|
||||
throw new Error(`[LinkTextParser] data.attributes is not defined`);
|
||||
throw new Error("[LinkTextParser] data.attributes is not defined");
|
||||
}
|
||||
if (!data.attributes.link) {
|
||||
throw new Error(`[LinkTextParser] data.attributes.link is not defined`);
|
||||
throw new Error("[LinkTextParser] data.attributes.link is not defined");
|
||||
}
|
||||
// 创建图标
|
||||
const icon = document.createElement("i");
|
||||
@@ -254,7 +254,7 @@ function parseDivider(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivEl
|
||||
throw new Error(`[ParseDivider] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (!data.insert.divider) {
|
||||
throw new Error(`[ParseDivider] data.insert.divider is not defined`);
|
||||
throw new Error("[ParseDivider] data.insert.divider is not defined");
|
||||
}
|
||||
// 创建分割线
|
||||
const div = document.createElement("div");
|
||||
@@ -291,7 +291,7 @@ function parseImage(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivElem
|
||||
throw new Error(`[ParseImage] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (!data.insert.image) {
|
||||
throw new Error(`[ParseImage] data.insert.image is not defined`);
|
||||
throw new Error("[ParseImage] data.insert.image is not defined");
|
||||
}
|
||||
const div = document.createElement("div");
|
||||
// 创建图片
|
||||
@@ -319,7 +319,7 @@ function parseVideo(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivElem
|
||||
throw new Error(`[ParseVideo] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (data.insert.vod == null && !data.insert.video) {
|
||||
throw new Error(`[ParseVideo] data.insert.vod and data.insert.video is not defined`);
|
||||
throw new Error("[ParseVideo] data.insert.vod and data.insert.video is not defined");
|
||||
}
|
||||
// 创建 div
|
||||
const div = document.createElement("div");
|
||||
@@ -383,7 +383,7 @@ function parseBackup(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivEle
|
||||
return LotteryParser(data);
|
||||
}
|
||||
if (data.insert.fold == null) {
|
||||
throw new Error(`[ParseBackup] data.insert.fold is not defined`);
|
||||
throw new Error("[ParseBackup] data.insert.fold is not defined");
|
||||
}
|
||||
// 转换
|
||||
const titleJson: TGApp.Plugins.Mys.Post.StructuredContent[] = JSON.parse(data.insert.fold.title);
|
||||
@@ -428,13 +428,13 @@ function LotteryParser(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivE
|
||||
throw new Error(`[LotteryParser] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (!data.insert.backup_text) {
|
||||
throw new Error(`[LotteryParser] data.insert.backup_text is not defined`);
|
||||
throw new Error("[LotteryParser] data.insert.backup_text is not defined");
|
||||
}
|
||||
if (data.insert.backup_text !== "[抽奖]") {
|
||||
throw new Error(`[LotteryParser] data.insert.backup_text is not [抽奖]`);
|
||||
throw new Error("[LotteryParser] data.insert.backup_text is not [抽奖]");
|
||||
}
|
||||
if (data.insert.lottery == null) {
|
||||
throw new Error(`[LotteryParser] data.insert.lottery is not defined`);
|
||||
throw new Error("[LotteryParser] data.insert.lottery is not defined");
|
||||
}
|
||||
// 创建 div
|
||||
const div = document.createElement("div");
|
||||
@@ -466,7 +466,7 @@ function parseLinkCard(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivE
|
||||
throw new Error(`[ParseLinkCard] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (data.insert.link_card == null) {
|
||||
throw new Error(`[ParseLinkCard] data.insert.link_card is not defined`);
|
||||
throw new Error("[ParseLinkCard] data.insert.link_card is not defined");
|
||||
}
|
||||
// 创建 div
|
||||
const div = document.createElement("div");
|
||||
@@ -529,7 +529,7 @@ function parseMention(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLAncho
|
||||
throw new Error(`[ParseMention] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (data.insert.mention == null) {
|
||||
throw new Error(`[ParseMention] data.insert.mention is not defined`);
|
||||
throw new Error("[ParseMention] data.insert.mention is not defined");
|
||||
}
|
||||
// 创建图标
|
||||
const icon = document.createElement("i");
|
||||
@@ -558,7 +558,7 @@ function emojiParser(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLImageE
|
||||
}
|
||||
const emojis = localStorage.getItem("emojis");
|
||||
if (!emojis) {
|
||||
throw new Error(`[EmojiParser] emojis is not defined`);
|
||||
throw new Error("[EmojiParser] emojis is not defined");
|
||||
}
|
||||
const emojiList: Record<string, string> = JSON.parse(emojis);
|
||||
const emojiName = data.insert.slice(2, -1);
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
import Database from "tauri-plugin-sql-api";
|
||||
|
||||
import { getUiafStatus } from "../../utils/UIAF";
|
||||
|
||||
import initDataSql from "./sql/initData";
|
||||
import initTableSql from "./sql/initTable";
|
||||
import {
|
||||
@@ -19,6 +17,7 @@ import {
|
||||
insertRoleData,
|
||||
} from "./sql/insertData";
|
||||
import { importUIAFData, importUIGFData } from "./sql/updateData";
|
||||
import { getUiafStatus } from "../../utils/UIAF";
|
||||
|
||||
class Sqlite {
|
||||
/**
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/**
|
||||
* @file plugins Sqlite sql initData.ts
|
||||
* @description Sqlite 初始化数据 sql 语句
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { app } from "@tauri-apps/api";
|
||||
// utils
|
||||
import { getBuildTime } from "../../../utils/TGBuild";
|
||||
|
||||
import {
|
||||
insertAchievementData,
|
||||
insertAchievementSeriesData,
|
||||
@@ -21,6 +18,7 @@ import {
|
||||
AppNameCardsData,
|
||||
AppCharacterData,
|
||||
} from "../../../data";
|
||||
import { getBuildTime } from "../../../utils/TGBuild";
|
||||
|
||||
/**
|
||||
* @description 初始化应用表数据
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
// utils
|
||||
import { timeToSecond } from "../utils/transTime";
|
||||
import { transCharacterData, transFloorData } from "../utils/transAbyssData";
|
||||
import { transUserRoles } from "../utils/transUserRoles";
|
||||
import { timeToSecond } from "../utils/transTime";
|
||||
import { transUserRecord } from "../utils/transUserRecord";
|
||||
import { transUserRoles } from "../utils/transUserRoles";
|
||||
|
||||
/**
|
||||
* @description 插入成就数据
|
||||
|
||||
Reference in New Issue
Block a user