mons-web 0.1.6 → 0.1.8
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/README.md +6 -2
- package/mons_rust.d.ts +35 -0
- package/mons_rust.js +74 -9
- package/mons_rust_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/mons_rust.d.ts
CHANGED
|
@@ -12,11 +12,46 @@ export function hello(): string;
|
|
|
12
12
|
* @returns {string}
|
|
13
13
|
*/
|
|
14
14
|
export function winner(fen_w: string, fen_b: string, flat_moves_string_w: string, flat_moves_string_b: string): string;
|
|
15
|
+
/**
|
|
16
|
+
*/
|
|
17
|
+
export enum Modifier {
|
|
18
|
+
SelectPotion = 0,
|
|
19
|
+
SelectBomb = 1,
|
|
20
|
+
Cancel = 2,
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
*/
|
|
24
|
+
export enum Color {
|
|
25
|
+
White = 0,
|
|
26
|
+
Black = 1,
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
*/
|
|
30
|
+
export class Location {
|
|
31
|
+
free(): void;
|
|
32
|
+
/**
|
|
33
|
+
* @param {number} i
|
|
34
|
+
* @param {number} j
|
|
35
|
+
*/
|
|
36
|
+
constructor(i: number, j: number);
|
|
37
|
+
/**
|
|
38
|
+
*/
|
|
39
|
+
i: number;
|
|
40
|
+
/**
|
|
41
|
+
*/
|
|
42
|
+
j: number;
|
|
43
|
+
}
|
|
15
44
|
|
|
16
45
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
17
46
|
|
|
18
47
|
export interface InitOutput {
|
|
19
48
|
readonly memory: WebAssembly.Memory;
|
|
49
|
+
readonly __wbg_location_free: (a: number) => void;
|
|
50
|
+
readonly __wbg_get_location_i: (a: number) => number;
|
|
51
|
+
readonly __wbg_set_location_i: (a: number, b: number) => void;
|
|
52
|
+
readonly __wbg_get_location_j: (a: number) => number;
|
|
53
|
+
readonly __wbg_set_location_j: (a: number, b: number) => void;
|
|
54
|
+
readonly location_new: (a: number, b: number) => number;
|
|
20
55
|
readonly hello: (a: number) => void;
|
|
21
56
|
readonly winner: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
22
57
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
package/mons_rust.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
let cachedInt32Memory0 = null;
|
|
4
|
-
|
|
5
|
-
function getInt32Memory0() {
|
|
6
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
7
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
8
|
-
}
|
|
9
|
-
return cachedInt32Memory0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
3
|
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
13
4
|
|
|
14
5
|
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
@@ -26,6 +17,15 @@ function getStringFromWasm0(ptr, len) {
|
|
|
26
17
|
ptr = ptr >>> 0;
|
|
27
18
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
28
19
|
}
|
|
20
|
+
|
|
21
|
+
let cachedInt32Memory0 = null;
|
|
22
|
+
|
|
23
|
+
function getInt32Memory0() {
|
|
24
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
25
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
26
|
+
}
|
|
27
|
+
return cachedInt32Memory0;
|
|
28
|
+
}
|
|
29
29
|
/**
|
|
30
30
|
* @returns {string}
|
|
31
31
|
*/
|
|
@@ -133,6 +133,68 @@ export function winner(fen_w, fen_b, flat_moves_string_w, flat_moves_string_b) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
/**
|
|
137
|
+
*/
|
|
138
|
+
export const Modifier = Object.freeze({ SelectPotion:0,"0":"SelectPotion",SelectBomb:1,"1":"SelectBomb",Cancel:2,"2":"Cancel", });
|
|
139
|
+
/**
|
|
140
|
+
*/
|
|
141
|
+
export const Color = Object.freeze({ White:0,"0":"White",Black:1,"1":"Black", });
|
|
142
|
+
|
|
143
|
+
const LocationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
144
|
+
? { register: () => {}, unregister: () => {} }
|
|
145
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_location_free(ptr >>> 0));
|
|
146
|
+
/**
|
|
147
|
+
*/
|
|
148
|
+
export class Location {
|
|
149
|
+
|
|
150
|
+
__destroy_into_raw() {
|
|
151
|
+
const ptr = this.__wbg_ptr;
|
|
152
|
+
this.__wbg_ptr = 0;
|
|
153
|
+
LocationFinalization.unregister(this);
|
|
154
|
+
return ptr;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
free() {
|
|
158
|
+
const ptr = this.__destroy_into_raw();
|
|
159
|
+
wasm.__wbg_location_free(ptr);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @returns {number}
|
|
163
|
+
*/
|
|
164
|
+
get i() {
|
|
165
|
+
const ret = wasm.__wbg_get_location_i(this.__wbg_ptr);
|
|
166
|
+
return ret;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* @param {number} arg0
|
|
170
|
+
*/
|
|
171
|
+
set i(arg0) {
|
|
172
|
+
wasm.__wbg_set_location_i(this.__wbg_ptr, arg0);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* @returns {number}
|
|
176
|
+
*/
|
|
177
|
+
get j() {
|
|
178
|
+
const ret = wasm.__wbg_get_location_j(this.__wbg_ptr);
|
|
179
|
+
return ret;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @param {number} arg0
|
|
183
|
+
*/
|
|
184
|
+
set j(arg0) {
|
|
185
|
+
wasm.__wbg_set_location_j(this.__wbg_ptr, arg0);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* @param {number} i
|
|
189
|
+
* @param {number} j
|
|
190
|
+
*/
|
|
191
|
+
constructor(i, j) {
|
|
192
|
+
const ret = wasm.location_new(i, j);
|
|
193
|
+
this.__wbg_ptr = ret >>> 0;
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
136
198
|
async function __wbg_load(module, imports) {
|
|
137
199
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
138
200
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -167,6 +229,9 @@ async function __wbg_load(module, imports) {
|
|
|
167
229
|
function __wbg_get_imports() {
|
|
168
230
|
const imports = {};
|
|
169
231
|
imports.wbg = {};
|
|
232
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
233
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
234
|
+
};
|
|
170
235
|
|
|
171
236
|
return imports;
|
|
172
237
|
}
|
package/mons_rust_bg.wasm
CHANGED
|
Binary file
|