@zenfs/core
Version:
A filesystem, anywhere
74 lines (73 loc) • 2.16 kB
TypeScript
import type { Backend, BackendConfiguration, FilesystemOf, SharedConfig } from './backends/backend.js';
import type { AbsolutePath } from './emulation/path.js';
/**
* Configuration for a specific mount point
*/
export type MountConfiguration<T extends Backend> = FilesystemOf<T> | BackendConfiguration<T> | T;
/**
* Retrieve a file system with `configuration`.
* @see MountConfiguration
*/
export declare function resolveMountConfig<T extends Backend>(configuration: MountConfiguration<T>, _depth?: number): Promise<FilesystemOf<T>>;
export interface ConfigMounts {
[K: AbsolutePath]: Backend;
}
/**
* Configuration
*/
export interface Configuration<T extends ConfigMounts> extends SharedConfig {
/**
* An object mapping mount points to mount configuration
*/
mounts: {
[K in keyof T & AbsolutePath]: MountConfiguration<T[K]>;
};
/**
* The uid to use
* @default 0
*/
uid: number;
/**
* The gid to use
* @default 0
*/
gid: number;
/**
* Whether to automatically add normal Linux devices
* @experimental
* @default false
*/
addDevices: boolean;
/**
* If true, enables caching stats for certain operations.
* This should reduce the number of stat calls performed.
* @experimental
* @default false
*/
cacheStats: boolean;
/**
* If true, disables *all* permissions checking.
*
* This can increase performance.
* @experimental
* @default false
*/
disableAccessChecks: boolean;
/**
* If true, disables `read` and `readSync` from immediately syncing the updated atime to the file system.
*
* This can increase performance.
* @experimental
* @default false
*/
disableSyncOnRead: boolean;
}
/**
* Configures ZenFS with single mount point /
*/
export declare function configureSingle<T extends Backend>(configuration: MountConfiguration<T>): Promise<void>;
/**
* Configures ZenFS with `configuration`
* @see Configuration
*/
export declare function configure<T extends ConfigMounts>(configuration: Partial<Configuration<T>>): Promise<void>;