aoe2rec-js 0.1.12 → 0.1.19

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/aoe2rec_js.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function parse_rec(buffer: ArrayBuffer): any;
4
- export function parse_rec_summary(buffer: ArrayBuffer): SavegameSummary;
3
+
5
4
  export class GameSettings {
6
5
  private constructor();
7
6
  free(): void;
7
+ [Symbol.dispose](): void;
8
8
  dataset_ref: number;
9
9
  difficulty: number;
10
10
  selected_map_id: number;
@@ -47,9 +47,11 @@ export class GameSettings {
47
47
  lobby_name: string;
48
48
  modded_dataset: string;
49
49
  }
50
+
50
51
  export class Player {
51
52
  private constructor();
52
53
  free(): void;
54
+ [Symbol.dispose](): void;
53
55
  name: string;
54
56
  color_id: number;
55
57
  selected_color: number;
@@ -63,9 +65,11 @@ export class Player {
63
65
  prefer_random: boolean;
64
66
  resigned: boolean;
65
67
  }
68
+
66
69
  export class Replay {
67
70
  private constructor();
68
71
  free(): void;
72
+ [Symbol.dispose](): void;
69
73
  old_time: number;
70
74
  world_time: number;
71
75
  old_world_time: number;
@@ -82,9 +86,11 @@ export class Replay {
82
86
  cheats_enabled: boolean;
83
87
  game_mode: number;
84
88
  }
89
+
85
90
  export class SavegameHeader {
86
91
  private constructor();
87
92
  free(): void;
93
+ [Symbol.dispose](): void;
88
94
  game_string: string;
89
95
  version_major: number;
90
96
  version_minor: number;
@@ -93,16 +99,24 @@ export class SavegameHeader {
93
99
  game_settings: GameSettings;
94
100
  replay: Replay;
95
101
  }
102
+
96
103
  export class SavegameSummary {
97
104
  private constructor();
98
105
  free(): void;
106
+ [Symbol.dispose](): void;
99
107
  header: SavegameHeader;
100
108
  teams: Team[];
101
109
  duration: number;
102
110
  }
111
+
103
112
  export class Team {
104
113
  private constructor();
105
114
  free(): void;
115
+ [Symbol.dispose](): void;
106
116
  winner: boolean;
107
117
  players: Player[];
108
118
  }
119
+
120
+ export function parse_rec(buffer: ArrayBuffer): any;
121
+
122
+ export function parse_rec_summary(buffer: ArrayBuffer): SavegameSummary;
package/aoe2rec_js_bg.js CHANGED
@@ -3,92 +3,16 @@ export function __wbg_set_wasm(val) {
3
3
  wasm = val;
4
4
  }
5
5
 
6
-
7
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
8
-
9
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
10
-
11
- cachedTextDecoder.decode();
12
-
13
- let cachedUint8ArrayMemory0 = null;
14
-
15
- function getUint8ArrayMemory0() {
16
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
17
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
18
- }
19
- return cachedUint8ArrayMemory0;
20
- }
21
-
22
- function getStringFromWasm0(ptr, len) {
23
- ptr = ptr >>> 0;
24
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
25
- }
26
-
27
- let WASM_VECTOR_LEN = 0;
28
-
29
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
30
-
31
- let cachedTextEncoder = new lTextEncoder('utf-8');
32
-
33
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
34
- ? function (arg, view) {
35
- return cachedTextEncoder.encodeInto(arg, view);
36
- }
37
- : function (arg, view) {
38
- const buf = cachedTextEncoder.encode(arg);
39
- view.set(buf);
40
- return {
41
- read: arg.length,
42
- written: buf.length
43
- };
44
- });
45
-
46
- function passStringToWasm0(arg, malloc, realloc) {
47
-
48
- if (realloc === undefined) {
49
- const buf = cachedTextEncoder.encode(arg);
50
- const ptr = malloc(buf.length, 1) >>> 0;
51
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
52
- WASM_VECTOR_LEN = buf.length;
53
- return ptr;
54
- }
55
-
56
- let len = arg.length;
57
- let ptr = malloc(len, 1) >>> 0;
58
-
59
- const mem = getUint8ArrayMemory0();
60
-
61
- let offset = 0;
62
-
63
- for (; offset < len; offset++) {
64
- const code = arg.charCodeAt(offset);
65
- if (code > 0x7F) break;
66
- mem[ptr + offset] = code;
67
- }
68
-
69
- if (offset !== len) {
70
- if (offset !== 0) {
71
- arg = arg.slice(offset);
72
- }
73
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
74
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
75
- const ret = encodeString(arg, view);
76
-
77
- offset += ret.written;
78
- ptr = realloc(ptr, len, offset, 1) >>> 0;
79
- }
80
-
81
- WASM_VECTOR_LEN = offset;
82
- return ptr;
6
+ function addToExternrefTable0(obj) {
7
+ const idx = wasm.__externref_table_alloc();
8
+ wasm.__wbindgen_externrefs.set(idx, obj);
9
+ return idx;
83
10
  }
84
11
 
85
- let cachedDataViewMemory0 = null;
86
-
87
- function getDataViewMemory0() {
88
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
89
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
12
+ function _assertClass(instance, klass) {
13
+ if (!(instance instanceof klass)) {
14
+ throw new Error(`expected instance of ${klass.name}`);
90
15
  }
91
- return cachedDataViewMemory0;
92
16
  }
93
17
 
94
18
  function debugString(val) {
@@ -156,62 +80,41 @@ function debugString(val) {
156
80
  return className;
157
81
  }
158
82
 
159
- function isLikeNone(x) {
160
- return x === undefined || x === null;
161
- }
162
- /**
163
- * @param {ArrayBuffer} buffer
164
- * @returns {any}
165
- */
166
- export function parse_rec(buffer) {
167
- const ret = wasm.parse_rec(buffer);
168
- return ret;
169
- }
170
-
171
- /**
172
- * @param {ArrayBuffer} buffer
173
- * @returns {SavegameSummary}
174
- */
175
- export function parse_rec_summary(buffer) {
176
- const ret = wasm.parse_rec_summary(buffer);
177
- return SavegameSummary.__wrap(ret);
178
- }
179
-
180
- function _assertClass(instance, klass) {
181
- if (!(instance instanceof klass)) {
182
- throw new Error(`expected instance of ${klass.name}`);
183
- }
184
- }
185
-
186
83
  function getArrayJsValueFromWasm0(ptr, len) {
187
84
  ptr = ptr >>> 0;
188
85
  const mem = getDataViewMemory0();
189
86
  const result = [];
190
87
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
191
- result.push(wasm.__wbindgen_export_3.get(mem.getUint32(i, true)));
88
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
192
89
  }
193
90
  wasm.__externref_drop_slice(ptr, len);
194
91
  return result;
195
92
  }
196
93
 
197
- function addToExternrefTable0(obj) {
198
- const idx = wasm.__externref_table_alloc();
199
- wasm.__wbindgen_export_3.set(idx, obj);
200
- return idx;
94
+ function getArrayU32FromWasm0(ptr, len) {
95
+ ptr = ptr >>> 0;
96
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
201
97
  }
202
98
 
203
- function passArrayJsValueToWasm0(array, malloc) {
204
- const ptr = malloc(array.length * 4, 4) >>> 0;
205
- for (let i = 0; i < array.length; i++) {
206
- const add = addToExternrefTable0(array[i]);
207
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
99
+ function getArrayU8FromWasm0(ptr, len) {
100
+ ptr = ptr >>> 0;
101
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
102
+ }
103
+
104
+ let cachedDataViewMemory0 = null;
105
+ function getDataViewMemory0() {
106
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
107
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
208
108
  }
209
- WASM_VECTOR_LEN = array.length;
210
- return ptr;
109
+ return cachedDataViewMemory0;
211
110
  }
212
111
 
213
- let cachedUint32ArrayMemory0 = null;
112
+ function getStringFromWasm0(ptr, len) {
113
+ ptr = ptr >>> 0;
114
+ return decodeText(ptr, len);
115
+ }
214
116
 
117
+ let cachedUint32ArrayMemory0 = null;
215
118
  function getUint32ArrayMemory0() {
216
119
  if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
217
120
  cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
@@ -219,9 +122,16 @@ function getUint32ArrayMemory0() {
219
122
  return cachedUint32ArrayMemory0;
220
123
  }
221
124
 
222
- function getArrayU32FromWasm0(ptr, len) {
223
- ptr = ptr >>> 0;
224
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
125
+ let cachedUint8ArrayMemory0 = null;
126
+ function getUint8ArrayMemory0() {
127
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
128
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
129
+ }
130
+ return cachedUint8ArrayMemory0;
131
+ }
132
+
133
+ function isLikeNone(x) {
134
+ return x === undefined || x === null;
225
135
  }
226
136
 
227
137
  function passArray32ToWasm0(arg, malloc) {
@@ -231,12 +141,107 @@ function passArray32ToWasm0(arg, malloc) {
231
141
  return ptr;
232
142
  }
233
143
 
144
+ function passArrayJsValueToWasm0(array, malloc) {
145
+ const ptr = malloc(array.length * 4, 4) >>> 0;
146
+ for (let i = 0; i < array.length; i++) {
147
+ const add = addToExternrefTable0(array[i]);
148
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
149
+ }
150
+ WASM_VECTOR_LEN = array.length;
151
+ return ptr;
152
+ }
153
+
154
+ function passStringToWasm0(arg, malloc, realloc) {
155
+ if (realloc === undefined) {
156
+ const buf = cachedTextEncoder.encode(arg);
157
+ const ptr = malloc(buf.length, 1) >>> 0;
158
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
159
+ WASM_VECTOR_LEN = buf.length;
160
+ return ptr;
161
+ }
162
+
163
+ let len = arg.length;
164
+ let ptr = malloc(len, 1) >>> 0;
165
+
166
+ const mem = getUint8ArrayMemory0();
167
+
168
+ let offset = 0;
169
+
170
+ for (; offset < len; offset++) {
171
+ const code = arg.charCodeAt(offset);
172
+ if (code > 0x7F) break;
173
+ mem[ptr + offset] = code;
174
+ }
175
+ if (offset !== len) {
176
+ if (offset !== 0) {
177
+ arg = arg.slice(offset);
178
+ }
179
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
180
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
181
+ const ret = cachedTextEncoder.encodeInto(arg, view);
182
+
183
+ offset += ret.written;
184
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
185
+ }
186
+
187
+ WASM_VECTOR_LEN = offset;
188
+ return ptr;
189
+ }
190
+
191
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
192
+ cachedTextDecoder.decode();
193
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
194
+ let numBytesDecoded = 0;
195
+ function decodeText(ptr, len) {
196
+ numBytesDecoded += len;
197
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
198
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
199
+ cachedTextDecoder.decode();
200
+ numBytesDecoded = len;
201
+ }
202
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
203
+ }
204
+
205
+ const cachedTextEncoder = new TextEncoder();
206
+
207
+ if (!('encodeInto' in cachedTextEncoder)) {
208
+ cachedTextEncoder.encodeInto = function (arg, view) {
209
+ const buf = cachedTextEncoder.encode(arg);
210
+ view.set(buf);
211
+ return {
212
+ read: arg.length,
213
+ written: buf.length
214
+ };
215
+ }
216
+ }
217
+
218
+ let WASM_VECTOR_LEN = 0;
219
+
234
220
  const GameSettingsFinalization = (typeof FinalizationRegistry === 'undefined')
235
221
  ? { register: () => {}, unregister: () => {} }
236
222
  : new FinalizationRegistry(ptr => wasm.__wbg_gamesettings_free(ptr >>> 0, 1));
237
223
 
238
- export class GameSettings {
224
+ const PlayerFinalization = (typeof FinalizationRegistry === 'undefined')
225
+ ? { register: () => {}, unregister: () => {} }
226
+ : new FinalizationRegistry(ptr => wasm.__wbg_player_free(ptr >>> 0, 1));
227
+
228
+ const ReplayFinalization = (typeof FinalizationRegistry === 'undefined')
229
+ ? { register: () => {}, unregister: () => {} }
230
+ : new FinalizationRegistry(ptr => wasm.__wbg_replay_free(ptr >>> 0, 1));
231
+
232
+ const SavegameHeaderFinalization = (typeof FinalizationRegistry === 'undefined')
233
+ ? { register: () => {}, unregister: () => {} }
234
+ : new FinalizationRegistry(ptr => wasm.__wbg_savegameheader_free(ptr >>> 0, 1));
235
+
236
+ const SavegameSummaryFinalization = (typeof FinalizationRegistry === 'undefined')
237
+ ? { register: () => {}, unregister: () => {} }
238
+ : new FinalizationRegistry(ptr => wasm.__wbg_savegamesummary_free(ptr >>> 0, 1));
239
239
 
240
+ const TeamFinalization = (typeof FinalizationRegistry === 'undefined')
241
+ ? { register: () => {}, unregister: () => {} }
242
+ : new FinalizationRegistry(ptr => wasm.__wbg_team_free(ptr >>> 0, 1));
243
+
244
+ export class GameSettings {
240
245
  static __wrap(ptr) {
241
246
  ptr = ptr >>> 0;
242
247
  const obj = Object.create(GameSettings.prototype);
@@ -244,14 +249,12 @@ export class GameSettings {
244
249
  GameSettingsFinalization.register(obj, obj.__wbg_ptr, obj);
245
250
  return obj;
246
251
  }
247
-
248
252
  __destroy_into_raw() {
249
253
  const ptr = this.__wbg_ptr;
250
254
  this.__wbg_ptr = 0;
251
255
  GameSettingsFinalization.unregister(this);
252
256
  return ptr;
253
257
  }
254
-
255
258
  free() {
256
259
  const ptr = this.__destroy_into_raw();
257
260
  wasm.__wbg_gamesettings_free(ptr, 0);
@@ -814,13 +817,9 @@ export class GameSettings {
814
817
  wasm.__wbg_set_gamesettings_modded_dataset(this.__wbg_ptr, ptr0, len0);
815
818
  }
816
819
  }
817
-
818
- const PlayerFinalization = (typeof FinalizationRegistry === 'undefined')
819
- ? { register: () => {}, unregister: () => {} }
820
- : new FinalizationRegistry(ptr => wasm.__wbg_player_free(ptr >>> 0, 1));
820
+ if (Symbol.dispose) GameSettings.prototype[Symbol.dispose] = GameSettings.prototype.free;
821
821
 
822
822
  export class Player {
823
-
824
823
  static __wrap(ptr) {
825
824
  ptr = ptr >>> 0;
826
825
  const obj = Object.create(Player.prototype);
@@ -828,21 +827,18 @@ export class Player {
828
827
  PlayerFinalization.register(obj, obj.__wbg_ptr, obj);
829
828
  return obj;
830
829
  }
831
-
832
830
  static __unwrap(jsValue) {
833
831
  if (!(jsValue instanceof Player)) {
834
832
  return 0;
835
833
  }
836
834
  return jsValue.__destroy_into_raw();
837
835
  }
838
-
839
836
  __destroy_into_raw() {
840
837
  const ptr = this.__wbg_ptr;
841
838
  this.__wbg_ptr = 0;
842
839
  PlayerFinalization.unregister(this);
843
840
  return ptr;
844
841
  }
845
-
846
842
  free() {
847
843
  const ptr = this.__destroy_into_raw();
848
844
  wasm.__wbg_player_free(ptr, 0);
@@ -969,8 +965,8 @@ export class Player {
969
965
  * @returns {number}
970
966
  */
971
967
  get profile_id() {
972
- const ret = wasm.__wbg_get_gamesettings_dataset_ref(this.__wbg_ptr);
973
- return ret >>> 0;
968
+ const ret = wasm.__wbg_get_player_profile_id(this.__wbg_ptr);
969
+ return ret;
974
970
  }
975
971
  /**
976
972
  * @param {number} arg0
@@ -1018,13 +1014,9 @@ export class Player {
1018
1014
  wasm.__wbg_set_player_resigned(this.__wbg_ptr, arg0);
1019
1015
  }
1020
1016
  }
1021
-
1022
- const ReplayFinalization = (typeof FinalizationRegistry === 'undefined')
1023
- ? { register: () => {}, unregister: () => {} }
1024
- : new FinalizationRegistry(ptr => wasm.__wbg_replay_free(ptr >>> 0, 1));
1017
+ if (Symbol.dispose) Player.prototype[Symbol.dispose] = Player.prototype.free;
1025
1018
 
1026
1019
  export class Replay {
1027
-
1028
1020
  static __wrap(ptr) {
1029
1021
  ptr = ptr >>> 0;
1030
1022
  const obj = Object.create(Replay.prototype);
@@ -1032,14 +1024,12 @@ export class Replay {
1032
1024
  ReplayFinalization.register(obj, obj.__wbg_ptr, obj);
1033
1025
  return obj;
1034
1026
  }
1035
-
1036
1027
  __destroy_into_raw() {
1037
1028
  const ptr = this.__wbg_ptr;
1038
1029
  this.__wbg_ptr = 0;
1039
1030
  ReplayFinalization.unregister(this);
1040
1031
  return ptr;
1041
1032
  }
1042
-
1043
1033
  free() {
1044
1034
  const ptr = this.__destroy_into_raw();
1045
1035
  wasm.__wbg_replay_free(ptr, 0);
@@ -1240,13 +1230,9 @@ export class Replay {
1240
1230
  wasm.__wbg_set_replay_game_mode(this.__wbg_ptr, arg0);
1241
1231
  }
1242
1232
  }
1243
-
1244
- const SavegameHeaderFinalization = (typeof FinalizationRegistry === 'undefined')
1245
- ? { register: () => {}, unregister: () => {} }
1246
- : new FinalizationRegistry(ptr => wasm.__wbg_savegameheader_free(ptr >>> 0, 1));
1233
+ if (Symbol.dispose) Replay.prototype[Symbol.dispose] = Replay.prototype.free;
1247
1234
 
1248
1235
  export class SavegameHeader {
1249
-
1250
1236
  static __wrap(ptr) {
1251
1237
  ptr = ptr >>> 0;
1252
1238
  const obj = Object.create(SavegameHeader.prototype);
@@ -1254,14 +1240,12 @@ export class SavegameHeader {
1254
1240
  SavegameHeaderFinalization.register(obj, obj.__wbg_ptr, obj);
1255
1241
  return obj;
1256
1242
  }
1257
-
1258
1243
  __destroy_into_raw() {
1259
1244
  const ptr = this.__wbg_ptr;
1260
1245
  this.__wbg_ptr = 0;
1261
1246
  SavegameHeaderFinalization.unregister(this);
1262
1247
  return ptr;
1263
1248
  }
1264
-
1265
1249
  free() {
1266
1250
  const ptr = this.__destroy_into_raw();
1267
1251
  wasm.__wbg_savegameheader_free(ptr, 0);
@@ -1372,13 +1356,9 @@ export class SavegameHeader {
1372
1356
  wasm.__wbg_set_savegameheader_replay(this.__wbg_ptr, ptr0);
1373
1357
  }
1374
1358
  }
1375
-
1376
- const SavegameSummaryFinalization = (typeof FinalizationRegistry === 'undefined')
1377
- ? { register: () => {}, unregister: () => {} }
1378
- : new FinalizationRegistry(ptr => wasm.__wbg_savegamesummary_free(ptr >>> 0, 1));
1359
+ if (Symbol.dispose) SavegameHeader.prototype[Symbol.dispose] = SavegameHeader.prototype.free;
1379
1360
 
1380
1361
  export class SavegameSummary {
1381
-
1382
1362
  static __wrap(ptr) {
1383
1363
  ptr = ptr >>> 0;
1384
1364
  const obj = Object.create(SavegameSummary.prototype);
@@ -1386,14 +1366,12 @@ export class SavegameSummary {
1386
1366
  SavegameSummaryFinalization.register(obj, obj.__wbg_ptr, obj);
1387
1367
  return obj;
1388
1368
  }
1389
-
1390
1369
  __destroy_into_raw() {
1391
1370
  const ptr = this.__wbg_ptr;
1392
1371
  this.__wbg_ptr = 0;
1393
1372
  SavegameSummaryFinalization.unregister(this);
1394
1373
  return ptr;
1395
1374
  }
1396
-
1397
1375
  free() {
1398
1376
  const ptr = this.__destroy_into_raw();
1399
1377
  wasm.__wbg_savegamesummary_free(ptr, 0);
@@ -1444,13 +1422,9 @@ export class SavegameSummary {
1444
1422
  wasm.__wbg_set_savegamesummary_duration(this.__wbg_ptr, arg0);
1445
1423
  }
1446
1424
  }
1447
-
1448
- const TeamFinalization = (typeof FinalizationRegistry === 'undefined')
1449
- ? { register: () => {}, unregister: () => {} }
1450
- : new FinalizationRegistry(ptr => wasm.__wbg_team_free(ptr >>> 0, 1));
1425
+ if (Symbol.dispose) SavegameSummary.prototype[Symbol.dispose] = SavegameSummary.prototype.free;
1451
1426
 
1452
1427
  export class Team {
1453
-
1454
1428
  static __wrap(ptr) {
1455
1429
  ptr = ptr >>> 0;
1456
1430
  const obj = Object.create(Team.prototype);
@@ -1458,21 +1432,18 @@ export class Team {
1458
1432
  TeamFinalization.register(obj, obj.__wbg_ptr, obj);
1459
1433
  return obj;
1460
1434
  }
1461
-
1462
1435
  static __unwrap(jsValue) {
1463
1436
  if (!(jsValue instanceof Team)) {
1464
1437
  return 0;
1465
1438
  }
1466
1439
  return jsValue.__destroy_into_raw();
1467
1440
  }
1468
-
1469
1441
  __destroy_into_raw() {
1470
1442
  const ptr = this.__wbg_ptr;
1471
1443
  this.__wbg_ptr = 0;
1472
1444
  TeamFinalization.unregister(this);
1473
1445
  return ptr;
1474
1446
  }
1475
-
1476
1447
  free() {
1477
1448
  const ptr = this.__destroy_into_raw();
1478
1449
  wasm.__wbg_team_free(ptr, 0);
@@ -1508,12 +1479,52 @@ export class Team {
1508
1479
  wasm.__wbg_set_team_players(this.__wbg_ptr, ptr0, len0);
1509
1480
  }
1510
1481
  }
1482
+ if (Symbol.dispose) Team.prototype[Symbol.dispose] = Team.prototype.free;
1483
+
1484
+ /**
1485
+ * @param {ArrayBuffer} buffer
1486
+ * @returns {any}
1487
+ */
1488
+ export function parse_rec(buffer) {
1489
+ const ret = wasm.parse_rec(buffer);
1490
+ return ret;
1491
+ }
1492
+
1493
+ /**
1494
+ * @param {ArrayBuffer} buffer
1495
+ * @returns {SavegameSummary}
1496
+ */
1497
+ export function parse_rec_summary(buffer) {
1498
+ const ret = wasm.parse_rec_summary(buffer);
1499
+ return SavegameSummary.__wrap(ret);
1500
+ }
1511
1501
 
1512
- export function __wbg_buffer_609cc3eee51ed158(arg0) {
1513
- const ret = arg0.buffer;
1502
+ export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
1503
+ const ret = Number(arg0);
1514
1504
  return ret;
1515
1505
  };
1516
1506
 
1507
+ export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
1508
+ const ret = debugString(arg1);
1509
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1510
+ const len1 = WASM_VECTOR_LEN;
1511
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1512
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1513
+ };
1514
+
1515
+ export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
1516
+ const obj = arg1;
1517
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1518
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1519
+ var len1 = WASM_VECTOR_LEN;
1520
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1521
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1522
+ };
1523
+
1524
+ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
1525
+ throw new Error(getStringFromWasm0(arg0, arg1));
1526
+ };
1527
+
1517
1528
  export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
1518
1529
  let deferred0_0;
1519
1530
  let deferred0_1;
@@ -1526,28 +1537,28 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
1526
1537
  }
1527
1538
  };
1528
1539
 
1529
- export function __wbg_length_a446193dc22c12f8(arg0) {
1540
+ export function __wbg_length_22ac23eaec9d8053(arg0) {
1530
1541
  const ret = arg0.length;
1531
1542
  return ret;
1532
1543
  };
1533
1544
 
1534
- export function __wbg_new_405e22f390576ce2() {
1545
+ export function __wbg_new_1ba21ce319a06297() {
1535
1546
  const ret = new Object();
1536
1547
  return ret;
1537
1548
  };
1538
1549
 
1539
- export function __wbg_new_78feb108b6472713() {
1550
+ export function __wbg_new_25f239778d6112b9() {
1540
1551
  const ret = new Array();
1541
1552
  return ret;
1542
1553
  };
1543
1554
 
1544
- export function __wbg_new_8a6f238a6ece86ea() {
1545
- const ret = new Error();
1555
+ export function __wbg_new_6421f6084cc5bc5a(arg0) {
1556
+ const ret = new Uint8Array(arg0);
1546
1557
  return ret;
1547
1558
  };
1548
1559
 
1549
- export function __wbg_new_a12002a7f91c75be(arg0) {
1550
- const ret = new Uint8Array(arg0);
1560
+ export function __wbg_new_8a6f238a6ece86ea() {
1561
+ const ret = new Error();
1551
1562
  return ret;
1552
1563
  };
1553
1564
 
@@ -1561,16 +1572,16 @@ export function __wbg_player_unwrap(arg0) {
1561
1572
  return ret;
1562
1573
  };
1563
1574
 
1564
- export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
1565
- arg0[arg1 >>> 0] = arg2;
1575
+ export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
1576
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1566
1577
  };
1567
1578
 
1568
1579
  export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
1569
1580
  arg0[arg1] = arg2;
1570
1581
  };
1571
1582
 
1572
- export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
1573
- arg0.set(arg1, arg2 >>> 0);
1583
+ export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
1584
+ arg0[arg1 >>> 0] = arg2;
1574
1585
  };
1575
1586
 
1576
1587
  export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
@@ -1591,55 +1602,24 @@ export function __wbg_team_unwrap(arg0) {
1591
1602
  return ret;
1592
1603
  };
1593
1604
 
1594
- export function __wbindgen_as_number(arg0) {
1595
- const ret = +arg0;
1605
+ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
1606
+ // Cast intrinsic for `Ref(String) -> Externref`.
1607
+ const ret = getStringFromWasm0(arg0, arg1);
1596
1608
  return ret;
1597
1609
  };
1598
1610
 
1599
- export function __wbindgen_debug_string(arg0, arg1) {
1600
- const ret = debugString(arg1);
1601
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1602
- const len1 = WASM_VECTOR_LEN;
1603
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1604
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1611
+ export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
1612
+ // Cast intrinsic for `F64 -> Externref`.
1613
+ const ret = arg0;
1614
+ return ret;
1605
1615
  };
1606
1616
 
1607
1617
  export function __wbindgen_init_externref_table() {
1608
- const table = wasm.__wbindgen_export_3;
1618
+ const table = wasm.__wbindgen_externrefs;
1609
1619
  const offset = table.grow(4);
1610
1620
  table.set(0, undefined);
1611
1621
  table.set(offset + 0, undefined);
1612
1622
  table.set(offset + 1, null);
1613
1623
  table.set(offset + 2, true);
1614
1624
  table.set(offset + 3, false);
1615
- ;
1616
- };
1617
-
1618
- export function __wbindgen_memory() {
1619
- const ret = wasm.memory;
1620
- return ret;
1621
1625
  };
1622
-
1623
- export function __wbindgen_number_new(arg0) {
1624
- const ret = arg0;
1625
- return ret;
1626
- };
1627
-
1628
- export function __wbindgen_string_get(arg0, arg1) {
1629
- const obj = arg1;
1630
- const ret = typeof(obj) === 'string' ? obj : undefined;
1631
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1632
- var len1 = WASM_VECTOR_LEN;
1633
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1634
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1635
- };
1636
-
1637
- export function __wbindgen_string_new(arg0, arg1) {
1638
- const ret = getStringFromWasm0(arg0, arg1);
1639
- return ret;
1640
- };
1641
-
1642
- export function __wbindgen_throw(arg0, arg1) {
1643
- throw new Error(getStringFromWasm0(arg0, arg1));
1644
- };
1645
-
Binary file
package/package.json CHANGED
@@ -5,8 +5,12 @@
5
5
  "Stéphane Bisinger <stephane@sbisinger.ch>"
6
6
  ],
7
7
  "description": "WASM version of aoe2rec to parse Age of Empires II: Definitive Edition recorded games in the browser",
8
- "version": "0.1.12",
8
+ "version": "0.1.19",
9
9
  "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/aoe2ct/aoe2rec"
13
+ },
10
14
  "files": [
11
15
  "aoe2rec_js_bg.wasm",
12
16
  "aoe2rec_js.js",