@noita-ts/pollnet 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.lua CHANGED
@@ -46,7 +46,7 @@ void pollnet_sleep_ms(uint32_t milliseconds);
46
46
  ]]
47
47
 
48
48
  --- @noita-ts-include ./pollnet.dll
49
- local pollnet = ffi.load("mods/" .. require("$mod").MOD_ID .. "/lua_modules/@noita-ts/pollnet/dist/pollnet.dll")
49
+ local pollnet = require("dll").default
50
50
 
51
51
  local POLLNET_VERSION = ffi.string(pollnet.pollnet_version())
52
52
 
package/dist/dll.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /** @noSelfInFile */
2
+ /**
3
+ * The pollnet library, loaded from the folder of the mod that ships it.
4
+ *
5
+ * `api.lua` cannot load it on its own: it is plain Lua, so it cannot reach
6
+ * across packages for the lookup that a mod installed from the Steam Workshop
7
+ * needs. The `@noita-ts-include` of the DLL itself stays in `api.lua`, next to
8
+ * the declarations of what it exports.
9
+ */
10
+ declare const _default: Record<string, any>;
11
+ export default _default;
package/dist/dll.lua ADDED
@@ -0,0 +1,6 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local ____mods = require("@noita-ts/ffi/mods")
4
+ local MOD_CONTEXT = ____mods.default
5
+ ____exports.default = MOD_CONTEXT:loadDll("lua_modules/@noita-ts/pollnet/dist/pollnet.dll")
6
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noita-ts/pollnet",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "files": [
5
5
  "dist/**/*.{lua,dll,d.ts}",
6
6
  "LICENSE-pollnet"
@@ -23,6 +23,7 @@
23
23
  "prepublishOnly": "rm -rf dist && npm run build"
24
24
  },
25
25
  "dependencies": {
26
+ "@noita-ts/ffi": "^0.6.3",
26
27
  "@typescript-to-lua/language-extensions": "^1.19.0",
27
28
  "lua-types": "^2.13.1"
28
29
  },