From 6bb7e4470454b8599bc221681b40c5c107c84f5e Mon Sep 17 00:00:00 2001 From: nonameShijian <2954700422@qq.com> Date: Sun, 14 Apr 2024 01:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A9=E5=B1=95=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=89=A9=E5=B1=95=E6=A8=A1=E6=9D=BF=E4=B8=BAesm?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0cost=E5=92=8CgetIndex=E7=9A=84?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=B3=A8=E9=87=8A=EF=BC=8C=E8=B7=9F=E8=BF=9B?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E5=A4=8D=E5=85=B6=E4=BB=96=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nonameModules/noname/game/index.d.ts | 92 +++++++++++-------- .../noname/library/element/player.d.ts | 1 + .../nonameModules/noname/library/index.d.ts | 5 +- .../nonameModules/noname/status/index.d.ts | 18 ++++ node_modules/@types/noname-typings/type.d.ts | 75 ++++++++++++++- 5 files changed, 151 insertions(+), 40 deletions(-) diff --git a/node_modules/@types/noname-typings/nonameModules/noname/game/index.d.ts b/node_modules/@types/noname-typings/nonameModules/noname/game/index.d.ts index 1b1d03e9b..afbfdddbd 100644 --- a/node_modules/@types/noname-typings/nonameModules/noname/game/index.d.ts +++ b/node_modules/@types/noname-typings/nonameModules/noname/game/index.d.ts @@ -517,72 +517,86 @@ export class Game { * @overload * @param { 'character' } type * @param {( - * lib: Library, - * game: typeof Game, - * ui: UI, - * get: Get, - * ai: AI, - * _status: Status + * lib: InstanceType, + * game: InstanceType, + * ui: InstanceType, + * get: InstanceType, + * ai: InstanceType, + * _status: InstanceType * ) => importCharacterConfig } content * @param {*} [url] */ - import(type: 'character', content: (lib: any, game: typeof Game, ui: any, get: any, ai: any, _status: any) => importCharacterConfig, url?: any): any; + import(type: 'character', content: (lib: InstanceType, game: InstanceType, ui: InstanceType, get: InstanceType, ai: InstanceType, _status: InstanceType) => importCharacterConfig, url?: any): any; /** * @overload * @param { 'card' } type * @param {( - * lib: Library, - * game: typeof Game, - * ui: UI, - * get: Get, - * ai: AI, - * _status: Status + * lib: InstanceType, + * game: InstanceType, + * ui: InstanceType, + * get: InstanceType, + * ai: InstanceType, + * _status: InstanceType * ) => importCardConfig } content * @param {*} [url] */ - import(type: 'card', content: (lib: any, game: typeof Game, ui: any, get: any, ai: any, _status: any) => importCardConfig, url?: any): any; + import(type: 'card', content: (lib: InstanceType, game: InstanceType, ui: InstanceType, get: InstanceType, ai: InstanceType, _status: InstanceType) => importCardConfig, url?: any): any; /** * @overload * @param { 'mode' } type * @param {( - * lib: Library, - * game: typeof Game, - * ui: UI, - * get: Get, - * ai: AI, - * _status: Status + * lib: InstanceType, + * game: InstanceType, + * ui: InstanceType, + * get: InstanceType, + * ai: InstanceType, + * _status: InstanceType * ) => importModeConfig } content * @param {*} [url] */ - import(type: 'mode', content: (lib: any, game: typeof Game, ui: any, get: any, ai: any, _status: any) => importModeConfig, url?: any): any; + import(type: 'mode', content: (lib: InstanceType, game: InstanceType, ui: InstanceType, get: InstanceType, ai: InstanceType, _status: InstanceType) => importModeConfig, url?: any): any; /** * @overload * @param { 'player' } type * @param {( - * lib: Library, - * game: typeof Game, - * ui: UI, - * get: Get, - * ai: AI, - * _status: Status + * lib: InstanceType, + * game: InstanceType, + * ui: InstanceType, + * get: InstanceType, + * ai: InstanceType, + * _status: InstanceType * ) => importPlayerConfig } content * @param {*} [url] */ - import(type: 'player', content: (lib: any, game: typeof Game, ui: any, get: any, ai: any, _status: any) => importPlayerConfig, url?: any): any; + import(type: 'player', content: (lib: InstanceType, game: InstanceType, ui: InstanceType, get: InstanceType, ai: InstanceType, _status: InstanceType) => importPlayerConfig, url?: any): any; /** * @overload * @param { 'extension' } type * @param {( - * lib: Library, - * game: typeof Game, - * ui: UI, - * get: Get, - * ai: AI, - * _status: Status + * lib: InstanceType, + * game: InstanceType, + * ui: InstanceType, + * get: InstanceType, + * ai: InstanceType, + * _status: InstanceType * ) => importExtensionConfig } content * @param {*} [url] */ - import(type: 'extension', content: (lib: any, game: typeof Game, ui: any, get: any, ai: any, _status: any) => importExtensionConfig, url?: any): any; + import(type: 'extension', content: (lib: InstanceType, game: InstanceType, ui: InstanceType, get: InstanceType, ai: InstanceType, _status: InstanceType) => importExtensionConfig, url?: any): any; + /** + * @overload + * @param { 'play' } type + * @param {( + * lib: InstanceType, + * game: InstanceType, + * ui: InstanceType, + * get: InstanceType, + * ai: InstanceType, + * _status: InstanceType + * ) => importPlayConfig } content + * @param {*} [url] + */ + import(type: 'play', content: (lib: InstanceType, game: InstanceType, ui: InstanceType, get: InstanceType, ai: InstanceType, _status: InstanceType) => importPlayConfig, url?: any): any; loadExtension(object: any): Promise; /** * 下载文件 @@ -611,9 +625,9 @@ export class Game { removeFile: ((filename: string, callback?: ((e: Error) => void) | undefined) => void) | undefined; /** * 获取文件列表 - * @type { undefined | ((dir: string, success: (folders: string[], files: string[]) => any, failure: (e: Error) => void) => void) } + * @type { undefined | ((dir: string, success: (folders: string[], files: string[]) => any, failure?: (e: Error) => void) => void) } */ - getFileList: ((dir: string, success: (folders: string[], files: string[]) => any, failure: (e: Error) => void) => void) | undefined; + getFileList: ((dir: string, success: (folders: string[], files: string[]) => any, failure?: ((e: Error) => void) | undefined) => void) | undefined; /** * 按路径依次创建文件夹 * @type { undefined | ((list: string | string[], callback: Function, file?: boolean) => void) } @@ -959,8 +973,9 @@ export class Game { addGlobalSkill(skill: string, player?: any): boolean; /** * @param { string } skill + * @param { lib.element.Player } player */ - removeGlobalSkill(skill: string): void; + removeGlobalSkill(skill: string, player: lib.element.Player): void; resetSkills(): void; /** * @param { string } extensionName @@ -1371,6 +1386,7 @@ export type GameHistory = { everything: GameEventPromise[]; }; export type Video = { + name?: string; type: string; player?: string; content?: string | any[]; diff --git a/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts b/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts index 3564435b7..b9affabf7 100644 --- a/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts +++ b/node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts @@ -896,6 +896,7 @@ export class Player extends HTMLDivElement { lose(...args: any[]): any; damage(...args: any[]): any; recover(...args: any[]): any; + recoverTo(...args: any[]): any; doubleDraw(): any; loseHp(num: any): any; loseMaxHp(...args: any[]): any; diff --git a/node_modules/@types/noname-typings/nonameModules/noname/library/index.d.ts b/node_modules/@types/noname-typings/nonameModules/noname/library/index.d.ts index c78f21927..cbc4032ed 100644 --- a/node_modules/@types/noname-typings/nonameModules/noname/library/index.d.ts +++ b/node_modules/@types/noname-typings/nonameModules/noname/library/index.d.ts @@ -4043,7 +4043,10 @@ export class Library { readonly nodews: Element.NodeWS; }; card: { - list: never[]; + /** + * @type { [CardBaseUIData['suit'], CardBaseUIData['number'], string][] } + */ + list: [CardBaseUIData['suit'], CardBaseUIData['number'], string][]; cooperation_damage: { fullskin: boolean; }; diff --git a/node_modules/@types/noname-typings/nonameModules/noname/status/index.d.ts b/node_modules/@types/noname-typings/nonameModules/noname/status/index.d.ts index 37bbedeb7..74198ffa9 100644 --- a/node_modules/@types/noname-typings/nonameModules/noname/status/index.d.ts +++ b/node_modules/@types/noname-typings/nonameModules/noname/status/index.d.ts @@ -45,6 +45,24 @@ export class status { * @type { boolean | void } */ connectMode: boolean | void; + /** + * @type { boolean | void } + */ + importingExtension: boolean | void; + /** + * @type { Promise[] | void } + */ + extensionLoaded: Promise[] | void; + /** + * @type { Promise[] | void } + */ + extensionLoading: Promise[] | void; + /** + * @type { { [key: string]: Promise[] } | void } + */ + importing: void | { + [key: string]: Promise[]; + }; } export let _status: status; export function setStatus(instance?: status | undefined): void; diff --git a/node_modules/@types/noname-typings/type.d.ts b/node_modules/@types/noname-typings/type.d.ts index 6929b2406..3ff223d93 100644 --- a/node_modules/@types/noname-typings/type.d.ts +++ b/node_modules/@types/noname-typings/type.d.ts @@ -195,7 +195,6 @@ declare interface importCharacterConfig { * 若里面是项目内的同名字段,将覆盖原方法 */ game?: SMap; - /** * 类型:键值对 * @@ -538,6 +537,80 @@ declare interface importExtensionConfig { [key: string]: any; } +/** + * 导入玩法的配置 + */ +declare interface importPlayConfig { + /** 扩展名 */ + name: string; + arenaReady?: Function; + /** + * 设置播放录像 + */ + video?: Function; + /** + * 设置技能 + * */ + skill?: SMap; + /** + * 设置该武将包独有的卡牌(或者是特殊卡牌) + * + * */ + card?: SMap; + translate?: SMap; + /** + * 对应lib.element + * + * 若里面是项目内的同名字段,将覆盖原方法 + */ + element?: SMap; + /** + * 对应ai + * + * 若里面是项目内的同名字段,将覆盖原方法 + */ + ai?: SMap; + /** + * 对应ui + * + * 若里面是项目内的同名字段,将覆盖原方法 + */ + ui?: SMap; + /** + * 对应game + * + * 若里面是项目内的同名字段,将覆盖原方法 + */ + game?: SMap; + /** + * 类型:键值对 + * + * 作用:对应get + * 若里面是项目内的同名字段,将覆盖原方法 + */ + get?: SMap; + /** + * 帮助内容将显示在菜单-选项-帮助中 + * + * 游戏编辑器的帮助代码基本示例结构: + * + * "帮助条目": + * ```jsx + *
    + *
  • 列表1-条目1 + *
  • 列表1-条目2 + *
+ *
    + *
  1. 列表2-条目1 + *
  2. 列表2-条目2 + * + * ``` + * (目前可显示帮助信息:mode,extension,card卡包,character武将包) + */ + help?: SMap; + [key: string]: any; +} + /** * 菜单的选项的配置 *