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 + } +}