@zenfs/core
Version:
A filesystem, anywhere
25 lines (24 loc) • 1.43 kB
TypeScript
import type { PathLike } from 'node:fs';
import type { V_Context } from '../internal/contexts.js';
import type { MkdirOptions, OpenOptions, ReaddirOptions, ResolvedPath } from './shared.js';
import { type ExceptionExtra } from 'kerium';
import { type InodeLike } from '../internal/inode.js';
import { Dirent } from './dir.js';
import { Handle } from './file.js';
/**
* Resolves the mount and real path for a path.
* Additionally, any stats fetched will be returned for de-duplication
* @internal @hidden
*/
export declare function resolve($: V_Context, path: string, preserveSymlinks?: boolean, extra?: ExceptionExtra): Promise<ResolvedPath>;
/**
* Opens a file. This helper handles the complexity of file flags.
* @internal
*/
export declare function open($: V_Context, path: PathLike, opt: OpenOptions): Promise<Handle>;
export declare function readlink(this: V_Context, path: PathLike): Promise<string>;
export declare function mkdir(this: V_Context, path: PathLike, options?: MkdirOptions): Promise<string | void>;
export declare function readdir(this: V_Context, path: PathLike, options?: ReaddirOptions): Promise<Dirent[]>;
export declare function rename(this: V_Context, oldPath: PathLike, newPath: PathLike): Promise<void>;
export declare function link(this: V_Context, target: PathLike, link: PathLike): Promise<void>;
export declare function stat(this: V_Context, path: PathLike, lstat: boolean): Promise<InodeLike>;