UNPKG

924 BTypeScriptView Raw
1import { FileSystem, CacheFactory } from '@fimbul/ymir';
2export declare enum FileKind {
3 NonExistent = 0,
4 File = 1,
5 Directory = 2,
6 Other = 3
7}
8export interface DirectoryEntryWithKind {
9 name: string;
10 kind: FileKind;
11}
12export declare class CachedFileSystem {
13 private fs;
14 private fileKindCache;
15 private realpathCache;
16 private direntCache;
17 constructor(fs: FileSystem, cache: CacheFactory);
18 isFile(file: string): boolean;
19 isDirectory(dir: string): boolean;
20 getKind(file: string): FileKind;
21 private doGetKind;
22 readDirectory(dir: string): {
23 kind: FileKind;
24 name: string;
25 }[];
26 readFile(file: string): string;
27 realpath: ((file: string) => string) | undefined;
28 writeFile(file: string, content: string): void;
29 remove(file: string): void;
30 createDirectory(dir: string): void;
31 private doCreateDirectory;
32 private updateCache;
33}
34
\No newline at end of file