@zenfs/core
Version:
A filesystem, anywhere
31 lines (30 loc) • 574 B
TypeScript
/**
* @see `DT_*` in `dirent.h`
*/
export declare enum DirType {
UNKNOWN = 0,
FIFO = 1,
CHR = 2,
DIR = 4,
BLK = 6,
REG = 8,
LNK = 10,
SOCK = 12,
WHT = 14
}
/**
* Converts a file mode to a directory type.
* @see `IFTODT` in `dirent.h`
*/
export declare function ifToDt(mode: number): DirType;
/**
* Converts a directory type to a file mode.
* @see `DTTOIF` in `dirent.h`
*/
export declare function dtToIf(dt: DirType): number;
export declare class Dirent {
ino: number;
type: DirType;
path: string;
name: string;
}