🎨 规范化代码

This commit is contained in:
BTMuli
2025-12-24 02:46:28 +08:00
parent 8500668213
commit 651a89145f
199 changed files with 5067 additions and 5390 deletions

View File

@@ -1,6 +1,5 @@
/**
* @file component/func/dialog.ts
* @description dialog 组件封装,函数式调用
* dialog 组件封装,函数式调用
* @since Beta v0.6.3
*/
@@ -27,18 +26,15 @@ export type DialogInputParams = {
};
/**
* @description 自定义 confirm 组件
* 自定义 confirm 组件
* @since Beta v0.6.3
* @extends ComponentInternalInstance
* @property {Function} exposeProxy.displayBox 显示 confirm
* @return DialogInstance
*/
interface DialogInstance extends ComponentInternalInstance {
type DialogInstance = {
exposeProxy: {
displayCheckBox: (props: DialogCheckParams) => Promise<boolean | undefined>;
displayInputBox: (props: DialogInputParams) => Promise<string | false | undefined>;
};
}
} & ComponentInternalInstance;
function renderBox(props: DialogParams): VNode {
const container = document.createElement("div");

View File

@@ -13,18 +13,15 @@ const geetestId = "tg-func-geetest";
/**
* 自定义 geetest 组件
* @since Beta v0.8.7
* @extends ComponentInternalInstance
* @property {Function} exposeProxy.displayBox 弹出 geetest 验证
* @return GeetestInstance
*/
interface GeetestInstance extends ComponentInternalInstance {
type GeetestInstance = {
exposeProxy: {
displayBox: (
props: TGApp.BBS.Geetest.CreateRes,
raw?: TGApp.BBS.CaptchaLogin.CaptchaAigis,
) => Promise<TGApp.BBS.Geetest.GeetestVerifyRes | false>;
};
}
} & ComponentInternalInstance;
function renderBox(props: TGApp.BBS.Geetest.CreateRes): VNode {
const container = document.createElement("div");
@@ -40,9 +37,9 @@ let geetestInstance: VNode;
/**
* 弹出 geetest 验证
* @since Beta v0.8.7
* @param {TGApp.BBS.Geetest.CreateRes} props geetest 验证的参数
* @param {TGApp.BBS.CaptchaLogin.CaptchaAigis} raw 原始数据,一般用于 Gt4 验证
* @return {Promise<TGApp.BBS.Geetest.GeetestVerifyRes|false>} 验证成功返回验证数据
* @param props - geetest 验证的参数
* @param raw - 原始数据,一般用于 Gt4 验证
* @returns 验证数据
*/
async function showGeetest(
props: TGApp.BBS.Geetest.CreateRes,

View File

@@ -1,6 +1,5 @@
/**
* @file component/func/loading.ts
* @description loading 组件封装,函数式调用
* loading 组件封装,函数式调用
* @since Beta v0.6.7
*/
@@ -17,9 +16,9 @@ type LoadingUpdateParams = Omit<LoadingParams, "show" | "subtitle"> & { timeout?
const TIMEOUT: Readonly<number> = 150;
/**
* @description 自定义 loading 组件
* 自定义 loading 组件
* @since Beta v0.6.7
* @return LoadingInstance
* @returns LoadingInstance
*/
type LoadingInstance = ComponentInternalInstance & {
exposeProxy: { displayBox: (props: LoadingParams) => Promise<void> };

View File

@@ -1,6 +1,5 @@
/**
* @file component/func/snackbar.ts
* @description snackbar 组件封装,函数式调用
* snackbar 组件封装,函数式调用
* @since Beta v0.6.3
*/
@@ -14,15 +13,14 @@ const snackbarId = "tg-func-snackbar";
export type SnackbarParams = { text: string; color: string; timeout: number };
/**
* @description 自定义 snackbar 组件
* 自定义 snackbar 组件
* @since Beta v0.6.3
* @return SnackbarInstance
*/
interface SnackbarInstance extends ComponentInternalInstance {
type SnackbarInstance = {
exposeProxy: {
displayBox: (props: SnackbarParams) => void;
};
}
} & ComponentInternalInstance;
function renderBox(props: SnackbarParams): VNode {
const container = document.createElement("div");