项目作者: hazzard993

项目描述 :
Declarations for lurker for use with TypeScriptToLua.
高级语言:
项目地址: git://github.com/hazzard993/tstl-lurker.git
创建时间: 2019-06-18T13:11:09Z
项目社区:https://github.com/hazzard993/tstl-lurker

开源协议:MIT License

下载


TSTL Lurker

Declarations for lurker, a small module which automatically hotswaps changed Lua files in a running LÖVE project.



Command Description
yarn add -D tstl-lurker Install these declarations
yarn add rxi/lume rxi/lurker Install Lurker
tstl -p tsconfig.json --watch Transpile and continue to transpile changed .ts files
love /path/to/game/directory Run the game. Make sure lurker.update() is called

Upon installation these declarations can be linked to a tsconfig.json file.

  1. {
  2. "compilerOptions": {
  3. "types": [
  4. "tstl-lurker"
  5. ]
  6. }
  7. }

And used within any .ts file.

  1. import lurker = require("lurker");
  2. // this import style is not available in esnext
  3. lurker.preswap = (f) => f === "lualib_bundle.lua";
  4. // do NOT hotswap lualib_bundle.lua, lurker can't hotswap this
  5. lurker.path = "./entities";
  6. lurker.quiet = false;
  7. love.update = () => {
  8. lurker.update();
  9. };

Make sure to append ";./node_modules/?/?.lua" to your package.path in a conf.ts file (this is run first) to assist where Lua looks for modules.

  1. package.path += ";./node_modules/?/?.lua";