@ricsam/quickjs-test-utils 0.0.1 → 1.0.1

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.
Files changed (49) hide show
  1. package/README.md +97 -43
  2. package/dist/cjs/context.cjs +86 -0
  3. package/dist/cjs/context.cjs.map +10 -0
  4. package/dist/cjs/eval.cjs +69 -0
  5. package/dist/cjs/eval.cjs.map +10 -0
  6. package/dist/cjs/fetch-context.cjs +89 -0
  7. package/dist/cjs/fetch-context.cjs.map +10 -0
  8. package/dist/cjs/fs-context.cjs +54 -0
  9. package/dist/cjs/fs-context.cjs.map +10 -0
  10. package/dist/cjs/index.cjs +58 -0
  11. package/dist/cjs/index.cjs.map +10 -0
  12. package/dist/cjs/integration-server.cjs +137 -0
  13. package/dist/cjs/integration-server.cjs.map +10 -0
  14. package/dist/cjs/package.json +5 -0
  15. package/dist/cjs/quickjs-types.cjs +700 -0
  16. package/dist/cjs/quickjs-types.cjs.map +10 -0
  17. package/dist/cjs/runtime-context.cjs +55 -0
  18. package/dist/cjs/runtime-context.cjs.map +10 -0
  19. package/dist/cjs/typecheck.cjs +108 -0
  20. package/dist/cjs/typecheck.cjs.map +10 -0
  21. package/dist/mjs/context.mjs +61 -0
  22. package/dist/mjs/context.mjs.map +10 -0
  23. package/dist/mjs/eval.mjs +38 -0
  24. package/dist/mjs/eval.mjs.map +10 -0
  25. package/dist/mjs/fetch-context.mjs +61 -0
  26. package/dist/mjs/fetch-context.mjs.map +10 -0
  27. package/dist/mjs/fs-context.mjs +29 -0
  28. package/dist/mjs/fs-context.mjs.map +10 -0
  29. package/dist/mjs/index.mjs +45 -0
  30. package/dist/mjs/index.mjs.map +10 -0
  31. package/dist/mjs/integration-server.mjs +106 -0
  32. package/dist/mjs/integration-server.mjs.map +10 -0
  33. package/dist/mjs/package.json +5 -0
  34. package/dist/mjs/quickjs-types.mjs +669 -0
  35. package/dist/mjs/quickjs-types.mjs.map +10 -0
  36. package/dist/mjs/runtime-context.mjs +26 -0
  37. package/dist/mjs/runtime-context.mjs.map +10 -0
  38. package/dist/mjs/typecheck.mjs +77 -0
  39. package/dist/mjs/typecheck.mjs.map +10 -0
  40. package/dist/types/context.d.ts +35 -0
  41. package/dist/types/eval.d.ts +31 -0
  42. package/dist/types/fetch-context.d.ts +41 -0
  43. package/dist/types/fs-context.d.ts +12 -0
  44. package/dist/types/index.d.ts +6 -0
  45. package/dist/types/integration-server.d.ts +39 -0
  46. package/dist/types/quickjs-types.d.ts +42 -0
  47. package/dist/types/runtime-context.d.ts +9 -0
  48. package/dist/types/typecheck.d.ts +115 -0
  49. package/package.json +62 -6
@@ -0,0 +1,669 @@
1
+ // @bun
2
+ // packages/test-utils/src/quickjs-types.ts
3
+ var CORE_TYPES = `/**
4
+ * QuickJS Global Type Definitions for @ricsam/quickjs-core
5
+ *
6
+ * These types define the globals injected by setupCore() into a QuickJS context.
7
+ * Use these types to typecheck user code that will run inside QuickJS.
8
+ *
9
+ * @example
10
+ * // In your tsconfig.quickjs.json
11
+ * {
12
+ * "compilerOptions": {
13
+ * "lib": ["ESNext", "DOM"]
14
+ * }
15
+ * }
16
+ *
17
+ * // Then reference this file or use ts-morph for code strings
18
+ */
19
+
20
+ export {};
21
+
22
+ declare global {
23
+ // ============================================
24
+ // Web Streams API
25
+ // ============================================
26
+
27
+ /**
28
+ * A readable stream of data.
29
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
30
+ */
31
+ const ReadableStream: typeof globalThis.ReadableStream;
32
+
33
+ /**
34
+ * A writable stream of data.
35
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/WritableStream
36
+ */
37
+ const WritableStream: typeof globalThis.WritableStream;
38
+
39
+ /**
40
+ * A transform stream that can be used to pipe data through a transformer.
41
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/TransformStream
42
+ */
43
+ const TransformStream: typeof globalThis.TransformStream;
44
+
45
+ /**
46
+ * Default reader for ReadableStream
47
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader
48
+ */
49
+ const ReadableStreamDefaultReader: typeof globalThis.ReadableStreamDefaultReader;
50
+
51
+ /**
52
+ * Default writer for WritableStream
53
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter
54
+ */
55
+ const WritableStreamDefaultWriter: typeof globalThis.WritableStreamDefaultWriter;
56
+
57
+ // ============================================
58
+ // Blob and File APIs
59
+ // ============================================
60
+
61
+ /**
62
+ * A file-like object of immutable, raw data.
63
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Blob
64
+ */
65
+ const Blob: typeof globalThis.Blob;
66
+
67
+ /**
68
+ * A file object representing a file.
69
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/File
70
+ */
71
+ const File: typeof globalThis.File;
72
+
73
+ // ============================================
74
+ // URL APIs
75
+ // ============================================
76
+
77
+ /**
78
+ * Interface for URL manipulation.
79
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/URL
80
+ */
81
+ const URL: typeof globalThis.URL;
82
+
83
+ /**
84
+ * Utility for working with URL query strings.
85
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
86
+ */
87
+ const URLSearchParams: typeof globalThis.URLSearchParams;
88
+
89
+ // ============================================
90
+ // Error Handling
91
+ // ============================================
92
+
93
+ /**
94
+ * Exception type for DOM operations.
95
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMException
96
+ */
97
+ const DOMException: typeof globalThis.DOMException;
98
+ }
99
+ `;
100
+ var FETCH_TYPES = `/**
101
+ * QuickJS Global Type Definitions for @ricsam/quickjs-fetch
102
+ *
103
+ * These types define the globals injected by setupFetch() into a QuickJS context.
104
+ * Use these types to typecheck user code that will run inside QuickJS.
105
+ *
106
+ * @example
107
+ * // Typecheck QuickJS code with serve()
108
+ * serve({
109
+ * fetch(request, server) {
110
+ * if (request.url.includes("/ws")) {
111
+ * server.upgrade(request, { data: { id: 123 } });
112
+ * return new Response(null, { status: 101 });
113
+ * }
114
+ * return new Response("Hello!");
115
+ * },
116
+ * websocket: {
117
+ * message(ws, message) {
118
+ * ws.send("Echo: " + message);
119
+ * }
120
+ * }
121
+ * });
122
+ */
123
+
124
+ export {};
125
+
126
+ declare global {
127
+ // ============================================
128
+ // Standard Fetch API (from lib.dom)
129
+ // ============================================
130
+
131
+ /**
132
+ * Headers class for HTTP headers manipulation.
133
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Headers
134
+ */
135
+ const Headers: typeof globalThis.Headers;
136
+
137
+ /**
138
+ * Request class for HTTP requests.
139
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Request
140
+ */
141
+ const Request: typeof globalThis.Request;
142
+
143
+ /**
144
+ * Response class for HTTP responses.
145
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Response
146
+ */
147
+ const Response: typeof globalThis.Response;
148
+
149
+ /**
150
+ * AbortController for cancelling fetch requests.
151
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortController
152
+ */
153
+ const AbortController: typeof globalThis.AbortController;
154
+
155
+ /**
156
+ * AbortSignal for listening to abort events.
157
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
158
+ */
159
+ const AbortSignal: typeof globalThis.AbortSignal;
160
+
161
+ /**
162
+ * FormData for constructing form data.
163
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/FormData
164
+ */
165
+ const FormData: typeof globalThis.FormData;
166
+
167
+ /**
168
+ * Fetch function for making HTTP requests.
169
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/fetch
170
+ */
171
+ function fetch(
172
+ input: RequestInfo | URL,
173
+ init?: RequestInit
174
+ ): Promise<Response>;
175
+
176
+ // ============================================
177
+ // QuickJS-specific: serve() API
178
+ // ============================================
179
+
180
+ /**
181
+ * Server interface for handling WebSocket upgrades within serve() handlers.
182
+ */
183
+ interface Server {
184
+ /**
185
+ * Upgrade an HTTP request to a WebSocket connection.
186
+ *
187
+ * @param request - The incoming HTTP request to upgrade
188
+ * @param options - Optional data to associate with the WebSocket connection
189
+ * @returns true if upgrade will proceed, false otherwise
190
+ *
191
+ * @example
192
+ * serve({
193
+ * fetch(request, server) {
194
+ * if (server.upgrade(request, { data: { userId: 123 } })) {
195
+ * return new Response(null, { status: 101 });
196
+ * }
197
+ * return new Response("Upgrade failed", { status: 400 });
198
+ * }
199
+ * });
200
+ */
201
+ upgrade(request: Request, options?: { data?: unknown }): boolean;
202
+ }
203
+
204
+ /**
205
+ * ServerWebSocket interface for WebSocket connections within serve() handlers.
206
+ *
207
+ * @typeParam T - The type of data associated with this WebSocket connection
208
+ */
209
+ interface ServerWebSocket<T = unknown> {
210
+ /**
211
+ * User data associated with this connection.
212
+ * Set via \`server.upgrade(request, { data: ... })\`.
213
+ */
214
+ readonly data: T;
215
+
216
+ /**
217
+ * Send a message to the client.
218
+ *
219
+ * @param message - The message to send (string, ArrayBuffer, or Uint8Array)
220
+ */
221
+ send(message: string | ArrayBuffer | Uint8Array): void;
222
+
223
+ /**
224
+ * Close the WebSocket connection.
225
+ *
226
+ * @param code - Optional close code (default: 1000)
227
+ * @param reason - Optional close reason
228
+ */
229
+ close(code?: number, reason?: string): void;
230
+
231
+ /**
232
+ * WebSocket ready state.
233
+ * - 0: CONNECTING
234
+ * - 1: OPEN
235
+ * - 2: CLOSING
236
+ * - 3: CLOSED
237
+ */
238
+ readonly readyState: number;
239
+ }
240
+
241
+ /**
242
+ * Options for the serve() function.
243
+ *
244
+ * @typeParam T - The type of data associated with WebSocket connections
245
+ */
246
+ interface ServeOptions<T = unknown> {
247
+ /**
248
+ * Handler for HTTP requests.
249
+ *
250
+ * @param request - The incoming HTTP request
251
+ * @param server - Server interface for WebSocket upgrades
252
+ * @returns Response or Promise resolving to Response
253
+ */
254
+ fetch(request: Request, server: Server): Response | Promise<Response>;
255
+
256
+ /**
257
+ * WebSocket event handlers.
258
+ */
259
+ websocket?: {
260
+ /**
261
+ * Called when a WebSocket connection is opened.
262
+ *
263
+ * @param ws - The WebSocket connection
264
+ */
265
+ open?(ws: ServerWebSocket<T>): void | Promise<void>;
266
+
267
+ /**
268
+ * Called when a message is received.
269
+ *
270
+ * @param ws - The WebSocket connection
271
+ * @param message - The received message (string or ArrayBuffer)
272
+ */
273
+ message?(
274
+ ws: ServerWebSocket<T>,
275
+ message: string | ArrayBuffer
276
+ ): void | Promise<void>;
277
+
278
+ /**
279
+ * Called when the connection is closed.
280
+ *
281
+ * @param ws - The WebSocket connection
282
+ * @param code - The close code
283
+ * @param reason - The close reason
284
+ */
285
+ close?(
286
+ ws: ServerWebSocket<T>,
287
+ code: number,
288
+ reason: string
289
+ ): void | Promise<void>;
290
+
291
+ /**
292
+ * Called when an error occurs.
293
+ *
294
+ * @param ws - The WebSocket connection
295
+ * @param error - The error that occurred
296
+ */
297
+ error?(ws: ServerWebSocket<T>, error: Error): void | Promise<void>;
298
+ };
299
+ }
300
+
301
+ /**
302
+ * Register an HTTP server handler in QuickJS.
303
+ *
304
+ * Only one serve() handler can be active at a time.
305
+ * Calling serve() again replaces the previous handler.
306
+ *
307
+ * @param options - Server configuration including fetch handler and optional WebSocket handlers
308
+ *
309
+ * @example
310
+ * serve({
311
+ * fetch(request, server) {
312
+ * const url = new URL(request.url);
313
+ *
314
+ * if (url.pathname === "/ws") {
315
+ * if (server.upgrade(request, { data: { connectedAt: Date.now() } })) {
316
+ * return new Response(null, { status: 101 });
317
+ * }
318
+ * }
319
+ *
320
+ * if (url.pathname === "/api/hello") {
321
+ * return Response.json({ message: "Hello!" });
322
+ * }
323
+ *
324
+ * return new Response("Not Found", { status: 404 });
325
+ * },
326
+ * websocket: {
327
+ * open(ws) {
328
+ * console.log("Connected at:", ws.data.connectedAt);
329
+ * },
330
+ * message(ws, message) {
331
+ * ws.send("Echo: " + message);
332
+ * },
333
+ * close(ws, code, reason) {
334
+ * console.log("Closed:", code, reason);
335
+ * }
336
+ * }
337
+ * });
338
+ */
339
+ function serve<T = unknown>(options: ServeOptions<T>): void;
340
+ }
341
+ `;
342
+ var FS_TYPES = `/**
343
+ * QuickJS Global Type Definitions for @ricsam/quickjs-fs
344
+ *
345
+ * These types define the globals injected by setupFs() into a QuickJS context.
346
+ * Use these types to typecheck user code that will run inside QuickJS.
347
+ *
348
+ * @example
349
+ * // Typecheck QuickJS code with file system access
350
+ * const root = await fs.getDirectory("/data");
351
+ * const fileHandle = await root.getFileHandle("config.json");
352
+ * const file = await fileHandle.getFile();
353
+ * const content = await file.text();
354
+ */
355
+
356
+ export {};
357
+
358
+ declare global {
359
+ // ============================================
360
+ // fs namespace - QuickJS-specific entry point
361
+ // ============================================
362
+
363
+ /**
364
+ * File System namespace providing access to the file system.
365
+ * This is the QuickJS-specific entry point (differs from browser's navigator.storage.getDirectory()).
366
+ */
367
+ namespace fs {
368
+ /**
369
+ * Get a directory handle for the given path.
370
+ *
371
+ * The host controls which paths are accessible. Invalid or unauthorized
372
+ * paths will throw an error.
373
+ *
374
+ * @param path - The path to request from the host
375
+ * @returns A promise resolving to a directory handle
376
+ * @throws If the path is not allowed or doesn't exist
377
+ *
378
+ * @example
379
+ * const root = await fs.getDirectory("/");
380
+ * const dataDir = await fs.getDirectory("/data");
381
+ */
382
+ function getDirectory(path: string): Promise<FileSystemDirectoryHandle>;
383
+ }
384
+
385
+ // ============================================
386
+ // File System Access API
387
+ // ============================================
388
+
389
+ /**
390
+ * Base interface for file system handles.
391
+ */
392
+ interface FileSystemHandle {
393
+ /**
394
+ * The kind of handle: "file" or "directory".
395
+ */
396
+ readonly kind: "file" | "directory";
397
+
398
+ /**
399
+ * The name of the file or directory.
400
+ */
401
+ readonly name: string;
402
+
403
+ /**
404
+ * Compare two handles to check if they reference the same entry.
405
+ *
406
+ * @param other - Another FileSystemHandle to compare against
407
+ * @returns true if both handles reference the same entry
408
+ */
409
+ isSameEntry(other: FileSystemHandle): Promise<boolean>;
410
+ }
411
+
412
+ /**
413
+ * Handle for a file in the file system.
414
+ */
415
+ interface FileSystemFileHandle extends FileSystemHandle {
416
+ /**
417
+ * Always "file" for file handles.
418
+ */
419
+ readonly kind: "file";
420
+
421
+ /**
422
+ * Get the file contents as a File object.
423
+ *
424
+ * @returns A promise resolving to a File object
425
+ *
426
+ * @example
427
+ * const file = await fileHandle.getFile();
428
+ * const text = await file.text();
429
+ */
430
+ getFile(): Promise<File>;
431
+
432
+ /**
433
+ * Create a writable stream for writing to the file.
434
+ *
435
+ * @param options - Options for the writable stream
436
+ * @returns A promise resolving to a writable stream
437
+ *
438
+ * @example
439
+ * const writable = await fileHandle.createWritable();
440
+ * await writable.write("Hello, World!");
441
+ * await writable.close();
442
+ */
443
+ createWritable(options?: {
444
+ /**
445
+ * If true, keeps existing file data. Otherwise, truncates the file.
446
+ */
447
+ keepExistingData?: boolean;
448
+ }): Promise<FileSystemWritableFileStream>;
449
+ }
450
+
451
+ /**
452
+ * Handle for a directory in the file system.
453
+ */
454
+ interface FileSystemDirectoryHandle extends FileSystemHandle {
455
+ /**
456
+ * Always "directory" for directory handles.
457
+ */
458
+ readonly kind: "directory";
459
+
460
+ /**
461
+ * Get a file handle within this directory.
462
+ *
463
+ * @param name - The name of the file
464
+ * @param options - Options for getting the file handle
465
+ * @returns A promise resolving to a file handle
466
+ * @throws If the file doesn't exist and create is not true
467
+ *
468
+ * @example
469
+ * const file = await dir.getFileHandle("data.json");
470
+ * const newFile = await dir.getFileHandle("output.txt", { create: true });
471
+ */
472
+ getFileHandle(
473
+ name: string,
474
+ options?: {
475
+ /**
476
+ * If true, creates the file if it doesn't exist.
477
+ */
478
+ create?: boolean;
479
+ }
480
+ ): Promise<FileSystemFileHandle>;
481
+
482
+ /**
483
+ * Get a subdirectory handle within this directory.
484
+ *
485
+ * @param name - The name of the subdirectory
486
+ * @param options - Options for getting the directory handle
487
+ * @returns A promise resolving to a directory handle
488
+ * @throws If the directory doesn't exist and create is not true
489
+ *
490
+ * @example
491
+ * const subdir = await dir.getDirectoryHandle("logs");
492
+ * const newDir = await dir.getDirectoryHandle("cache", { create: true });
493
+ */
494
+ getDirectoryHandle(
495
+ name: string,
496
+ options?: {
497
+ /**
498
+ * If true, creates the directory if it doesn't exist.
499
+ */
500
+ create?: boolean;
501
+ }
502
+ ): Promise<FileSystemDirectoryHandle>;
503
+
504
+ /**
505
+ * Remove a file or directory within this directory.
506
+ *
507
+ * @param name - The name of the entry to remove
508
+ * @param options - Options for removal
509
+ * @throws If the entry doesn't exist or cannot be removed
510
+ *
511
+ * @example
512
+ * await dir.removeEntry("old-file.txt");
513
+ * await dir.removeEntry("old-dir", { recursive: true });
514
+ */
515
+ removeEntry(
516
+ name: string,
517
+ options?: {
518
+ /**
519
+ * If true, removes directories recursively.
520
+ */
521
+ recursive?: boolean;
522
+ }
523
+ ): Promise<void>;
524
+
525
+ /**
526
+ * Resolve the path from this directory to a descendant handle.
527
+ *
528
+ * @param possibleDescendant - A handle that may be a descendant
529
+ * @returns An array of path segments, or null if not a descendant
530
+ *
531
+ * @example
532
+ * const path = await root.resolve(nestedFile);
533
+ * // ["subdir", "file.txt"]
534
+ */
535
+ resolve(possibleDescendant: FileSystemHandle): Promise<string[] | null>;
536
+
537
+ /**
538
+ * Iterate over entries in this directory.
539
+ *
540
+ * @returns An async iterator of [name, handle] pairs
541
+ *
542
+ * @example
543
+ * for await (const [name, handle] of dir.entries()) {
544
+ * console.log(name, handle.kind);
545
+ * }
546
+ */
547
+ entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
548
+
549
+ /**
550
+ * Iterate over entry names in this directory.
551
+ *
552
+ * @returns An async iterator of names
553
+ *
554
+ * @example
555
+ * for await (const name of dir.keys()) {
556
+ * console.log(name);
557
+ * }
558
+ */
559
+ keys(): AsyncIterableIterator<string>;
560
+
561
+ /**
562
+ * Iterate over handles in this directory.
563
+ *
564
+ * @returns An async iterator of handles
565
+ *
566
+ * @example
567
+ * for await (const handle of dir.values()) {
568
+ * console.log(handle.name, handle.kind);
569
+ * }
570
+ */
571
+ values(): AsyncIterableIterator<FileSystemHandle>;
572
+
573
+ /**
574
+ * Async iterator support for directory entries.
575
+ *
576
+ * @example
577
+ * for await (const [name, handle] of dir) {
578
+ * console.log(name, handle.kind);
579
+ * }
580
+ */
581
+ [Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
582
+ }
583
+
584
+ /**
585
+ * Parameters for write operations on FileSystemWritableFileStream.
586
+ */
587
+ interface WriteParams {
588
+ /**
589
+ * The type of write operation.
590
+ * - "write": Write data at the current position or specified position
591
+ * - "seek": Move the file position
592
+ * - "truncate": Truncate the file to a specific size
593
+ */
594
+ type: "write" | "seek" | "truncate";
595
+
596
+ /**
597
+ * The data to write (for "write" type).
598
+ */
599
+ data?: string | ArrayBuffer | Uint8Array | Blob;
600
+
601
+ /**
602
+ * The position to write at or seek to.
603
+ */
604
+ position?: number;
605
+
606
+ /**
607
+ * The size to truncate to (for "truncate" type).
608
+ */
609
+ size?: number;
610
+ }
611
+
612
+ /**
613
+ * Writable stream for writing to a file.
614
+ * Extends WritableStream with file-specific operations.
615
+ */
616
+ interface FileSystemWritableFileStream extends WritableStream<Uint8Array> {
617
+ /**
618
+ * Write data to the file.
619
+ *
620
+ * @param data - The data to write
621
+ * @returns A promise that resolves when the write completes
622
+ *
623
+ * @example
624
+ * await writable.write("Hello, World!");
625
+ * await writable.write(new Uint8Array([1, 2, 3]));
626
+ * await writable.write({ type: "write", data: "text", position: 0 });
627
+ */
628
+ write(
629
+ data: string | ArrayBuffer | Uint8Array | Blob | WriteParams
630
+ ): Promise<void>;
631
+
632
+ /**
633
+ * Seek to a position in the file.
634
+ *
635
+ * @param position - The byte position to seek to
636
+ * @returns A promise that resolves when the seek completes
637
+ *
638
+ * @example
639
+ * await writable.seek(0); // Seek to beginning
640
+ * await writable.write("Overwrite");
641
+ */
642
+ seek(position: number): Promise<void>;
643
+
644
+ /**
645
+ * Truncate the file to a specific size.
646
+ *
647
+ * @param size - The size to truncate to
648
+ * @returns A promise that resolves when the truncation completes
649
+ *
650
+ * @example
651
+ * await writable.truncate(100); // Keep only first 100 bytes
652
+ */
653
+ truncate(size: number): Promise<void>;
654
+ }
655
+ }
656
+ `;
657
+ var TYPE_DEFINITIONS = {
658
+ core: CORE_TYPES,
659
+ fetch: FETCH_TYPES,
660
+ fs: FS_TYPES
661
+ };
662
+ export {
663
+ TYPE_DEFINITIONS,
664
+ FS_TYPES,
665
+ FETCH_TYPES,
666
+ CORE_TYPES
667
+ };
668
+
669
+ //# debugId=DB524E5F7383894464756E2164756E21