修正game.promises.prompt的类型提示

This commit is contained in:
shijian 2023-12-15 09:25:47 +08:00
parent 44e935a5ff
commit 8c8f8950f8
1 changed files with 5 additions and 4 deletions

View File

@ -36218,8 +36218,9 @@ new Promise(resolve=>{
* : 由于参数列表是随意的在这里我准备限制一下这个函数的参数顺序 * : 由于参数列表是随意的在这里我准备限制一下这个函数的参数顺序
* *
* @type {{ * @type {{
* (title: string, forced?: boolean): Promise<string>; * (title: string): Promise<string | false>;
* (alertOption: 'alert', title: string, forced?: boolean): Promise<string>; * (title: string, forced: true): Promise<string>;
* (alertOption: 'alert', title: string): Promise<true>;
* }} * }}
* *
* @param { string } title 设置prompt标题与input内容 * @param { string } title 设置prompt标题与input内容
@ -36241,7 +36242,7 @@ new Promise(resolve=>{
title=alertOption; title=alertOption;
game.prompt(title,forced,resolve); game.prompt(title,forced,resolve);
}else{ }else{
game.prompt(alertOption,title,forced,resolve); game.prompt(title,alertOption,resolve);
} }
}); });
}, },
@ -36257,7 +36258,7 @@ new Promise(resolve=>{
*/ */
alert(title){ alert(title){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
game.prompt('alert',title,resolve); game.prompt(title,'alert',resolve);
}); });
}, },
// 读写函数promises化(不用考虑其对应函数是否存在) // 读写函数promises化(不用考虑其对应函数是否存在)