@zenfs/core 1.5.0 → 1.5.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.
@@ -19,7 +19,7 @@ export declare class Dirent implements _Dirent {
19
19
  /**
20
20
  * A class representing a directory stream.
21
21
  */
22
- export declare class Dir implements _Dir {
22
+ export declare class Dir implements _Dir, AsyncIterator<Dirent> {
23
23
  readonly path: string;
24
24
  protected readonly context: V_Context;
25
25
  protected closed: boolean;
@@ -55,5 +55,6 @@ export declare class Dir implements _Dir {
55
55
  /**
56
56
  * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
57
57
  */
58
- [Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;
58
+ [Symbol.asyncIterator](): this;
59
+ [Symbol.asyncDispose](): Promise<void>;
59
60
  }
@@ -102,4 +102,7 @@ export class Dir {
102
102
  [Symbol.asyncIterator]() {
103
103
  return this;
104
104
  }
105
+ [Symbol.asyncDispose]() {
106
+ return Promise.resolve();
107
+ }
105
108
  }
@@ -3,6 +3,7 @@ import { Readable, Writable } from 'readable-stream';
3
3
  import type { Callback } from '../utils.js';
4
4
  export declare class ReadStream extends Readable implements Node.ReadStream {
5
5
  close(callback?: Callback): void;
6
+ wrap(oldStream: NodeJS.ReadableStream): this;
6
7
  bytesRead: number;
7
8
  path: string | Buffer;
8
9
  pending: boolean;
@@ -11,6 +11,10 @@ export class ReadStream extends Readable {
11
11
  callback(new ErrnoError(Errno.EIO, err.toString()));
12
12
  }
13
13
  }
14
+ wrap(oldStream) {
15
+ super.wrap(oldStream);
16
+ return this;
17
+ }
14
18
  }
15
19
  export class WriteStream extends Writable {
16
20
  close(callback = () => null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenfs/core",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "A filesystem, anywhere",
5
5
  "funding": {
6
6
  "type": "individual",