UNPKG

1.07 kBTypeScriptView Raw
1// Type definitions for path-browserify 1.0
2// Project: https://github.com/browserify/path-browserify
3// Definitions by: Nathan Bierema <https://github.com/Methuselah96>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6declare namespace path {
7 interface PathObject {
8 root: string;
9 dir: string;
10 base: string;
11 ext: string;
12 name: string;
13 }
14
15 interface Path {
16 resolve(...pathSegments: string[]): string;
17 normalize(path: string): string;
18 isAbsolute(path: string): boolean;
19 join(...paths: string[]): string;
20 relative(from: string, to: string): string;
21 dirname(path: string): string;
22 basename(path: string, ext?: string): string;
23 extname(path: string): string;
24 format(pathObject: Partial<PathObject>): string;
25 parse(path: string): PathObject;
26
27 readonly sep: string;
28 readonly delimiter: string;
29 readonly win32: null;
30 readonly posix: Path;
31 }
32}
33
34declare const path: path.Path;
35export = path;