UNPKG

@itwin/core-backend

Version:
62 lines 2.85 kB
/** Information about a file. See [[IModelJsFs.lstatSync]] * @public */ export declare class IModelJsFsStats { size: number; atimeMs: number; mtimeMs: number; birthtimeMs: number; isDirectory: boolean; isFile: boolean; isSocket: boolean; isSymbolicLink: boolean; isReadOnly: boolean; constructor(size: number, atimeMs: number, mtimeMs: number, birthtimeMs: number, isDirectory: boolean, isFile: boolean, isSocket: boolean, isSymbolicLink: boolean, isReadOnly: boolean); } /** File system operations that are defined on all platforms. See also [[Platform]] and [[KnownLocations]] * @public */ export declare class IModelJsFs { /** Does file or directory exist? */ static existsSync(pathname: string): boolean; /** Delete a file. */ static unlinkSync(pathname: string): void; /** Delete a file or remove a directory (rm -r). */ static removeSync(pathname: string): void; /** Create a directory. */ static mkdirSync(pathname: string): void; /** Remove a directory. */ static rmdirSync(pathname: string): void; /** Write to a file. */ static writeFileSync(pathname: string, data: string | Uint8Array, wflag?: string): void; /** Append to a file. */ static appendFileSync(pathname: string, str: string): void; /** Make a copy of a file */ static copySync(src: string, dest: string, opts?: any): void; /** Gets the file and directory names in the specified directory. Excludes "." and "..". Returns an empty array if the specified directory does not exist. */ static readdirSync(pathname: string): string[]; /** Read file */ static readFileSync(pathname: string): string | Buffer; /** Test if the current user has permission to write to a file. */ private static isFileWritable; /** Get information about a file. */ static lstatSync(pathname: string): IModelJsFsStats | undefined; /** * Finds files recursively based on a pattern * @param rootDir Directory from where to start searching for files. * @param pattern A Regex that would be match to basename of files including extension * @returns list of file that match the pattern. */ static recursiveFindSync(rootDir: string, pattern: RegExp): string[]; /** * Walks a directory in breadth first fashion * @param rootDir directory from where the traversal starts * @param cb callback that would be called with full path of file or directory */ static walkDirSync(rootDir: string, cb: (pathname: string, isDir: boolean) => boolean): void; /** Create a directory, recursively setting up the path as necessary */ static recursiveMkDirSync(dirPath: string): void; /** Remove a directory, recursively */ static purgeDirSync(dirPath: string): void; } //# sourceMappingURL=IModelJsFs.d.ts.map