修改扩展导入失败提示,修改扩展模板为esm,添加cost和getIndex的类型注释,跟进并修复其他类型注释
This commit is contained in:
parent
dcb703b240
commit
6bb7e44704
|
@ -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<typeof import('../library/index.js').Library>,
|
||||
* game: InstanceType<typeof Game>,
|
||||
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||
* ) => 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<typeof import('../library/index.js').Library>, game: InstanceType<typeof Game>, ui: InstanceType<typeof import('../ui/index.js').UI>, get: InstanceType<typeof import('../get/index.js').Get>, ai: InstanceType<typeof import('../ai/index.js').AI>, _status: InstanceType<typeof import('../status/index.js').status>) => importCharacterConfig, url?: any): any;
|
||||
/**
|
||||
* @overload
|
||||
* @param { 'card' } type
|
||||
* @param {(
|
||||
* lib: Library,
|
||||
* game: typeof Game,
|
||||
* ui: UI,
|
||||
* get: Get,
|
||||
* ai: AI,
|
||||
* _status: Status
|
||||
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||
* game: InstanceType<typeof Game>,
|
||||
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||
* ) => 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<typeof import('../library/index.js').Library>, game: InstanceType<typeof Game>, ui: InstanceType<typeof import('../ui/index.js').UI>, get: InstanceType<typeof import('../get/index.js').Get>, ai: InstanceType<typeof import('../ai/index.js').AI>, _status: InstanceType<typeof import('../status/index.js').status>) => importCardConfig, url?: any): any;
|
||||
/**
|
||||
* @overload
|
||||
* @param { 'mode' } type
|
||||
* @param {(
|
||||
* lib: Library,
|
||||
* game: typeof Game,
|
||||
* ui: UI,
|
||||
* get: Get,
|
||||
* ai: AI,
|
||||
* _status: Status
|
||||
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||
* game: InstanceType<typeof Game>,
|
||||
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||
* ) => 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<typeof import('../library/index.js').Library>, game: InstanceType<typeof Game>, ui: InstanceType<typeof import('../ui/index.js').UI>, get: InstanceType<typeof import('../get/index.js').Get>, ai: InstanceType<typeof import('../ai/index.js').AI>, _status: InstanceType<typeof import('../status/index.js').status>) => importModeConfig, url?: any): any;
|
||||
/**
|
||||
* @overload
|
||||
* @param { 'player' } type
|
||||
* @param {(
|
||||
* lib: Library,
|
||||
* game: typeof Game,
|
||||
* ui: UI,
|
||||
* get: Get,
|
||||
* ai: AI,
|
||||
* _status: Status
|
||||
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||
* game: InstanceType<typeof Game>,
|
||||
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||
* ) => 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<typeof import('../library/index.js').Library>, game: InstanceType<typeof Game>, ui: InstanceType<typeof import('../ui/index.js').UI>, get: InstanceType<typeof import('../get/index.js').Get>, ai: InstanceType<typeof import('../ai/index.js').AI>, _status: InstanceType<typeof import('../status/index.js').status>) => importPlayerConfig, url?: any): any;
|
||||
/**
|
||||
* @overload
|
||||
* @param { 'extension' } type
|
||||
* @param {(
|
||||
* lib: Library,
|
||||
* game: typeof Game,
|
||||
* ui: UI,
|
||||
* get: Get,
|
||||
* ai: AI,
|
||||
* _status: Status
|
||||
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||
* game: InstanceType<typeof Game>,
|
||||
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||
* ) => 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<typeof import('../library/index.js').Library>, game: InstanceType<typeof Game>, ui: InstanceType<typeof import('../ui/index.js').UI>, get: InstanceType<typeof import('../get/index.js').Get>, ai: InstanceType<typeof import('../ai/index.js').AI>, _status: InstanceType<typeof import('../status/index.js').status>) => importExtensionConfig, url?: any): any;
|
||||
/**
|
||||
* @overload
|
||||
* @param { 'play' } type
|
||||
* @param {(
|
||||
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||
* game: InstanceType<typeof Game>,
|
||||
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||
* ) => importPlayConfig } content
|
||||
* @param {*} [url]
|
||||
*/
|
||||
import(type: 'play', content: (lib: InstanceType<typeof import('../library/index.js').Library>, game: InstanceType<typeof Game>, ui: InstanceType<typeof import('../ui/index.js').UI>, get: InstanceType<typeof import('../get/index.js').Get>, ai: InstanceType<typeof import('../ai/index.js').AI>, _status: InstanceType<typeof import('../status/index.js').status>) => importPlayConfig, url?: any): any;
|
||||
loadExtension(object: any): Promise<any>;
|
||||
/**
|
||||
* 下载文件
|
||||
|
@ -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[];
|
||||
|
|
1
node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts
generated
vendored
1
node_modules/@types/noname-typings/nonameModules/noname/library/element/player.d.ts
generated
vendored
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -45,6 +45,24 @@ export class status {
|
|||
* @type { boolean | void }
|
||||
*/
|
||||
connectMode: boolean | void;
|
||||
/**
|
||||
* @type { boolean | void }
|
||||
*/
|
||||
importingExtension: boolean | void;
|
||||
/**
|
||||
* @type { Promise<any>[] | void }
|
||||
*/
|
||||
extensionLoaded: Promise<any>[] | void;
|
||||
/**
|
||||
* @type { Promise<any>[] | void }
|
||||
*/
|
||||
extensionLoading: Promise<any>[] | void;
|
||||
/**
|
||||
* @type { { [key: string]: Promise<any>[] } | void }
|
||||
*/
|
||||
importing: void | {
|
||||
[key: string]: Promise<any>[];
|
||||
};
|
||||
}
|
||||
export let _status: status;
|
||||
export function setStatus(instance?: status | undefined): void;
|
||||
|
|
|
@ -195,7 +195,6 @@ declare interface importCharacterConfig {
|
|||
* 若里面是项目内的同名字段,将覆盖原方法
|
||||
*/
|
||||
game?: SMap<any>;
|
||||
|
||||
/**
|
||||
* 类型:键值对
|
||||
*
|
||||
|
@ -538,6 +537,80 @@ declare interface importExtensionConfig {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入玩法的配置
|
||||
*/
|
||||
declare interface importPlayConfig {
|
||||
/** 扩展名 */
|
||||
name: string;
|
||||
arenaReady?: Function;
|
||||
/**
|
||||
* 设置播放录像
|
||||
*/
|
||||
video?: Function;
|
||||
/**
|
||||
* 设置技能
|
||||
* */
|
||||
skill?: SMap<Skill>;
|
||||
/**
|
||||
* 设置该武将包独有的卡牌(或者是特殊卡牌)
|
||||
*
|
||||
* */
|
||||
card?: SMap<any>;
|
||||
translate?: SMap<string>;
|
||||
/**
|
||||
* 对应lib.element
|
||||
*
|
||||
* 若里面是项目内的同名字段,将覆盖原方法
|
||||
*/
|
||||
element?: SMap<any>;
|
||||
/**
|
||||
* 对应ai
|
||||
*
|
||||
* 若里面是项目内的同名字段,将覆盖原方法
|
||||
*/
|
||||
ai?: SMap<any>;
|
||||
/**
|
||||
* 对应ui
|
||||
*
|
||||
* 若里面是项目内的同名字段,将覆盖原方法
|
||||
*/
|
||||
ui?: SMap<any>;
|
||||
/**
|
||||
* 对应game
|
||||
*
|
||||
* 若里面是项目内的同名字段,将覆盖原方法
|
||||
*/
|
||||
game?: SMap<any>;
|
||||
/**
|
||||
* 类型:键值对
|
||||
*
|
||||
* 作用:对应get
|
||||
* 若里面是项目内的同名字段,将覆盖原方法
|
||||
*/
|
||||
get?: SMap<any>;
|
||||
/**
|
||||
* 帮助内容将显示在菜单-选项-帮助中
|
||||
*
|
||||
* 游戏编辑器的帮助代码基本示例结构:
|
||||
*
|
||||
* "帮助条目":
|
||||
* ```jsx
|
||||
* <ul>
|
||||
* <li>列表1-条目1
|
||||
* <li>列表1-条目2
|
||||
* </ul>
|
||||
* <ol>
|
||||
* <li>列表2-条目1
|
||||
* <li>列表2-条目2
|
||||
* </ul>
|
||||
* ```
|
||||
* (目前可显示帮助信息:mode,extension,card卡包,character武将包)
|
||||
*/
|
||||
help?: SMap<string>;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单的选项的配置
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue