@zenfs/core 0.12.0 → 0.12.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.
@@ -4,7 +4,7 @@ type OptionType = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undef
4
4
  /**
5
5
  * Resolves the type of Backend.options from the options interface
6
6
  */
7
- type OptionsConfig<T> = {
7
+ export type OptionsConfig<T> = {
8
8
  [K in keyof T]: {
9
9
  /**
10
10
  * The basic JavaScript type(s) for this option.
@@ -54,7 +54,16 @@ export interface Backend<FS extends FileSystem = FileSystem, TOptions extends ob
54
54
  */
55
55
  isAvailable(): boolean | Promise<boolean>;
56
56
  }
57
- type OptionsOf<T extends Backend> = T extends Backend<FileSystem, infer TOptions> ? TOptions : never;
57
+ /**
58
+ * Gets the options type of a backend
59
+ * @internal
60
+ */
61
+ export type OptionsOf<T extends Backend> = T extends Backend<FileSystem, infer TOptions> ? TOptions : never;
62
+ /**
63
+ * Gets the FileSystem type for a backend
64
+ * @internal
65
+ */
66
+ export type FilesystemOf<T extends Backend> = T extends Backend<infer FS> ? FS : never;
58
67
  /**
59
68
  * @internal
60
69
  */
@@ -63,7 +72,7 @@ export declare function isBackend(arg: unknown): arg is Backend;
63
72
  * Checks that the given options object is valid for the file system options.
64
73
  * @internal
65
74
  */
66
- export declare function checkOptions<T extends Backend>(backend: T, opts: Partial<OptionsOf<T>> & Record<string, unknown>): Promise<void>;
75
+ export declare function checkOptions<T extends Backend>(backend: T, opts: Record<string, unknown>): Promise<void>;
67
76
  /**
68
77
  * Specifies a file system backend type and its options.
69
78
  *
@@ -72,11 +81,12 @@ export declare function checkOptions<T extends Backend>(backend: T, opts: Partia
72
81
  *
73
82
  * The option object for each file system corresponds to that file system's option object passed to its `Create()` method.
74
83
  */
75
- export type BackendConfiguration<T extends Backend = Backend> = OptionsOf<T> & {
84
+ export type BackendConfiguration<T extends Backend> = OptionsOf<T> & {
76
85
  backend: T;
86
+ disableAsyncCache?: boolean;
77
87
  };
78
88
  /**
79
89
  * @internal
80
90
  */
81
- export declare function isBackendConfig(arg: unknown): arg is BackendConfiguration;
91
+ export declare function isBackendConfig<T extends Backend>(arg: unknown): arg is BackendConfiguration<T>;
82
92
  export {};
@@ -1,4 +1,8 @@
1
1
  import { Stats, StatsLike } from '../../stats.js';
2
+ /**
3
+ * An Index in JSON form
4
+ * @internal
5
+ */
2
6
  export interface IndexData {
3
7
  version: 1;
4
8
  entries: Record<string, StatsLike<number>>;
@@ -6,6 +10,7 @@ export interface IndexData {
6
10
  export declare const version = 1;
7
11
  /**
8
12
  * An index of files
13
+ * @internal
9
14
  */
10
15
  export declare class Index extends Map<string, Stats> {
11
16
  constructor();
@@ -6,6 +6,7 @@ import { basename, dirname } from '../../emulation/path.js';
6
6
  export const version = 1;
7
7
  /**
8
8
  * An index of files
9
+ * @internal
9
10
  */
10
11
  export class Index extends Map {
11
12
  constructor() {
@@ -40,7 +40,8 @@ export declare class PortFile extends File {
40
40
  type FSMethods = ExtractProperties<FileSystem, (...args: any[]) => Promise<any> | FileSystemMetadata>;
41
41
  type FSMethod = keyof FSMethods;
42
42
  declare const PortFS_base: (abstract new (...args: any[]) => {
43
- _sync: FileSystem;
43
+ _disableSync: boolean;
44
+ _sync?: FileSystem | undefined;
44
45
  queueDone(): Promise<void>;
45
46
  metadata(): FileSystemMetadata;
46
47
  ready(): Promise<void>;