diff --git a/packages/core/package.json b/packages/core/package.json index 515d2c5c..c535837c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -12,6 +12,7 @@ "homepage": "https://github.com/circlecloud/ms.git", "license": "ISC", "main": "dist/index.js", + "typings": "dist/index.d.ts", "publishConfig": { "registry": "https://repo.yumc.pw/repository/npm-hosted/" }, @@ -34,4 +35,4 @@ "@ms/plugin": "^0.1.1", "@ms/sponge": "^0.1.1" } -} +} \ No newline at end of file diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 48634d30..93b4daf3 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -37,9 +37,9 @@ class MiaoScriptCore { loadTaskFunction() { //@ts-ignore - global.setTimeout = (func: Function, tick: number) => this.taskManager.create(func).later(tick).submit() + global.setTimeout = (func: Function, tick: number, async: boolean = false) => this.taskManager.create(func).later(tick).async(async).submit() //@ts-ignore - global.setInterval = (func: Function, tick: number) => this.taskManager.create(func).timer(tick).submit() + global.setInterval = (func: Function, tick: number, async: boolean = false) => this.taskManager.create(func).timer(tick).async(async).submit() } loadPlugins() {