From 28c7dba845a20def402e1c2f4e5b4056898364e3 Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Sun, 31 Dec 2023 23:39:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9history=E7=9A=84=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=90=8D=E7=A7=B0=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node_modules/noname-typings/type.d.ts | 6 ++++-- noname/game/index.js | 22 +++++++++++----------- noname/library/index.js | 2 -- noname/status/index.js | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/node_modules/noname-typings/type.d.ts b/node_modules/noname-typings/type.d.ts index d9ab34305..9bff12e78 100644 --- a/node_modules/noname-typings/type.d.ts +++ b/node_modules/noname-typings/type.d.ts @@ -34,6 +34,8 @@ declare type VCard = import('../../noname/library/index.js').VCard; declare type Video = import('../../noname/game/index.js').Video; declare type Videos = import('../../noname/game/index.js').Videos; -declare type History = import('../../noname/game/index.js').History; +declare type GameHistory = import('../../noname/game/index.js').GameHistory; +declare type CodeMirror = typeof import('../../game/codemirror.js').default; -declare type CodeMirror = typeof import('../../game/codemirror.js').default; \ No newline at end of file +declare type Sex = 'male' | 'female' | 'dobule' | 'none'; +declare type Character = [Sex, string, number | string, string[], ...any[]]; \ No newline at end of file diff --git a/noname/game/index.js b/noname/game/index.js index 08ac4de69..3eddfe0ce 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -5,7 +5,7 @@ * useCard: GameEventPromise[], * changeHp: GameEventPromise[], * everything: GameEventPromise[] - * }} History + * }} GameHistory * @typedef { { type: string, player?: string, content?: string | any[], delay: number } } Video * @typedef { { mode: string, name: string[], name1: string, name2?: string, time: number, video: Video, win: boolean } } Videos */ @@ -773,7 +773,7 @@ export class Game extends Uninstantable { return 'common'; } /** - * @template { keyof History } T + * @template { keyof GameHistory } T * @param { T } key * @param { (event: GameEventPromise) => boolean } filter * @param { GameEventPromise } [last] @@ -797,7 +797,7 @@ export class Game extends Uninstantable { } } /** - * @template { keyof History } T + * @template { keyof GameHistory } T * @param { T } key * @param { (event: GameEventPromise) => boolean } filter * @param { GameEventPromise } [last] @@ -822,15 +822,15 @@ export class Game extends Uninstantable { } /** * @overload - * @returns { History } + * @returns { GameHistory } */ /** - * @template { keyof History } T + * @template { keyof GameHistory } T * @overload * @param { T } key * @param { (event: GameEventPromise) => boolean } [filter] * @param { GameEventPromise } [last] - * @returns { History[T] } + * @returns { GameHistory[T] } */ static getGlobalHistory(key, filter, last) { if (!key) return _status.globalHistory[_status.globalHistory.length - 1]; @@ -848,7 +848,7 @@ export class Game extends Uninstantable { } } /** - * @template { keyof History } T + * @template { keyof GameHistory } T * @param { T } key * @param { (event: GameEventPromise) => boolean } filter * @param { GameEventPromise } [last] @@ -872,7 +872,7 @@ export class Game extends Uninstantable { }) } /** - * @template { keyof History } T + * @template { keyof GameHistory } T * @param { T } key * @param { (event: GameEventPromise) => boolean } filter * @param { GameEventPromise } [last] @@ -899,15 +899,15 @@ export class Game extends Uninstantable { } /** * @overload - * @returns { History[] } + * @returns { GameHistory[] } */ /** - * @template { keyof History } T + * @template { keyof GameHistory } T * @overload * @param { T } key * @param { (event: GameEventPromise) => boolean } [filter] * @param { GameEventPromise } [last] - * @returns { History[T] } + * @returns { GameHistory[T] } */ static getAllGlobalHistory(key, filter, last) { const history = []; diff --git a/noname/library/index.js b/noname/library/index.js index cdb6dbf20..ef0660e06 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -7,8 +7,6 @@ * @typedef { InstanceType } GameEvent * @typedef { InstanceType & InstanceType & typeof Promise } GameEventPromise * @typedef { InstanceType } NodeWS - * @typedef { 'male' | 'female' | 'dobule' | 'none' } Sex - * @typedef { [Sex, string, number | string, string[], any[]] } Character */ import { nonameInitialized, assetURL, userAgent, Uninstantable, GeneratorFunction, AsyncFunction } from "../util/index.js"; import { AI as ai } from '../ai/index.js'; diff --git a/noname/status/index.js b/noname/status/index.js index 2847d64d4..697d9aead 100644 --- a/noname/status/index.js +++ b/noname/status/index.js @@ -17,7 +17,7 @@ export const status = { dragline: [], dying: [], /** - * @type { History[] } + * @type { GameHistory[] } */ globalHistory: [{ // @ts-ignore