-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary_bindgen.js
More file actions
169 lines (146 loc) · 5.21 KB
/
Copy pathlibrary_bindgen.js
File metadata and controls
169 lines (146 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
addToLibrary({
$decodeText: function(ptr, len) {
return cachedTextDecoder.decode(HEAPU8.subarray(ptr, ptr + len));
},
$decodeText__deps: ['$cachedTextDecoder']
});
addToLibrary({
$getStringFromWasm0: function(ptr, len) {
return decodeText(ptr >>> 0, len);
},
$getStringFromWasm0__deps: ['$decodeText']
});
addToLibrary({
$wasm: "null",
$cachedTextDecoder: "new TextDecoder()",
});
addToLibrary({
__wbg___wbindgen_throw_1506f2235d1bdba0: function(arg0, arg1) {
throw new Error(getStringFromWasm0(arg0, arg1));
},
__wbg___wbindgen_throw_1506f2235d1bdba0__deps: ['$cachedTextDecoder', '$decodeText', '$getStringFromWasm0'],
});
addToLibrary({
__wbindgen_init_externref_table: function() {
const table = wasm.__wbindgen_externrefs;
const offset = table.grow(4);
table.set(0, undefined);
table.set(offset + 0, undefined);
table.set(offset + 1, null);
table.set(offset + 2, true);
table.set(offset + 3, false);
},
});
addToLibrary({
$initBindgen__deps: ['$addOnInit', '$cachedTextDecoder', '$decodeText', '$getStringFromWasm0', '$wasm'],
$initBindgen__postset: 'addOnInit(initBindgen);',
$initBindgen: () => {
wasm = wasmExports;
// Call emscripten's _initialize to run static constructors
// (needed for --no-entry builds)
if (wasmExports['_initialize']) {
wasmExports['_initialize']();
}
wasmExports.__wbindgen_start();
const PointFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_point_free(ptr, 1));
const RandomPointGeneratorRsFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_randompointgeneratorrs_free(ptr, 1));
/* @ts-self-types="./a.out.d.ts" */
class Point {
static __wrap(ptr) {
const obj = Object.create(Point.prototype);
obj.__wbg_ptr = ptr;
PointFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
PointFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_point_free(ptr, 0);
}
/**
* @returns {number}
*/
getX() {
const ret = wasm.point_getX(this.__wbg_ptr);
return ret;
}
/**
* @returns {number}
*/
getY() {
const ret = wasm.point_getY(this.__wbg_ptr);
return ret;
}
/**
* @param {number} x
* @param {number} y
*/
constructor(x, y) {
const ret = wasm.point_new(x, y);
this.__wbg_ptr = ret;
PointFinalization.register(this, this.__wbg_ptr, this);
return this;
}
}
if (Symbol.dispose) Point.prototype[Symbol.dispose] = Point.prototype.free;
Module.Point = Point;
class RandomPointGeneratorRs {
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
RandomPointGeneratorRsFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_randompointgeneratorrs_free(ptr, 0);
}
/**
* @returns {Point}
*/
getRandomPoint() {
const ret = wasm.randompointgeneratorrs_getRandomPoint(this.__wbg_ptr);
return Point.__wrap(ret);
}
/**
* @param {number} left
* @param {number} top
* @param {number} right
* @param {number} bottom
*/
constructor(left, top, right, bottom) {
const ret = wasm.randompointgeneratorrs_new(left, top, right, bottom);
this.__wbg_ptr = ret;
RandomPointGeneratorRsFinalization.register(this, this.__wbg_ptr, this);
return this;
}
}
if (Symbol.dispose) RandomPointGeneratorRs.prototype[Symbol.dispose] = RandomPointGeneratorRs.prototype.free;
Module.RandomPointGeneratorRs = RandomPointGeneratorRs;
/**
* @param {number} lower
* @param {number} upper
* @returns {number}
*/
/**
* @param {number} lower
* @param {number} upper
* @returns {number}
*/
function random_rs(lower, upper) {
const ret = wasm.random_rs(lower, upper);
return ret;
}
Module.random_rs = random_rs;
}
});
extraLibraryFuncs.push('$initBindgen', '$addOnInit', '$wasm', '$cachedTextDecoder');