/** * @file Immutable metadata snapshots returned by {@link TinyFSCore#stat}. */ export type FSEntryKind = 'file' | 'directory' | 'symbolic-link'; export type FSStatDescriptor = { /** * Base name of the entry. */ name: string; /** * Entry kind. */ kind: FSEntryKind; /** * Size in bytes. Ignored for directories. */ size: number; /** * Last modification time in milliseconds since the epoch. */ mtimeMs: number; }; export type FSDirectoryEntry = { /** * Base name of the entry. */ name: string; /** * Entry kind. */ kind: FSEntryKind; }; export type FSMetadata = { /** * POSIX permission bits, or `null` when unset. */ mode: number | null; /** * Owner user id. */ uid: number | null; /** * Owner group id. */ gid: number | null; /** * Last access time in milliseconds since the epoch. */ atimeMs: number | null; /** * Last modification time in milliseconds since the epoch. */ mtimeMs: number | null; /** * Creation time in milliseconds since the epoch. */ birthtimeMs: number | null; }; export type StatsOptions = { /** * Absolute path of the entry. */ path: string; /** * Base name of the entry. */ name: string; /** * Entry kind. */ kind: FSEntryKind; /** * Size in bytes. */ size: number; /** * POSIX permission bits. */ mode: number; /** * Owner user id. */ uid: number; /** * Owner group id. */ gid: number; /** * Last access time in milliseconds since the epoch. */ atimeMs: number; /** * Last modification time in milliseconds since the epoch. */ mtimeMs: number; /** * Creation time in milliseconds since the epoch. */ birthtimeMs: number; /** * Inode number. `0` when the backend has no inodes. */ ino: number; }; /** * @typedef {'file' | 'directory' | 'symbolic-link'} FSEntryKind */ /** * @typedef {Object} FSStatDescriptor * @property {string} name Base name of the entry. * @property {FSEntryKind} kind Entry kind. * @property {number} size Size in bytes. Ignored for directories. * @property {number} mtimeMs Last modification time in milliseconds since the epoch. */ /** * @typedef {Object} FSDirectoryEntry * @property {string} name Base name of the entry. * @property {FSEntryKind} kind Entry kind. */ /** * @typedef {Object} FSMetadata * @property {number | null} mode POSIX permission bits, or `null` when unset. * @property {number | null} uid Owner user id. * @property {number | null} gid Owner group id. * @property {number | null} atimeMs Last access time in milliseconds since the epoch. * @property {number | null} mtimeMs Last modification time in milliseconds since the epoch. * @property {number | null} birthtimeMs Creation time in milliseconds since the epoch. */ /** * @typedef {Object} StatsOptions * @property {string} path Absolute path of the entry. * @property {string} name Base name of the entry. * @property {FSEntryKind} kind Entry kind. * @property {number} size Size in bytes. * @property {number} mode POSIX permission bits. * @property {number} uid Owner user id. * @property {number} gid Owner group id. * @property {number} atimeMs Last access time in milliseconds since the epoch. * @property {number} mtimeMs Last modification time in milliseconds since the epoch. * @property {number} birthtimeMs Creation time in milliseconds since the epoch. * @property {number} ino Inode number. `0` when the backend has no inodes. */ /** * Immutable snapshot of a file system entry, shaped like `node:fs.Stats`. */ export declare class Stats { #private; /** * @param {StatsOptions} options Snapshot values. */ constructor(options: StatsOptions); /** @returns {string} Absolute path of the entry. */ get path(): string; /** @returns {string} Base name of the entry. */ get name(): string; /** @returns {number} Size in bytes, or `0` for directories. */ get size(): number; /** @returns {number} POSIX permission bits. */ get mode(): number; /** @returns {number} Owner user id. */ get uid(): number; /** @returns {number} Owner group id. */ get gid(): number; /** @returns {number} Inode number, or `0` when unsupported. */ get ino(): number; /** @returns {number} Number of hard links. Always `1`. */ get nlink(): number; /** @returns {number} Last access time in milliseconds since the epoch. */ get atimeMs(): number; /** @returns {number} Last modification time in milliseconds since the epoch. */ get mtimeMs(): number; /** @returns {number} Creation time in milliseconds since the epoch. */ get birthtimeMs(): number; /** @returns {Date} Last access time. */ get atime(): Date; /** @returns {Date} Last modification time. */ get mtime(): Date; /** @returns {Date} Change time. Alias of `mtime`. */ get ctime(): Date; /** @returns {Date} Creation time. */ get birthtime(): Date; /** @returns {boolean} `true` when the entry is a regular file. */ isFile(): boolean; /** @returns {boolean} `true` when the entry is a directory. */ isDirectory(): boolean; /** @returns {boolean} `true` when the entry is a symbolic link. */ isSymbolicLink(): boolean; /** @returns {boolean} Always `false`. */ isBlockDevice(): boolean; /** @returns {boolean} Always `false`. */ isCharacterDevice(): boolean; /** @returns {boolean} Always `false`. */ isFIFO(): boolean; /** @returns {boolean} Always `false`. */ isSocket(): boolean; /** @returns {number} The `st_mode` field, including the file type bits. */ get modeWithType(): number; } /** * Directory entry returned by `readdir` when `withFileTypes` is `true`. */ export declare class Dirent { #private; /** * @param {string} name Base name of the entry. * @param {FSEntryKind} kind Entry kind. */ constructor(name: string, kind: FSEntryKind); /** @returns {string} Base name of the entry. */ get name(): string; /** @returns {boolean} `true` when the entry is a regular file. */ isFile(): boolean; /** @returns {boolean} `true` when the entry is a directory. */ isDirectory(): boolean; /** @returns {boolean} `true` when the entry is a symbolic link. */ isSymbolicLink(): boolean; /** @returns {boolean} Always `false`. */ isBlockDevice(): boolean; /** @returns {boolean} Always `false`. */ isCharacterDevice(): boolean; /** @returns {boolean} Always `false`. */ isFIFO(): boolean; /** @returns {boolean} Always `false`. */ isSocket(): boolean; } //# sourceMappingURL=stats.d.mts.map