mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
✏️ 完善 showConfirm 类型
This commit is contained in:
52
src/types/Component/Confirm.d.ts
vendored
52
src/types/Component/Confirm.d.ts
vendored
@@ -1,25 +1,65 @@
|
||||
/**
|
||||
* @file types Component Confirm.d.ts
|
||||
* @description Component Confirm 类型声明文件
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
declare namespace TGApp.Component.Confirm {
|
||||
/**
|
||||
* @description Confirm 参数
|
||||
* @interface Params
|
||||
* @since Alpha v0.2.3
|
||||
* @interface ParamsBase
|
||||
* @since Beta v0.3.3
|
||||
* @property {string} title 标题
|
||||
* @property {string} text 文本
|
||||
* @property {string} mode 模式 // normal: 正常(默认),input: 输入框
|
||||
* @property {boolean} otcancel 点击外部取消 // true: 取消(默认),false: 不取消
|
||||
* @return Params
|
||||
* @return ParamsBase
|
||||
*/
|
||||
export interface Params {
|
||||
interface ParamsBase {
|
||||
title: string;
|
||||
text?: string;
|
||||
mode?: "confirm" | "input";
|
||||
otcancel?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Confirm 参数- confirm mode
|
||||
* @interface ParamsConfirm
|
||||
* @since Beta v0.3.3
|
||||
* @extends ParamsBase
|
||||
* @property {"confirm"|undefined} mode
|
||||
* @return ParamsConfirm
|
||||
*/
|
||||
interface ParamsConfirm extends ParamsBase {
|
||||
mode?: "confirm";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Confirm 参数 - input mode
|
||||
* @interface ParamsInput
|
||||
* @since Beta v0.3.3
|
||||
* @extends ParamsBase
|
||||
* @property {"input"} mode
|
||||
* @return ParamsInput
|
||||
*/
|
||||
interface ParamsInput extends ParamsBase {
|
||||
mode: "input";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Confirm 参数
|
||||
* @since Beta v0.3.3
|
||||
* @type Params
|
||||
* @return Params
|
||||
*/
|
||||
type Params = ParamsConfirm | ParamsInput;
|
||||
|
||||
/**
|
||||
* @description Confirm 方法 - displayBox
|
||||
* @since Beta v0.3.3
|
||||
* @function displayBox
|
||||
* @param {Params} props
|
||||
* @return string | boolean
|
||||
*/
|
||||
function displayBox(props: Params): boolean | string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user