@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
113 lines • 3.19 kB
TypeScript
import { Fs, File, FileInfo, OverlayFs as IOverlayFs, DirsMerger, OverlayFsOptions } from '../type';
import { OverlayOptions } from '../../../domain/fs/vo/overlayoptions';
/**
* OverlayFs entity - main overlay filesystem implementation
* TypeScript version of Go's OverlayFs struct
*/
export declare class OverlayFs implements IOverlayFs {
private fss;
private mergeDirs;
private firstWritable;
constructor(options: OverlayOptions);
/**
* Get filesystem name
*/
name(): string;
/**
* Implementation of FilesystemIterator interface
*/
filesystem(i: number): Fs | null;
/**
* Get number of filesystems in overlay
*/
numFilesystems(): number;
/**
* Append filesystems to overlay (returns new instance)
*/
append(...fss: Fs[]): OverlayFs;
/**
* Set directory merger (returns new instance)
*/
withDirsMerger(merger: DirsMerger): OverlayFs;
/**
* Get writable filesystem (first filesystem if firstWritable is true)
*/
private writeFs;
/**
* Collect directories from all filesystems
*/
private collectDirs;
/**
* Recursively collect directories from filesystem hierarchy
*/
private collectDirsRecursive;
/**
* Stat file/directory across all filesystems
*/
private statInternal;
/**
* Recursive stat implementation
*/
private statRecursive;
/**
* Check if error is "not exist" error
*/
private isNotExistError;
/**
* Create a file (write operation)
*/
create(name: string): Promise<File>;
/**
* Create directory (write operation)
*/
mkdir(name: string, perm: number): Promise<void>;
/**
* Create directory tree (write operation)
*/
mkdirAll(path: string, perm: number): Promise<void>;
/**
* Open file for reading (searches all filesystems)
*/
open(name: string): Promise<File>;
/**
* Open file with flags (write operations use first filesystem)
*/
openFile(name: string, flag: number, perm: number): Promise<File>;
/**
* Remove file (write operation)
*/
remove(name: string): Promise<void>;
/**
* Remove directory tree (write operation)
*/
removeAll(path: string): Promise<void>;
/**
* Rename file (write operation)
*/
rename(oldname: string, newname: string): Promise<void>;
/**
* Get file info (searches all filesystems)
*/
stat(name: string): Promise<FileInfo>;
/**
* Change file mode (write operation)
*/
chmod(name: string, mode: number): Promise<void>;
/**
* Change file ownership (write operation)
*/
chown(name: string, uid: number, gid: number): Promise<void>;
/**
* Change file times (write operation)
*/
chtimes(name: string, atime: Date, mtime: Date): Promise<void>;
}
/**
* Factory function to create new OverlayFs
*/
export declare function newOverlayFs(options: OverlayOptions): OverlayFs;
/**
* Create OverlayFs from raw options
*/
export declare function createOverlayFs(opts: OverlayFsOptions): OverlayFs;
//# sourceMappingURL=overlayfs.d.ts.map