opfs-worker 1.0.0 → 1.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 +19 -0
- package/dist/assets/worker-CvILLJKw.js.map +1 -0
- package/dist/helpers-CKqaiMjI.cjs +4 -0
- package/dist/helpers-CKqaiMjI.cjs.map +1 -0
- package/dist/{helpers-CTCvNFs1.js → helpers-DS5dyURe.js} +575 -510
- package/dist/helpers-DS5dyURe.js.map +1 -0
- package/dist/index.cjs +1074 -781
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1109 -810
- package/dist/index.js.map +1 -1
- package/dist/raw.cjs +1 -1
- package/dist/raw.cjs.map +1 -1
- package/dist/raw.js +331 -97
- package/dist/raw.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/encoder.d.ts +19 -0
- package/dist/utils/encoder.d.ts.map +1 -1
- package/dist/utils/errors.d.ts +23 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +40 -18
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/worker.d.ts +159 -2
- package/dist/worker.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/assets/worker-XHCzp1qX.js.map +0 -1
- package/dist/helpers-CTCvNFs1.js.map +0 -1
- package/dist/helpers-Cvjm0f_r.cjs +0 -4
- package/dist/helpers-Cvjm0f_r.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -345,6 +345,11 @@ Check out the live demo powered by Vite and hosted on GitHub Pages.
|
|
|
345
345
|
|
|
346
346
|
The complete API reference is available in the [docs/api-reference.md](docs/api-reference.md) file.
|
|
347
347
|
|
|
348
|
+
**Additional Documentation:**
|
|
349
|
+
|
|
350
|
+
- [File Descriptors Guide](docs/file-descriptors.md) - Comprehensive guide to low-level file I/O operations
|
|
351
|
+
- [Types Reference](docs/types.md) - Complete TypeScript type definitions
|
|
352
|
+
|
|
348
353
|
### Quick API Overview
|
|
349
354
|
|
|
350
355
|
**Entry Points:**
|
|
@@ -363,6 +368,20 @@ The complete API reference is available in the [docs/api-reference.md](docs/api-
|
|
|
363
368
|
- `copy(source, destination, options?)` - Copy files/directories
|
|
364
369
|
- `rename(oldPath, newPath)` - Rename files/directories
|
|
365
370
|
|
|
371
|
+
**File Descriptors (Low-level I/O):**
|
|
372
|
+
|
|
373
|
+
- `open(path, options?)` - Open file and return descriptor
|
|
374
|
+
- `read(fd, buffer, offset, length, position?)` - Read from descriptor (returns `{bytesRead, buffer}`)
|
|
375
|
+
- `write(fd, buffer, offset?, length?, position?)` - Write to descriptor
|
|
376
|
+
- `fstat(fd)` - Get stats by descriptor
|
|
377
|
+
- `ftruncate(fd, size?)` - Truncate file by descriptor
|
|
378
|
+
- `fsync(fd)` - Sync file data to storage
|
|
379
|
+
- `close(fd)` - Close file descriptor
|
|
380
|
+
|
|
381
|
+
**Note**: The `read()` method uses `Comlink.transfer()` for efficient buffer handling. **From the main window**, you must transfer buffer ownership to the worker, and **from the worker**, the buffer is transferred back to you. See [File Descriptors Guide](docs/file-descriptors.md) for complete usage examples.
|
|
382
|
+
|
|
383
|
+
_For detailed file descriptor documentation, see [File Descriptors Guide](docs/file-descriptors.md)_
|
|
384
|
+
|
|
366
385
|
**Advanced Features:**
|
|
367
386
|
|
|
368
387
|
- `watch(path, options?)` - Watch for file changes with minimatch patterns
|