From 7ef3b70edb7ee1df97af46c657d1e410df41d5b4 Mon Sep 17 00:00:00 2001 From: Alula <6276139+alula@users.noreply.github.com> Date: Sun, 14 Feb 2021 00:08:25 +0100 Subject: [PATCH] prepare it for api docs --- src/scripting/doukutsu.d.ts | 19 +++++++++++++++++++ src/scripting/tsconfig.json | 23 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/scripting/tsconfig.json diff --git a/src/scripting/doukutsu.d.ts b/src/scripting/doukutsu.d.ts index 002860f..60995ed 100644 --- a/src/scripting/doukutsu.d.ts +++ b/src/scripting/doukutsu.d.ts @@ -69,6 +69,25 @@ declare namespace doukutsu { */ function playMusic(id: number): void; + /** + * Sets an implementation-defined game setting. + * @param name + * @param value + */ + function setSetting(name: string, value: any): void; + + /** + * Registers an event handler called after all scripts are loaded. + * @param event event name + * @param handler event handler procedure + */ + function on(event: "init", handler: EventHandler): EventHandler; + + /** + * Registers an event handler called on each tick. + * @param event event name + * @param handler event handler procedure + */ function on(event: "tick", handler: EventHandler): EventHandler; function on(event: string, handler: EventHandler): EventHandler; diff --git a/src/scripting/tsconfig.json b/src/scripting/tsconfig.json new file mode 100644 index 0000000..99b6719 --- /dev/null +++ b/src/scripting/tsconfig.json @@ -0,0 +1,23 @@ +{ + "files": [ + "doukutsu.d.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es2018" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "./", + "typeRoots": [ + "./" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +}