修改引用的类型

This commit is contained in:
nonameShijian 2024-05-17 21:29:14 +08:00
parent 0251ee2364
commit a4e4998afc
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import { ui } from "../../ui/index.js";
import { AsyncFunction } from "../../util/index.js"; import { AsyncFunction } from "../../util/index.js";
export class GameEvent { export class GameEvent {
/** @type { this & import('./gameEventPromise.js').GameEventPromise } */ /** @type { this & GameEventPromise } */
#promise; #promise;
/** /**
* @param {string | GameEvent} [name] * @param {string | GameEvent} [name]
@ -55,7 +55,7 @@ export class GameEvent {
**/ **/
this.async = false; this.async = false;
/** /**
* @type {null|(event: GameEvent)=>any} 这个异步事件对应Promise的resolve函数 * @type {null|((event: GameEvent | PromiseLike<GameEvent>)=>void)} 这个异步事件对应Promise的resolve函数
**/ **/
this.resolve = null; this.resolve = null;
if (trigger !== false && !game.online) this._triggered = 0; if (trigger !== false && !game.online) this._triggered = 0;

View File

@ -35,7 +35,7 @@ export class GameEventPromise extends Promise {
} }
#event; #event;
/** /**
* @param { import('./gameEvent.js').GameEvent } arg * @param { GameEvent } arg
*/ */
constructor(arg) { constructor(arg) {
if (arg instanceof GameEventPromise) throw new Error("GameEventPromise cannot copy."); if (arg instanceof GameEventPromise) throw new Error("GameEventPromise cannot copy.");