补全typings

This commit is contained in:
nonameShijian 2024-05-21 10:12:50 +08:00
parent d984641e22
commit d09b270b7f
4 changed files with 16 additions and 2 deletions

View File

@ -39,7 +39,7 @@ export class GameEvent {
**/
resolve: null | ((event: GameEvent | PromiseLike<GameEvent>) => void);
/**
* @type {null|((value: any) => void)} event.content的resolve形式
* @type {null|((value?: any) => void)} event.content的resolve形式
**/
resolveContent: null | ((value?: any) => void);
_triggered: number;
@ -160,6 +160,10 @@ export class GameEvent {
* @type { Function | undefined }
*/
ai: Function | undefined;
/**
* @type { string }
*/
triggername: string;
/**
* @param {keyof this} key
* @param {number} [value]

View File

@ -826,7 +826,7 @@ export class Player extends HTMLDivElement {
* @returns { Card[] }
*/
getCards(arg1?: string, arg2?: string | Record<string, any> | ((card: Card) => boolean)): Card[];
iterableGetDiscardableCards(player: any, arg1: any, arg2: any): Generator<any, void, unknown>;
iterableGetDiscardableCards(player: Player, arg1?: string, arg2?: string): Generator<Card, void, unknown>;
getDiscardableCards(player: any, arg1: any, arg2: any): any[];
/**
* @param {Parameters<lib['filter']['canBeGained']>[1]} player

View File

@ -192,6 +192,10 @@ export class GameEvent {
* @type { Function | undefined }
*/
ai;
/**
* @type { string }
*/
triggername;
/**
* @param {keyof this} key
* @param {number} [value]

View File

@ -3646,6 +3646,12 @@ export class Player extends HTMLDivElement {
getCards(arg1, arg2) {
return Array.from(this.iterableGetCards(arg1, arg2));
}
/**
* @param { Player } player
* @param { string } [arg1]
* @param { string } [arg2]
* @returns { Generator<Card, void, unknown> }
*/
*iterableGetDiscardableCards(player, arg1, arg2) {
for (let card of this.iterableGetCards(arg1, arg2)) {
if (lib.filter.canBeDiscarded(card, player, this)) {