fix:plugin引入类型检查
This commit is contained in:
parent
a76b68ef87
commit
2ef2b89985
@ -1101,7 +1101,7 @@ editor_file = function (editor, callback) {
|
||||
for (var id_ in plmap) {
|
||||
plraw = plraw.replace('"' + id_ + '"', plmap[id_])
|
||||
}
|
||||
var datastr = '/// <reference path="../runtime.d.ts" />\nvar plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = \n';
|
||||
var datastr = '// @ts-check\n/// <reference path="../runtime.d.ts" />\nvar plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = \n';
|
||||
datastr += plraw;
|
||||
fs.writeFile('project/plugins.js', encode(datastr), 'base64', function (err, data) {
|
||||
callback(err);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// @ts-check
|
||||
/// <reference path="../runtime.d.ts" />
|
||||
var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
||||
{
|
||||
"init": function () {
|
||||
|
||||
|
||||
14
runtime.d.ts
vendored
14
runtime.d.ts
vendored
@ -11,6 +11,7 @@ type rgbarray = [number, number, number, number]
|
||||
type Events = MotaAction[] | string
|
||||
|
||||
type Block = {
|
||||
disable: boolean,
|
||||
x: number,
|
||||
y: number,
|
||||
id: number,
|
||||
@ -281,11 +282,11 @@ type gameStatus = {
|
||||
// event事件
|
||||
shops: {}
|
||||
event: {
|
||||
id: string
|
||||
id?: string | null
|
||||
data: any
|
||||
selection: any
|
||||
ui: any
|
||||
interval: number
|
||||
interval?: number | null
|
||||
}
|
||||
autoEvents: Events
|
||||
textAttribute: {
|
||||
@ -324,6 +325,11 @@ type gameStatus = {
|
||||
|
||||
/** @file control.js 主要用来进行游戏控制,比如行走控制、自动寻路、存读档等等游戏核心内容。 */
|
||||
interface control {
|
||||
|
||||
_updateDamage_damage(floorId: string, onMap: boolean): void
|
||||
_updateDamage_extraDamage(floorId: string, onMap: boolean): void
|
||||
/** 物品数据显示 */
|
||||
getItemDetail(floorId: string): void
|
||||
|
||||
/**
|
||||
* 开启调试模式, 此模式下可以按Ctrl键进行穿墙, 并忽略一切事件。
|
||||
@ -2243,6 +2249,7 @@ interface items {
|
||||
|
||||
/** @file ui.js 主要用来进行UI窗口的绘制,如对话框、怪物手册、楼传器、存读档界面等等。*/
|
||||
interface ui {
|
||||
_buildFont(fontSize?: number | string, bold?: boolean, italic?: boolean, font?: string): string
|
||||
|
||||
/**
|
||||
* 根据画布名找到一个画布的context;支持系统画布和自定义画布。如果不存在画布返回null。
|
||||
@ -3006,7 +3013,8 @@ type CoreMixin = {
|
||||
favorite: []
|
||||
readonly favoriteName: {}
|
||||
}
|
||||
readonly initStatus: gameStatus;
|
||||
readonly initStatus: gameStatus
|
||||
readonly canvas: { [key: string]: CanvasRenderingContext2D }
|
||||
readonly dymCanvas: { [key: string]: CanvasRenderingContext2D }
|
||||
/** 游戏状态 */
|
||||
readonly status: gameStatus
|
||||
|
||||
Loading…
Reference in New Issue
Block a user