1 | import { Maybe } from './common/types';
|
2 | export declare enum Branch {
|
3 | Public = "public",
|
4 | Pretty = "p",
|
5 | Private = "private",
|
6 | PrivateLog = "privateLog",
|
7 | Version = "version"
|
8 | }
|
9 | export declare enum Kind {
|
10 | Directory = "directory",
|
11 | File = "file"
|
12 | }
|
13 | export declare type Path = string[];
|
14 | export declare type DirectoryPath = {
|
15 | directory: Path;
|
16 | };
|
17 | export declare type FilePath = {
|
18 | file: Path;
|
19 | };
|
20 |
|
21 |
|
22 |
|
23 | export declare type DistinctivePath = DirectoryPath | FilePath;
|
24 |
|
25 |
|
26 |
|
27 | export declare function directory(...args: Path): DirectoryPath;
|
28 |
|
29 |
|
30 |
|
31 | export declare function file(...args: Path): FilePath;
|
32 |
|
33 |
|
34 |
|
35 | export declare function root(): DirectoryPath;
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | export declare function fromPosix(path: string): DistinctivePath;
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | export declare function toPosix(path: DistinctivePath, { absolute }?: {
|
52 | absolute: boolean;
|
53 | }): string;
|
54 |
|
55 |
|
56 |
|
57 | export declare function combine(a: DirectoryPath, b: DistinctivePath): DistinctivePath;
|
58 |
|
59 |
|
60 |
|
61 | export declare function isBranch(branch: Branch, path: DistinctivePath): boolean;
|
62 |
|
63 |
|
64 |
|
65 | export declare function isDirectory(path: DistinctivePath): path is DirectoryPath;
|
66 |
|
67 |
|
68 |
|
69 | export declare function isFile(path: DistinctivePath): path is FilePath;
|
70 |
|
71 |
|
72 |
|
73 | export declare function isRootDirectory(path: DirectoryPath): boolean;
|
74 |
|
75 |
|
76 |
|
77 | export declare function isSameBranch(a: DistinctivePath, b: DistinctivePath): boolean;
|
78 |
|
79 |
|
80 |
|
81 | export declare function isSameKind(a: DistinctivePath, b: DistinctivePath): boolean;
|
82 |
|
83 |
|
84 |
|
85 | export declare function kind(path: DistinctivePath): Kind;
|
86 |
|
87 |
|
88 |
|
89 | export declare function map(fn: (p: Path) => Path, path: DistinctivePath): DistinctivePath;
|
90 |
|
91 |
|
92 |
|
93 | export declare function parent(path: DistinctivePath): Maybe<DirectoryPath>;
|
94 |
|
95 |
|
96 |
|
97 | export declare function removeBranch(path: DistinctivePath): DistinctivePath;
|
98 |
|
99 |
|
100 |
|
101 | export declare function unwrap(path: DistinctivePath): Path;
|
102 |
|
103 |
|
104 |
|
105 | export declare function log(path: Path): string;
|