@utoo/web 1.2.7 → 1.3.0-rc.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.
@@ -1,3 +1,11 @@
1
+ /**
2
+ * @returns {any}
3
+ */
4
+ export function getWasmMemory(): any;
5
+ /**
6
+ * @returns {any}
7
+ */
8
+ export function getWasmModule(): any;
1
9
  /**
2
10
  * @param {string} filter
3
11
  */
@@ -60,34 +68,18 @@ export class DirEntry {
60
68
  */
61
69
  get type(): DirEntryType;
62
70
  }
63
- export class Metadata {
64
- static __wrap(ptr: any): any;
65
- toJSON(): {
66
- type: DirEntryType;
67
- file_size: bigint;
68
- };
69
- toString(): string;
70
- __destroy_into_raw(): number | undefined;
71
- __wbg_ptr: number | undefined;
72
- free(): void;
73
- /**
74
- * @param {DirEntryType} arg0
75
- */
76
- set type(arg0: DirEntryType);
71
+ export class Fs {
77
72
  /**
78
- * @returns {DirEntryType}
79
- */
80
- get type(): DirEntryType;
81
- /**
82
- * @param {bigint} arg0
73
+ * @param {string} src
74
+ * @param {string} dst
75
+ * @returns {Promise<void>}
83
76
  */
84
- set file_size(arg0: bigint);
77
+ static copyFile(src: string, dst: string): Promise<void>;
85
78
  /**
86
- * @returns {bigint}
79
+ * @param {string} src
80
+ * @param {string} dst
87
81
  */
88
- get file_size(): bigint;
89
- }
90
- export class Project {
82
+ static copyFileSync(src: string, dst: string): void;
91
83
  /**
92
84
  * @param {string} path
93
85
  * @returns {Promise<void>}
@@ -95,26 +87,22 @@ export class Project {
95
87
  static createDir(path: string): Promise<void>;
96
88
  /**
97
89
  * @param {string} path
98
- * @param {boolean} recursive
99
90
  * @returns {Promise<void>}
100
91
  */
101
- static removeDir(path: string, recursive: boolean): Promise<void>;
92
+ static createDirAll(path: string): Promise<void>;
102
93
  /**
103
94
  * @param {string} path
104
- * @param {Uint8Array} content
105
95
  */
106
- static writeSync(path: string, content: Uint8Array): void;
96
+ static createDirAllSync(path: string): void;
107
97
  /**
108
98
  * @param {string} path
109
- * @returns {Promise<void>}
110
99
  */
111
- static removeFile(path: string): Promise<void>;
100
+ static createDirSync(path: string): void;
112
101
  /**
113
102
  * @param {string} path
114
- * @param {string} content
115
- * @returns {Promise<void>}
103
+ * @returns {Promise<Metadata>}
116
104
  */
117
- static writeString(path: string, content: string): Promise<void>;
105
+ static metadata(path: string): Promise<Metadata>;
118
106
  /**
119
107
  * @param {string} path
120
108
  * @returns {Metadata}
@@ -122,19 +110,24 @@ export class Project {
122
110
  static metadataSync(path: string): Metadata;
123
111
  /**
124
112
  * @param {string} path
125
- * @returns {DirEntry[]}
113
+ * @returns {Promise<Uint8Array>}
126
114
  */
127
- static readDirSync(path: string): DirEntry[];
115
+ static read(path: string): Promise<Uint8Array>;
128
116
  /**
129
- * @param {string} src
130
- * @param {string} dst
117
+ * @param {string} path
118
+ * @returns {Promise<DirEntry[]>}
131
119
  */
132
- static copyFileSync(src: string, dst: string): void;
120
+ static readDir(path: string): Promise<DirEntry[]>;
133
121
  /**
134
122
  * @param {string} path
135
- * @returns {Promise<void>}
123
+ * @returns {DirEntry[]}
136
124
  */
137
- static createDirAll(path: string): Promise<void>;
125
+ static readDirSync(path: string): DirEntry[];
126
+ /**
127
+ * @param {string} path
128
+ * @returns {Uint8Array}
129
+ */
130
+ static readSync(path: string): Uint8Array;
138
131
  /**
139
132
  * @param {string} path
140
133
  * @returns {Promise<string>}
@@ -142,64 +135,114 @@ export class Project {
142
135
  static readToString(path: string): Promise<string>;
143
136
  /**
144
137
  * @param {string} path
138
+ * @param {boolean} recursive
139
+ * @returns {Promise<void>}
145
140
  */
146
- static createDirSync(path: string): void;
141
+ static removeDir(path: string, recursive: boolean): Promise<void>;
147
142
  /**
148
143
  * @param {string} path
149
144
  * @param {boolean} recursive
150
145
  */
151
146
  static removeDirSync(path: string, recursive: boolean): void;
147
+ /**
148
+ * @param {string} path
149
+ * @returns {Promise<void>}
150
+ */
151
+ static removeFile(path: string): Promise<void>;
152
152
  /**
153
153
  * @param {string} path
154
154
  */
155
155
  static removeFileSync(path: string): void;
156
156
  /**
157
157
  * @param {string} path
158
+ * @param {Uint8Array} content
159
+ * @returns {Promise<void>}
158
160
  */
159
- static createDirAllSync(path: string): void;
161
+ static write(path: string, content: Uint8Array): Promise<void>;
162
+ /**
163
+ * @param {string} path
164
+ * @param {string} content
165
+ * @returns {Promise<void>}
166
+ */
167
+ static writeString(path: string, content: string): Promise<void>;
168
+ /**
169
+ * @param {string} path
170
+ * @param {Uint8Array} content
171
+ */
172
+ static writeSync(path: string, content: Uint8Array): void;
173
+ __destroy_into_raw(): number | undefined;
174
+ __wbg_ptr: number | undefined;
175
+ free(): void;
176
+ }
177
+ export class Metadata {
178
+ static __wrap(ptr: any): any;
179
+ toJSON(): {
180
+ file_size: bigint;
181
+ type: DirEntryType;
182
+ };
183
+ toString(): string;
184
+ __destroy_into_raw(): number | undefined;
185
+ __wbg_ptr: number | undefined;
186
+ free(): void;
187
+ /**
188
+ * @param {bigint} arg0
189
+ */
190
+ set file_size(arg0: bigint);
191
+ /**
192
+ * @returns {bigint}
193
+ */
194
+ get file_size(): bigint;
195
+ /**
196
+ * @param {DirEntryType} arg0
197
+ */
198
+ set type(arg0: DirEntryType);
199
+ /**
200
+ * @returns {DirEntryType}
201
+ */
202
+ get type(): DirEntryType;
203
+ }
204
+ export class Project {
205
+ /**
206
+ * @returns {Promise<any>}
207
+ */
208
+ static build(): Promise<any>;
160
209
  /**
161
210
  * @returns {string}
162
211
  */
163
212
  static get cwd(): string;
164
213
  /**
165
214
  * Generate package-lock.json by resolving dependencies.
166
- *
167
- * # Arguments
168
- * * `registry` - Optional registry URL. If None, uses npmmirror.
169
- * - "https://registry.npmmirror.com" - supports semver queries (faster)
170
- * - "https://registry.npmjs.org" - official npm registry (slower, fetches full manifest)
171
- * * `concurrency` - Optional concurrency limit (defaults to 20)
172
215
  * @param {string | null} [registry]
173
216
  * @param {number | null} [concurrency]
174
217
  * @returns {Promise<string>}
175
218
  */
176
219
  static deps(registry?: string | null, concurrency?: number | null): Promise<string>;
220
+ /**
221
+ * Subscribe to entrypoints changes with HMR support.
222
+ * This will watch for file changes and automatically rebuild.
223
+ * Returns a RootTask that must be held by JS to keep the subscription active.
224
+ * @param {Function} callback
225
+ * @returns {Promise<RootTask>}
226
+ */
227
+ static entrypointsSubscribe(callback: Function): Promise<RootTask>;
177
228
  /**
178
229
  * Create a tar.gz archive and return bytes (no file I/O)
179
- * This is useful for main thread execution without OPFS access
180
230
  * @param {any} files
181
231
  * @returns {Promise<Uint8Array>}
182
232
  */
183
233
  static gzip(files: any): Promise<Uint8Array>;
184
234
  /**
185
- * @param {string} thread_url
186
- */
187
- static init(thread_url: string): void;
188
- /**
189
- * @param {string} path
190
- * @returns {Promise<Uint8Array>}
235
+ * Subscribe to HMR events for a specific identifier.
236
+ * Returns a RootTask that must be held by JS to keep the subscription active.
237
+ * @param {string} identifier
238
+ * @param {Function} callback
239
+ * @returns {Promise<RootTask>}
191
240
  */
192
- static read(path: string): Promise<Uint8Array>;
193
- /**
194
- * @returns {Promise<any>}
195
- */
196
- static build(): Promise<any>;
241
+ static hmrEvents(identifier: string, callback: Function): Promise<RootTask>;
197
242
  /**
198
- * @param {string} path
199
- * @param {Uint8Array} content
200
- * @returns {Promise<void>}
243
+ * @param {string} thread_url
201
244
  */
202
- static write(path: string, content: Uint8Array): Promise<void>;
245
+ static init(thread_url: string): void;
203
246
  /**
204
247
  * Install dependencies - downloads tgz files only, extracts on-demand when files are read
205
248
  * @param {string} package_lock
@@ -218,26 +261,27 @@ export class Project {
218
261
  */
219
262
  static sigMd5(content: Uint8Array): Promise<string>;
220
263
  /**
221
- * @param {string} path
222
- * @returns {Promise<Metadata>}
264
+ * Subscribe to compilation lifecycle events.
265
+ * Emits "start" when computation begins, "end" when idle for aggregation_ms.
266
+ * @param {number} aggregation_ms
267
+ * @param {Function} callback
223
268
  */
224
- static metadata(path: string): Promise<Metadata>;
269
+ static updateInfoSubscribe(aggregation_ms: number, callback: Function): void;
225
270
  /**
226
- * @param {string} path
227
- * @returns {Promise<DirEntry[]>}
271
+ * Write all entrypoints to disk.
272
+ * @param {Function} callback
228
273
  */
229
- static readDir(path: string): Promise<DirEntry[]>;
230
- /**
231
- * @param {string} src
232
- * @param {string} dst
233
- * @returns {Promise<void>}
234
- */
235
- static copyFile(src: string, dst: string): Promise<void>;
236
- /**
237
- * @param {string} path
238
- * @returns {Uint8Array}
239
- */
240
- static readSync(path: string): Uint8Array;
274
+ static writeAllToDisk(callback: Function): void;
275
+ __destroy_into_raw(): number | undefined;
276
+ __wbg_ptr: number | undefined;
277
+ free(): void;
278
+ }
279
+ /**
280
+ * A root task handle that keeps the turbo-tasks subscription alive.
281
+ * This must be held by JS to keep the subscription active.
282
+ */
283
+ export class RootTask {
284
+ static __wrap(ptr: any): any;
241
285
  __destroy_into_raw(): number | undefined;
242
286
  __wbg_ptr: number | undefined;
243
287
  free(): void;
@@ -247,10 +291,6 @@ export class WasmTaskMessage {
247
291
  __destroy_into_raw(): number | undefined;
248
292
  __wbg_ptr: number | undefined;
249
293
  free(): void;
250
- /**
251
- * @returns {Uint8Array}
252
- */
253
- get data(): Uint8Array;
254
294
  /**
255
295
  * @param {number} arg0
256
296
  */
@@ -259,6 +299,10 @@ export class WasmTaskMessage {
259
299
  * @returns {number}
260
300
  */
261
301
  get taskId(): number;
302
+ /**
303
+ * @returns {Uint8Array}
304
+ */
305
+ get data(): Uint8Array;
262
306
  }
263
307
  export class WebWorkerCreation {
264
308
  static __wrap(ptr: any): any;
@@ -282,19 +326,19 @@ export class WebWorkerOptions {
282
326
  /**
283
327
  * @param {string} arg0
284
328
  */
285
- set filename(arg0: string);
329
+ set cwd(arg0: string);
286
330
  /**
287
331
  * @returns {string}
288
332
  */
289
- get filename(): string;
333
+ get cwd(): string;
290
334
  /**
291
335
  * @param {string} arg0
292
336
  */
293
- set cwd(arg0: string);
337
+ set filename(arg0: string);
294
338
  /**
295
339
  * @returns {string}
296
340
  */
297
- get cwd(): string;
341
+ get filename(): string;
298
342
  }
299
343
  export class WebWorkerTermination {
300
344
  static __wrap(ptr: any): any;
@@ -318,6 +362,6 @@ export class WebWorkerTermination {
318
362
  */
319
363
  get workerId(): number;
320
364
  }
321
- export default __wbg_init;
322
365
  export function initSync(module: any, memory: any): any;
323
366
  declare function __wbg_init(module_or_path: any, memory: any): Promise<any>;
367
+ export { __wbg_init as default };