修改扩展导入失败提示,修改扩展模板为esm,添加cost和getIndex的类型注释,跟进并修复其他类型注释
This commit is contained in:
parent
dcb703b240
commit
6bb7e44704
|
@ -517,72 +517,86 @@ export class Game {
|
||||||
* @overload
|
* @overload
|
||||||
* @param { 'character' } type
|
* @param { 'character' } type
|
||||||
* @param {(
|
* @param {(
|
||||||
* lib: Library,
|
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||||
* game: typeof Game,
|
* game: InstanceType<typeof Game>,
|
||||||
* ui: UI,
|
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||||
* get: Get,
|
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||||
* ai: AI,
|
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||||
* _status: Status
|
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||||
* ) => importCharacterConfig } content
|
* ) => importCharacterConfig } content
|
||||||
* @param {*} [url]
|
* @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
|
* @overload
|
||||||
* @param { 'card' } type
|
* @param { 'card' } type
|
||||||
* @param {(
|
* @param {(
|
||||||
* lib: Library,
|
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||||
* game: typeof Game,
|
* game: InstanceType<typeof Game>,
|
||||||
* ui: UI,
|
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||||
* get: Get,
|
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||||
* ai: AI,
|
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||||
* _status: Status
|
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||||
* ) => importCardConfig } content
|
* ) => importCardConfig } content
|
||||||
* @param {*} [url]
|
* @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
|
* @overload
|
||||||
* @param { 'mode' } type
|
* @param { 'mode' } type
|
||||||
* @param {(
|
* @param {(
|
||||||
* lib: Library,
|
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||||
* game: typeof Game,
|
* game: InstanceType<typeof Game>,
|
||||||
* ui: UI,
|
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||||
* get: Get,
|
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||||
* ai: AI,
|
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||||
* _status: Status
|
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||||
* ) => importModeConfig } content
|
* ) => importModeConfig } content
|
||||||
* @param {*} [url]
|
* @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
|
* @overload
|
||||||
* @param { 'player' } type
|
* @param { 'player' } type
|
||||||
* @param {(
|
* @param {(
|
||||||
* lib: Library,
|
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||||
* game: typeof Game,
|
* game: InstanceType<typeof Game>,
|
||||||
* ui: UI,
|
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||||
* get: Get,
|
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||||
* ai: AI,
|
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||||
* _status: Status
|
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||||
* ) => importPlayerConfig } content
|
* ) => importPlayerConfig } content
|
||||||
* @param {*} [url]
|
* @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
|
* @overload
|
||||||
* @param { 'extension' } type
|
* @param { 'extension' } type
|
||||||
* @param {(
|
* @param {(
|
||||||
* lib: Library,
|
* lib: InstanceType<typeof import('../library/index.js').Library>,
|
||||||
* game: typeof Game,
|
* game: InstanceType<typeof Game>,
|
||||||
* ui: UI,
|
* ui: InstanceType<typeof import('../ui/index.js').UI>,
|
||||||
* get: Get,
|
* get: InstanceType<typeof import('../get/index.js').Get>,
|
||||||
* ai: AI,
|
* ai: InstanceType<typeof import('../ai/index.js').AI>,
|
||||||
* _status: Status
|
* _status: InstanceType<typeof import('../status/index.js').status>
|
||||||
* ) => importExtensionConfig } content
|
* ) => importExtensionConfig } content
|
||||||
* @param {*} [url]
|
* @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>;
|
loadExtension(object: any): Promise<any>;
|
||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
|
@ -611,9 +625,9 @@ export class Game {
|
||||||
removeFile: ((filename: string, callback?: ((e: Error) => void) | undefined) => void) | undefined;
|
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) }
|
* @type { undefined | ((list: string | string[], callback: Function, file?: boolean) => void) }
|
||||||
|
@ -959,8 +973,9 @@ export class Game {
|
||||||
addGlobalSkill(skill: string, player?: any): boolean;
|
addGlobalSkill(skill: string, player?: any): boolean;
|
||||||
/**
|
/**
|
||||||
* @param { string } skill
|
* @param { string } skill
|
||||||
|
* @param { lib.element.Player } player
|
||||||
*/
|
*/
|
||||||
removeGlobalSkill(skill: string): void;
|
removeGlobalSkill(skill: string, player: lib.element.Player): void;
|
||||||
resetSkills(): void;
|
resetSkills(): void;
|
||||||
/**
|
/**
|
||||||
* @param { string } extensionName
|
* @param { string } extensionName
|
||||||
|
@ -1371,6 +1386,7 @@ export type GameHistory = {
|
||||||
everything: GameEventPromise[];
|
everything: GameEventPromise[];
|
||||||
};
|
};
|
||||||
export type Video = {
|
export type Video = {
|
||||||
|
name?: string;
|
||||||
type: string;
|
type: string;
|
||||||
player?: string;
|
player?: string;
|
||||||
content?: string | any[];
|
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;
|
lose(...args: any[]): any;
|
||||||
damage(...args: any[]): any;
|
damage(...args: any[]): any;
|
||||||
recover(...args: any[]): any;
|
recover(...args: any[]): any;
|
||||||
|
recoverTo(...args: any[]): any;
|
||||||
doubleDraw(): any;
|
doubleDraw(): any;
|
||||||
loseHp(num: any): any;
|
loseHp(num: any): any;
|
||||||
loseMaxHp(...args: any[]): any;
|
loseMaxHp(...args: any[]): any;
|
||||||
|
|
|
@ -4043,7 +4043,10 @@ export class Library {
|
||||||
readonly nodews: Element.NodeWS;
|
readonly nodews: Element.NodeWS;
|
||||||
};
|
};
|
||||||
card: {
|
card: {
|
||||||
list: never[];
|
/**
|
||||||
|
* @type { [CardBaseUIData['suit'], CardBaseUIData['number'], string][] }
|
||||||
|
*/
|
||||||
|
list: [CardBaseUIData['suit'], CardBaseUIData['number'], string][];
|
||||||
cooperation_damage: {
|
cooperation_damage: {
|
||||||
fullskin: boolean;
|
fullskin: boolean;
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,6 +45,24 @@ export class status {
|
||||||
* @type { boolean | void }
|
* @type { boolean | void }
|
||||||
*/
|
*/
|
||||||
connectMode: 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 let _status: status;
|
||||||
export function setStatus(instance?: status | undefined): void;
|
export function setStatus(instance?: status | undefined): void;
|
||||||
|
|
|
@ -195,7 +195,6 @@ declare interface importCharacterConfig {
|
||||||
* 若里面是项目内的同名字段,将覆盖原方法
|
* 若里面是项目内的同名字段,将覆盖原方法
|
||||||
*/
|
*/
|
||||||
game?: SMap<any>;
|
game?: SMap<any>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型:键值对
|
* 类型:键值对
|
||||||
*
|
*
|
||||||
|
@ -538,6 +537,80 @@ declare interface importExtensionConfig {
|
||||||
[key: string]: any;
|
[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