@biomejs/wasm-nodejs 2.0.6 → 2.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/biome_wasm.d.ts +5261 -493
- package/biome_wasm.js +75 -0
- package/biome_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/biome_wasm.js
CHANGED
|
@@ -175,6 +175,19 @@ module.exports.main = function() {
|
|
|
175
175
|
wasm.main();
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
179
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
180
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
181
|
+
WASM_VECTOR_LEN = arg.length;
|
|
182
|
+
return ptr;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function _assertClass(instance, klass) {
|
|
186
|
+
if (!(instance instanceof klass)) {
|
|
187
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
178
191
|
function takeFromExternrefTable0(idx) {
|
|
179
192
|
const value = wasm.__wbindgen_export_4.get(idx);
|
|
180
193
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -255,12 +268,65 @@ class DiagnosticPrinter {
|
|
|
255
268
|
}
|
|
256
269
|
module.exports.DiagnosticPrinter = DiagnosticPrinter;
|
|
257
270
|
|
|
271
|
+
const MemoryFileSystemFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
272
|
+
? { register: () => {}, unregister: () => {} }
|
|
273
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_memoryfilesystem_free(ptr >>> 0, 1));
|
|
274
|
+
|
|
275
|
+
class MemoryFileSystem {
|
|
276
|
+
|
|
277
|
+
__destroy_into_raw() {
|
|
278
|
+
const ptr = this.__wbg_ptr;
|
|
279
|
+
this.__wbg_ptr = 0;
|
|
280
|
+
MemoryFileSystemFinalization.unregister(this);
|
|
281
|
+
return ptr;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
free() {
|
|
285
|
+
const ptr = this.__destroy_into_raw();
|
|
286
|
+
wasm.__wbg_memoryfilesystem_free(ptr, 0);
|
|
287
|
+
}
|
|
288
|
+
constructor() {
|
|
289
|
+
const ret = wasm.memoryfilesystem_new();
|
|
290
|
+
this.__wbg_ptr = ret >>> 0;
|
|
291
|
+
MemoryFileSystemFinalization.register(this, this.__wbg_ptr, this);
|
|
292
|
+
return this;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* @param {string} path
|
|
296
|
+
* @param {Uint8Array} data
|
|
297
|
+
*/
|
|
298
|
+
insert(path, data) {
|
|
299
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
300
|
+
const len0 = WASM_VECTOR_LEN;
|
|
301
|
+
const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
302
|
+
const len1 = WASM_VECTOR_LEN;
|
|
303
|
+
wasm.memoryfilesystem_insert(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* @param {string} path
|
|
307
|
+
*/
|
|
308
|
+
remove(path) {
|
|
309
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
310
|
+
const len0 = WASM_VECTOR_LEN;
|
|
311
|
+
wasm.memoryfilesystem_remove(this.__wbg_ptr, ptr0, len0);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
module.exports.MemoryFileSystem = MemoryFileSystem;
|
|
315
|
+
|
|
258
316
|
const WorkspaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
259
317
|
? { register: () => {}, unregister: () => {} }
|
|
260
318
|
: new FinalizationRegistry(ptr => wasm.__wbg_workspace_free(ptr >>> 0, 1));
|
|
261
319
|
|
|
262
320
|
class Workspace {
|
|
263
321
|
|
|
322
|
+
static __wrap(ptr) {
|
|
323
|
+
ptr = ptr >>> 0;
|
|
324
|
+
const obj = Object.create(Workspace.prototype);
|
|
325
|
+
obj.__wbg_ptr = ptr;
|
|
326
|
+
WorkspaceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
327
|
+
return obj;
|
|
328
|
+
}
|
|
329
|
+
|
|
264
330
|
__destroy_into_raw() {
|
|
265
331
|
const ptr = this.__wbg_ptr;
|
|
266
332
|
this.__wbg_ptr = 0;
|
|
@@ -278,6 +344,15 @@ class Workspace {
|
|
|
278
344
|
WorkspaceFinalization.register(this, this.__wbg_ptr, this);
|
|
279
345
|
return this;
|
|
280
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* @param {MemoryFileSystem} fs
|
|
349
|
+
* @returns {Workspace}
|
|
350
|
+
*/
|
|
351
|
+
static withFileSystem(fs) {
|
|
352
|
+
_assertClass(fs, MemoryFileSystem);
|
|
353
|
+
const ret = wasm.workspace_withFileSystem(fs.__wbg_ptr);
|
|
354
|
+
return Workspace.__wrap(ret);
|
|
355
|
+
}
|
|
281
356
|
/**
|
|
282
357
|
* @param {SupportsFeatureParams} params
|
|
283
358
|
* @returns {FileFeaturesResult}
|
package/biome_wasm_bg.wasm
CHANGED
|
Binary file
|