@kuncat/avoidant 0.1.0
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 +62 -0
- package/dist/assets/OpenSans-VariableFont_wdth,wght.ttf +0 -0
- package/dist/assets/favicon.svg +1 -0
- package/dist/components/AvoidantGame.svelte +814 -0
- package/dist/components/AvoidantGame.svelte.d.ts +6 -0
- package/dist/components/board.svelte +448 -0
- package/dist/components/board.svelte.d.ts +32 -0
- package/dist/components/fragment.glsl +98 -0
- package/dist/components/vertex.glsl +31 -0
- package/dist/generated/shared-constants.d.ts +6 -0
- package/dist/generated/shared-constants.js +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/styles/global.css +205 -0
- package/dist/vitest-examples/Welcome.svelte +8 -0
- package/dist/vitest-examples/Welcome.svelte.d.ts +13 -0
- package/dist/vitest-examples/greet.d.ts +1 -0
- package/dist/vitest-examples/greet.js +3 -0
- package/dist/wasm/LICENSE_APACHE +190 -0
- package/dist/wasm/LICENSE_MIT +25 -0
- package/dist/wasm/avoidant_wasm.d.ts +379 -0
- package/dist/wasm/avoidant_wasm.js +1851 -0
- package/dist/wasm/avoidant_wasm_bg.wasm +0 -0
- package/dist/wasm/avoidant_wasm_bg.wasm.d.ts +86 -0
- package/dist/wasm/package.json +26 -0
- package/dist/workers/mapgen-client.d.ts +7 -0
- package/dist/workers/mapgen-client.js +53 -0
- package/dist/workers/mapgen.worker.d.ts +18 -0
- package/dist/workers/mapgen.worker.js +41 -0
- package/package.json +86 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* The `ReadableStreamType` enum.
|
|
5
|
+
*
|
|
6
|
+
* *This API requires the following crate features to be activated: `ReadableStreamType`*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type ReadableStreamType = "bytes";
|
|
10
|
+
|
|
11
|
+
import type { Readable } from "svelte/store";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Flat per-vertex terrain mesh, decoupled from cell corners.
|
|
16
|
+
*
|
|
17
|
+
* `positions` is a `[x, y, z]`-packed `f32` array (length is a multiple of 9 (3 verts per triangle, 3 floats per vert). `normals` is `[nx, ny, nz]`) packed and parallel to `positions`; each vertex carries a smooth normal derived analytically from the noise field so the shader can per-pixel-interpolate it and avoid faceted flat shading. `cell_indices` carries the owning cell index for each emitted vertex (length = `positions.len() / 3`). Built once per map by [`crate::mapgen::generate_terrain_triangles`].
|
|
18
|
+
*/
|
|
19
|
+
export interface TerrainTriangles {
|
|
20
|
+
positions: number[];
|
|
21
|
+
normals: number[];
|
|
22
|
+
cellIndices: number[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Voronoi cell polygons paired with the subdivided terrain triangle mesh.
|
|
27
|
+
*/
|
|
28
|
+
export interface MapData {
|
|
29
|
+
cells: MapCell[];
|
|
30
|
+
terrain: TerrainTriangles;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CellMetadataEntry {
|
|
34
|
+
isExplored: boolean;
|
|
35
|
+
isVoid: boolean;
|
|
36
|
+
voidNeighborCount: number;
|
|
37
|
+
/**
|
|
38
|
+
* Toggled during a chord auto-reveal.
|
|
39
|
+
*/
|
|
40
|
+
isRevealing: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface GameOptions {
|
|
44
|
+
numCells: number;
|
|
45
|
+
rngSeed: number;
|
|
46
|
+
/**
|
|
47
|
+
* Iroh relay server URLs to use for peer discovery and transport.
|
|
48
|
+
*/
|
|
49
|
+
relayUrls?: string[];
|
|
50
|
+
maxSamples?: number;
|
|
51
|
+
slack?: number;
|
|
52
|
+
/**
|
|
53
|
+
* 0.0 = smooth broad hills, 1.0 = tight spiky features. Default: 0.4
|
|
54
|
+
*/
|
|
55
|
+
spikiness?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Minimum vertex height in world units. Default: -0.4
|
|
58
|
+
*/
|
|
59
|
+
elevationMin?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Maximum vertex height in world units. Default: 0.4
|
|
62
|
+
*/
|
|
63
|
+
elevationMax?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Per-cell terrain mesh subdivision level. Each fan triangle inside a cell is split into `S²` sub-triangles, sampling noise at every sub-vertex.
|
|
66
|
+
*/
|
|
67
|
+
terrainSubdivisions?: number;
|
|
68
|
+
voidFraction?: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface MapCell {
|
|
72
|
+
vertices: [number, number, number][];
|
|
73
|
+
neighbors: number[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface NetworkPeerStatus {
|
|
77
|
+
endpointId: string;
|
|
78
|
+
nickname?: string;
|
|
79
|
+
lastSeenMs?: number;
|
|
80
|
+
isConnected: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface NetworkSnapshot {
|
|
84
|
+
hasNode: boolean;
|
|
85
|
+
listenerStarted: boolean;
|
|
86
|
+
endpointId?: string;
|
|
87
|
+
topicId?: string;
|
|
88
|
+
peers: NetworkPeerStatus[];
|
|
89
|
+
lastInboundMutationMs?: number;
|
|
90
|
+
lastOutboundMutationMs?: number;
|
|
91
|
+
sampledAtMs: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface ScoreState {
|
|
95
|
+
/**
|
|
96
|
+
* Risk-balanced point total. May be negative.
|
|
97
|
+
*
|
|
98
|
+
* - Each non-void cell explored awards [`SAFE_REWARD`] points, multiplied by a streak multiplier that grows by [`STREAK_BONUS_PER_STEP`] per consecutive non-void cell explored (capped at [`STREAK_BONUS_CAP_STEPS`] steps).
|
|
99
|
+
* - Each void explore deducts a *risk-balanced* penalty equal to `reward * (1 - p) / p`, where `p` is the realized void fraction. This makes random clicking have an expected value of zero so positive scores reflect *information* the player applied, not map size.
|
|
100
|
+
* - Clearing every non-void cell awards a completion bonus equal to [`COMPLETION_BONUS_FRACTION`] of the non-void-only baseline.
|
|
101
|
+
*/
|
|
102
|
+
score: number;
|
|
103
|
+
/**
|
|
104
|
+
* Non-void cells explored so far.
|
|
105
|
+
*/
|
|
106
|
+
safeExplored: number;
|
|
107
|
+
/**
|
|
108
|
+
* Void cells explored so far (each large-penalized and ends the streak).
|
|
109
|
+
*/
|
|
110
|
+
voidExplored: number;
|
|
111
|
+
/**
|
|
112
|
+
* Current run of consecutive safe explores; resets to 0 on a void.
|
|
113
|
+
*/
|
|
114
|
+
streak: number;
|
|
115
|
+
/**
|
|
116
|
+
* Longest streak achieved during this game.
|
|
117
|
+
*/
|
|
118
|
+
bestStreak: number;
|
|
119
|
+
/**
|
|
120
|
+
* Total cells on the map.
|
|
121
|
+
*/
|
|
122
|
+
totalCells: number;
|
|
123
|
+
/**
|
|
124
|
+
* Void cell count.
|
|
125
|
+
*/
|
|
126
|
+
voidTotal: number;
|
|
127
|
+
/**
|
|
128
|
+
* True once every non-void cell has been explored.
|
|
129
|
+
*/
|
|
130
|
+
completed: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* `score / max_score`, in `[0, 1]`. Zero before the map has been generated or if the map contains no safe cells.
|
|
133
|
+
*/
|
|
134
|
+
efficiency: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
export class Channel {
|
|
139
|
+
private constructor();
|
|
140
|
+
free(): void;
|
|
141
|
+
[Symbol.dispose](): void;
|
|
142
|
+
id(): string;
|
|
143
|
+
neighbors(): string[];
|
|
144
|
+
ticket(opts: any): string;
|
|
145
|
+
readonly receiver: ReadableStream;
|
|
146
|
+
readonly sender: ChannelSender;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export class ChannelSender {
|
|
150
|
+
private constructor();
|
|
151
|
+
free(): void;
|
|
152
|
+
[Symbol.dispose](): void;
|
|
153
|
+
broadcast(text: string): Promise<void>;
|
|
154
|
+
set_nickame(nickname: string): void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export class GameState {
|
|
158
|
+
free(): void;
|
|
159
|
+
[Symbol.dispose](): void;
|
|
160
|
+
/**
|
|
161
|
+
* Apply cells produced off-thread (typically by the mapgen Web Worker).
|
|
162
|
+
*
|
|
163
|
+
* `cells` must be a JS array of objects matching the `MapCell` shape (i.e. `{ vertices: [[x, y, z], ...] }`).
|
|
164
|
+
*/
|
|
165
|
+
applyMapCells(cells: MapCell[]): MapCell[];
|
|
166
|
+
exploreCell(index: number, x: number, y: number, z: number): void;
|
|
167
|
+
invite(nickname: string): Promise<string>;
|
|
168
|
+
/**
|
|
169
|
+
* Spawn a network node and join the gossip topic described by `ticket`.
|
|
170
|
+
*
|
|
171
|
+
* The caller is responsible for having populated the map cells (typically
|
|
172
|
+
* via [`GameState::apply_map_cells`]) before invoking this; the function
|
|
173
|
+
* only concerns itself with bringing the network layer online.
|
|
174
|
+
*/
|
|
175
|
+
joinAsPeer(ticket: string, nickname: string): Promise<void>;
|
|
176
|
+
constructor(options: GameOptions);
|
|
177
|
+
static optionsFromTicket(ticket: string): GameOptions;
|
|
178
|
+
queueExplorePulse(index: number, x: number, y: number, z: number): void;
|
|
179
|
+
readonly cellMetadata: Readable<Array<CellMetadataEntry>>;
|
|
180
|
+
readonly cells: Readable<Array<MapCell>>;
|
|
181
|
+
readonly elevationMax: number;
|
|
182
|
+
readonly elevationMin: number;
|
|
183
|
+
readonly endpointId: string | undefined;
|
|
184
|
+
readonly hasNetworkNode: boolean;
|
|
185
|
+
readonly lastInboundMutationMs: number | undefined;
|
|
186
|
+
readonly lastOutboundMutationMs: number | undefined;
|
|
187
|
+
readonly networkListenerStarted: boolean;
|
|
188
|
+
readonly networkPeers: NetworkPeerStatus[];
|
|
189
|
+
readonly networkSnapshot: Readable<NetworkSnapshot>;
|
|
190
|
+
/**
|
|
191
|
+
* TODO(peer-join-sync): when peer-join state sync is implemented, the inviter should snapshot this store and send it alongside `cell_metadata` so a joining peer starts with the correct score, streak, and counters.
|
|
192
|
+
*/
|
|
193
|
+
readonly score: Readable<ScoreState>;
|
|
194
|
+
readonly topicId: string | undefined;
|
|
195
|
+
readonly uiState: UiState;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export class IntoUnderlyingByteSource {
|
|
199
|
+
private constructor();
|
|
200
|
+
free(): void;
|
|
201
|
+
[Symbol.dispose](): void;
|
|
202
|
+
cancel(): void;
|
|
203
|
+
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
204
|
+
start(controller: ReadableByteStreamController): void;
|
|
205
|
+
readonly autoAllocateChunkSize: number;
|
|
206
|
+
readonly type: ReadableStreamType;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export class IntoUnderlyingSink {
|
|
210
|
+
private constructor();
|
|
211
|
+
free(): void;
|
|
212
|
+
[Symbol.dispose](): void;
|
|
213
|
+
abort(reason: any): Promise<any>;
|
|
214
|
+
close(): Promise<any>;
|
|
215
|
+
write(chunk: any): Promise<any>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export class IntoUnderlyingSource {
|
|
219
|
+
private constructor();
|
|
220
|
+
free(): void;
|
|
221
|
+
[Symbol.dispose](): void;
|
|
222
|
+
cancel(): void;
|
|
223
|
+
pull(controller: ReadableStreamDefaultController): Promise<any>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export class NetworkNode {
|
|
227
|
+
private constructor();
|
|
228
|
+
free(): void;
|
|
229
|
+
[Symbol.dispose](): void;
|
|
230
|
+
create(nickname: string): Promise<Channel>;
|
|
231
|
+
/**
|
|
232
|
+
* Returns the endpoint id of this node.
|
|
233
|
+
*/
|
|
234
|
+
endpointId(): string;
|
|
235
|
+
join(ticket: string, nickname: string): Promise<Channel>;
|
|
236
|
+
/**
|
|
237
|
+
* Spawns a gossip node.
|
|
238
|
+
*/
|
|
239
|
+
static spawn(): Promise<NetworkNode>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export class Pulse {
|
|
243
|
+
private constructor();
|
|
244
|
+
free(): void;
|
|
245
|
+
[Symbol.dispose](): void;
|
|
246
|
+
static nullPulse(): Pulse;
|
|
247
|
+
readonly createdAtMs: number;
|
|
248
|
+
readonly durationMs: number;
|
|
249
|
+
readonly id: number;
|
|
250
|
+
readonly isRemote: boolean;
|
|
251
|
+
readonly maxRadius: number;
|
|
252
|
+
readonly originCell: number;
|
|
253
|
+
readonly position: Float64Array;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export class UiState {
|
|
257
|
+
private constructor();
|
|
258
|
+
free(): void;
|
|
259
|
+
[Symbol.dispose](): void;
|
|
260
|
+
readonly pulses: Readable<Array<Pulse>>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Build map cells and a subdivided terrain triangle mesh.
|
|
265
|
+
*/
|
|
266
|
+
export function generateMapData(options: GameOptions): MapData;
|
|
267
|
+
|
|
268
|
+
export function start(): void;
|
|
269
|
+
|
|
270
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
271
|
+
|
|
272
|
+
export interface InitOutput {
|
|
273
|
+
readonly memory: WebAssembly.Memory;
|
|
274
|
+
readonly __wbg_channel_free: (a: number, b: number) => void;
|
|
275
|
+
readonly __wbg_channelsender_free: (a: number, b: number) => void;
|
|
276
|
+
readonly __wbg_gamestate_free: (a: number, b: number) => void;
|
|
277
|
+
readonly __wbg_networknode_free: (a: number, b: number) => void;
|
|
278
|
+
readonly __wbg_pulse_free: (a: number, b: number) => void;
|
|
279
|
+
readonly __wbg_uistate_free: (a: number, b: number) => void;
|
|
280
|
+
readonly channel_id: (a: number) => [number, number];
|
|
281
|
+
readonly channel_neighbors: (a: number) => [number, number];
|
|
282
|
+
readonly channel_receiver: (a: number) => any;
|
|
283
|
+
readonly channel_sender: (a: number) => number;
|
|
284
|
+
readonly channel_ticket: (a: number, b: any) => [number, number, number, number];
|
|
285
|
+
readonly channelsender_broadcast: (a: number, b: number, c: number) => any;
|
|
286
|
+
readonly channelsender_set_nickame: (a: number, b: number, c: number) => void;
|
|
287
|
+
readonly gamestate_applyMapCells: (a: number, b: any) => [number, number, number];
|
|
288
|
+
readonly gamestate_cellMetadata: (a: number) => any;
|
|
289
|
+
readonly gamestate_cells: (a: number) => any;
|
|
290
|
+
readonly gamestate_endpointId: (a: number) => [number, number];
|
|
291
|
+
readonly gamestate_exploreCell: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
292
|
+
readonly gamestate_hasNetworkNode: (a: number) => number;
|
|
293
|
+
readonly gamestate_invite: (a: number, b: number, c: number) => any;
|
|
294
|
+
readonly gamestate_joinAsPeer: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
295
|
+
readonly gamestate_lastInboundMutationMs: (a: number) => [number, number];
|
|
296
|
+
readonly gamestate_lastOutboundMutationMs: (a: number) => [number, number];
|
|
297
|
+
readonly gamestate_networkListenerStarted: (a: number) => number;
|
|
298
|
+
readonly gamestate_networkPeers: (a: number) => [number, number];
|
|
299
|
+
readonly gamestate_networkSnapshot: (a: number) => any;
|
|
300
|
+
readonly gamestate_new: (a: any) => [number, number, number];
|
|
301
|
+
readonly gamestate_optionsFromTicket: (a: number, b: number) => [number, number, number];
|
|
302
|
+
readonly gamestate_queueExplorePulse: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
303
|
+
readonly gamestate_score: (a: number) => any;
|
|
304
|
+
readonly gamestate_topicId: (a: number) => [number, number];
|
|
305
|
+
readonly gamestate_uiState: (a: number) => number;
|
|
306
|
+
readonly generateMapData: (a: any) => [number, number, number];
|
|
307
|
+
readonly networknode_create: (a: number, b: number, c: number) => any;
|
|
308
|
+
readonly networknode_endpointId: (a: number) => [number, number];
|
|
309
|
+
readonly networknode_join: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
310
|
+
readonly networknode_spawn: () => any;
|
|
311
|
+
readonly pulse_durationMs: (a: number) => number;
|
|
312
|
+
readonly pulse_id: (a: number) => number;
|
|
313
|
+
readonly pulse_isRemote: (a: number) => number;
|
|
314
|
+
readonly pulse_nullPulse: () => number;
|
|
315
|
+
readonly pulse_originCell: (a: number) => number;
|
|
316
|
+
readonly pulse_position: (a: number) => [number, number];
|
|
317
|
+
readonly start: () => void;
|
|
318
|
+
readonly uistate_pulses: (a: number) => any;
|
|
319
|
+
readonly gamestate_elevationMax: (a: number) => number;
|
|
320
|
+
readonly gamestate_elevationMin: (a: number) => number;
|
|
321
|
+
readonly pulse_createdAtMs: (a: number) => number;
|
|
322
|
+
readonly pulse_maxRadius: (a: number) => number;
|
|
323
|
+
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
324
|
+
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
325
|
+
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
326
|
+
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
327
|
+
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
328
|
+
readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
|
|
329
|
+
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
330
|
+
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
331
|
+
readonly intounderlyingsink_abort: (a: number, b: any) => any;
|
|
332
|
+
readonly intounderlyingsink_close: (a: number) => any;
|
|
333
|
+
readonly intounderlyingsink_write: (a: number, b: any) => any;
|
|
334
|
+
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
335
|
+
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
|
336
|
+
readonly ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
337
|
+
readonly wasm_bindgen__convert__closures_____invoke__h00c6858f5875acdf: (a: number, b: number, c: any) => [number, number];
|
|
338
|
+
readonly wasm_bindgen__convert__closures_____invoke__h299fd98c162ada8d: (a: number, b: number, c: any, d: any) => void;
|
|
339
|
+
readonly wasm_bindgen__convert__closures_____invoke__h1d3d8bbcf4bb9647: (a: number, b: number, c: any) => any;
|
|
340
|
+
readonly wasm_bindgen__convert__closures_____invoke__h364282c46f736e9f: (a: number, b: number, c: any) => void;
|
|
341
|
+
readonly wasm_bindgen__convert__closures_____invoke__h104a0d4c5facca10: (a: number, b: number, c: any) => void;
|
|
342
|
+
readonly wasm_bindgen__convert__closures_____invoke__h3ed8ec9c74648bb3: (a: number, b: number, c: any) => void;
|
|
343
|
+
readonly wasm_bindgen__convert__closures_____invoke__hac60de05c959eab5: (a: number, b: number) => void;
|
|
344
|
+
readonly wasm_bindgen__convert__closures_____invoke__h863ae91844dca7d2: (a: number, b: number) => void;
|
|
345
|
+
readonly wasm_bindgen__convert__closures_____invoke__h9480bdc51ff47b2e: (a: number, b: number) => void;
|
|
346
|
+
readonly wasm_bindgen__convert__closures_____invoke__ha30834eb04ba8562: (a: number, b: number) => void;
|
|
347
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
348
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
349
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
350
|
+
readonly __externref_table_alloc: () => number;
|
|
351
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
352
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
353
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
354
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
355
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
356
|
+
readonly __wbindgen_start: () => void;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
363
|
+
* a precompiled `WebAssembly.Module`.
|
|
364
|
+
*
|
|
365
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
366
|
+
*
|
|
367
|
+
* @returns {InitOutput}
|
|
368
|
+
*/
|
|
369
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
373
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
374
|
+
*
|
|
375
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
376
|
+
*
|
|
377
|
+
* @returns {Promise<InitOutput>}
|
|
378
|
+
*/
|
|
379
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|