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