1 | export declare class Path {
|
2 | static separator: '/';
|
3 | static isDrive(segment: string): boolean;
|
4 | |
5 |
|
6 |
|
7 |
|
8 |
|
9 | static normalizeDrive(path: string): string;
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 | static normalizePathSeparator(path: string): string;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | static windowsPath(path: string): string;
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | static tildify(resourcePath: string, home: string): string;
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | static untildify(resourcePath: string, home: string): string;
|
39 | readonly isAbsolute: boolean;
|
40 | readonly isRoot: boolean;
|
41 | readonly root: Path | undefined;
|
42 | readonly base: string;
|
43 | readonly name: string;
|
44 | readonly ext: string;
|
45 | private _dir;
|
46 | private readonly raw;
|
47 | |
48 |
|
49 |
|
50 | constructor(raw: string);
|
51 | protected computeRoot(): Path | undefined;
|
52 | /**
|
53 | * Returns the parent directory if it exists (`hasDir === true`) or `this` otherwise.
|
54 | */
|
55 | get dir(): Path;
|
56 | /**
|
57 | * Returns `true` if this has a parent directory, `false` otherwise.
|
58 | *
|
59 | * _This implementation returns `true` if and only if this is not the root dir and
|
60 | * there is a path separator in the raw path._
|
61 | */
|
62 | get hasDir(): boolean;
|
63 | protected computeDir(): Path;
|
64 | join(...paths: string[]): Path;
|
65 | /**
|
66 | *
|
67 | * @param paths portions of a path
|
68 | * @returns a new Path if an absolute path can be computed from the segments passed in + this.raw
|
69 | * If no absolute path can be computed, returns undefined.
|
70 | *
|
71 | * Processes the path segments passed in from right to left (reverse order) concatenating until an
|
72 | * absolute path is found.
|
73 | */
|
74 | resolve(...paths: string[]): Path | undefined;
|
75 | toString(): string;
|
76 | /**
|
77 | * Converts the current path into a file system path.
|
78 | * @param format Determines the format of the path.
|
79 | * If `undefined`, the format will be determined by the `OS.backend.type` value.
|
80 | * @returns A file system path.
|
81 | */
|
82 | fsPath(format?: Path.Format): string;
|
83 | relative(path: Path): Path | undefined;
|
84 | isEqualOrParent(path: Path): boolean;
|
85 | relativity(path: Path): number;
|
86 | normalize(): Path;
|
87 | }
|
88 | export declare namespace Path {
|
89 | enum Format {
|
90 | Posix = 0,
|
91 | Windows = 1
|
92 | }
|
93 | }
|
94 |
|
\ | No newline at end of file |