@modlock/modlock 0.1.93 → 0.1.94

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/host.gen.d.ts CHANGED
@@ -2026,6 +2026,13 @@ export declare function precache(options: PrecacheOptions): boolean;
2026
2026
  * directories are refused.
2027
2027
  */
2028
2028
  export declare function readFile(path: string): string | undefined;
2029
+ /**
2030
+ * readFileBytes reads one of the mod's files from the same places as
2031
+ * ReadFile, as bytes that need not be text, such as a packed table the mod
2032
+ * views in place. A file in neither reads as unset. The host reads the
2033
+ * whole file during the call.
2034
+ */
2035
+ export declare function readFileBytes(path: string): Uint8Array | undefined;
2029
2036
  /**
2030
2037
  * writeFile replaces one of the mod's files in the host's copy, which
2031
2038
  * outlives a restart and an update of the mod; the files the mod ships stay
package/index.js CHANGED
@@ -7599,6 +7599,32 @@ var ReadFileResponse = /* @__PURE__ */ createMessageType(
7599
7599
  }
7600
7600
  }
7601
7601
  );
7602
+ var ReadFileBytesResponse = /* @__PURE__ */ createMessageType(
7603
+ "modlock.wasm.ReadFileBytesResponse",
7604
+ () => [[1, "data", 12, 4]],
7605
+ {
7606
+ decode: (r, end, m) => {
7607
+ while (r.pos < end) {
7608
+ const t = r.tag();
7609
+ if ((t & 7) === 4) return m;
7610
+ switch (t >>> 3) {
7611
+ case 1:
7612
+ m.data = r.bytes();
7613
+ break;
7614
+ default:
7615
+ r.skip(t);
7616
+ }
7617
+ }
7618
+ return m;
7619
+ },
7620
+ encode: (m, w) => {
7621
+ {
7622
+ const v = m.data;
7623
+ if (v != null) w.uint32(10).bytes(v);
7624
+ }
7625
+ }
7626
+ }
7627
+ );
7602
7628
  var WriteFileRequest = /* @__PURE__ */ createMessageType(
7603
7629
  "modlock.wasm.WriteFileRequest",
7604
7630
  () => [
@@ -15582,6 +15608,12 @@ function readFile(path) {
15582
15608
  const response = ReadFileResponse.fromBinary(reply2);
15583
15609
  return response.text;
15584
15610
  }
15611
+ function readFileBytes(path) {
15612
+ const reply2 = call("ReadFileBytes", ReadFileRequest.toBinary({ path }));
15613
+ if (reply2 === void 0) return void 0;
15614
+ const response = ReadFileBytesResponse.fromBinary(reply2);
15615
+ return response.data;
15616
+ }
15585
15617
  function writeFile(path, text2) {
15586
15618
  return call("WriteFile", WriteFileRequest.toBinary({ path, text: text2 })) !== void 0;
15587
15619
  }
@@ -21929,6 +21961,7 @@ export {
21929
21961
  readField,
21930
21962
  readFieldList,
21931
21963
  readFile,
21964
+ readFileBytes,
21932
21965
  readModifierField,
21933
21966
  remapInput,
21934
21967
  removeEntities,
package/package.json CHANGED
@@ -7,11 +7,11 @@
7
7
  "license": "MIT",
8
8
  "name": "@modlock/modlock",
9
9
  "optionalDependencies": {
10
- "@modlock/darwin-arm64": "0.1.93",
11
- "@modlock/darwin-x64": "0.1.93",
12
- "@modlock/linux-arm64": "0.1.93",
13
- "@modlock/linux-x64": "0.1.93",
14
- "@modlock/win32-x64": "0.1.93"
10
+ "@modlock/darwin-arm64": "0.1.94",
11
+ "@modlock/darwin-x64": "0.1.94",
12
+ "@modlock/linux-arm64": "0.1.94",
13
+ "@modlock/linux-x64": "0.1.94",
14
+ "@modlock/win32-x64": "0.1.94"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
@@ -20,5 +20,5 @@
20
20
  "sideEffects": false,
21
21
  "type": "module",
22
22
  "types": "index.d.ts",
23
- "version": "0.1.93"
23
+ "version": "0.1.94"
24
24
  }