/** * On POSIX: * ┌──────────────────────┬────────────┐ * │ dir │ base │ * ├──────┬ ├──────┬─────┤ * │ root │ │ name │ ext │ * " / home/user/dir / file .txt " * └──────┴───────────────┴──────┴─────┘ * * On Windows: * ┌──────────────────────┬────────────┐ * │ dir │ base │ * ├──────┬ ├──────┬─────┤ * │ root │ │ name │ ext │ * " /c: / home/user/dir / file .txt " * └──────┴───────────────┴──────┴─────┘ */ export declare class Path { static separator: '/'; static nativeSeparator: string; static isDrive(segment: string): boolean; static splitPath(path: string): string[]; static isRelative(path: string): boolean; static pathDepth(path: string): number; /** * vscode-uri always normalizes drive letters to lower case: * https://github.com/Microsoft/vscode-uri/blob/b1d3221579f97f28a839b6f996d76fc45e9964d8/src/index.ts#L1025 * Theia path should be adjusted to this. */ static normalizeDrive(path: string): string; readonly isAbsolute: boolean; readonly isRoot: boolean; readonly root: Path | undefined; readonly base: string; readonly name: string; readonly ext: string; private _dir; private readonly raw; /** * The raw should be normalized, meaning that only '/' is allowed as a path separator. */ constructor(raw: string); protected computeRoot(): Path | undefined; get dir(): Path; protected computeDir(): Path; join(...paths: string[]): Path; toString(): string; relative(path: Path): Path | undefined; isEqualOrParent(path: Path): boolean; isEqual(path: Path): boolean; relativity(path: Path): number; } interface ParsedPath { root: string; dir: string; base: string; ext: string; name: string; } export interface IPath { normalize(path: string): string; isAbsolute(path: string): boolean; join(...paths: string[]): string; resolve(...pathSegments: string[]): string; relative(from: string, to: string): string; dirname(path: string): string; basename(path: string, ext?: string): string; extname(path: string): string; format(pathObject: ParsedPath): string; parse(path: string): ParsedPath; toNamespacedPath(path: string): string; sep: '\\' | '/'; delimiter: string; win32: IPath | null; posix: IPath | null; } export declare const win32: IPath; export declare const posix: IPath; /** * Takes a Windows OS path and changes backward slashes to forward slashes. * This should only be done for OS paths from Windows (or user provided paths potentially from Windows). * Using it on a Linux or MaxOS path might change it. */ export declare function toSlashes(osPath: string): string; export declare const normalize: (path: string) => string; export declare const isAbsolute: (path: string) => boolean; export declare const join: (...paths: string[]) => string; export declare const resolve: (...pathSegments: string[]) => string; export declare const relative: (from: string, to: string) => string; export declare const dirname: (path: string) => string; export declare const basename: (path: string, ext?: string) => string; export declare const extname: (path: string) => string; export declare const format: (pathObject: ParsedPath) => string; export declare const parse: (path: string) => ParsedPath; export declare const toNamespacedPath: (path: string) => string; export declare const sep: "/" | "\\"; export declare const delimiter: string; export declare function replaceAsarInPath(pathMayInAsar: string): string; export declare function isValidBasename(name: string | null | undefined, isWindowsOS?: boolean): boolean; export {}; //# sourceMappingURL=path.d.ts.map