UNPKG

2.06 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { AbsoluteFsPath, FileStats, FileSystem, PathSegment, PathString } from './types';
9/**
10 * The default `FileSystem` that will always fail.
11 *
12 * This is a way of ensuring that the developer consciously chooses and
13 * configures the `FileSystem` before using it; particularly important when
14 * considering static functions like `absoluteFrom()` which rely on
15 * the `FileSystem` under the hood.
16 */
17export declare class InvalidFileSystem implements FileSystem {
18 exists(path: AbsoluteFsPath): boolean;
19 readFile(path: AbsoluteFsPath): string;
20 readFileBuffer(path: AbsoluteFsPath): Uint8Array;
21 writeFile(path: AbsoluteFsPath, data: string | Uint8Array, exclusive?: boolean): void;
22 removeFile(path: AbsoluteFsPath): void;
23 symlink(target: AbsoluteFsPath, path: AbsoluteFsPath): void;
24 readdir(path: AbsoluteFsPath): PathSegment[];
25 lstat(path: AbsoluteFsPath): FileStats;
26 stat(path: AbsoluteFsPath): FileStats;
27 pwd(): AbsoluteFsPath;
28 chdir(path: AbsoluteFsPath): void;
29 extname(path: AbsoluteFsPath | PathSegment): string;
30 copyFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void;
31 moveFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void;
32 ensureDir(path: AbsoluteFsPath): void;
33 removeDeep(path: AbsoluteFsPath): void;
34 isCaseSensitive(): boolean;
35 resolve(...paths: string[]): AbsoluteFsPath;
36 dirname<T extends PathString>(file: T): T;
37 join<T extends PathString>(basePath: T, ...paths: string[]): T;
38 isRoot(path: AbsoluteFsPath): boolean;
39 isRooted(path: string): boolean;
40 relative<T extends PathString>(from: T, to: T): PathSegment | AbsoluteFsPath;
41 basename(filePath: string, extension?: string): PathSegment;
42 realpath(filePath: AbsoluteFsPath): AbsoluteFsPath;
43 getDefaultLibLocation(): AbsoluteFsPath;
44 normalize<T extends PathString>(path: T): T;
45}