import { URI } from '../model/uri'; /** * Converts filesystem path to POSIX path. Supported inputs are: * - Windows path starting with a drive letter, e.g. C:\dir\file.ext * - UNC path for a shared file, e.g. \\server\share\path\file.ext * - POSIX path, e.g. /dir/file.ext * * @param path A supported filesystem path. * @returns [path, authority] where path is a POSIX representation for the * given input and authority is undefined except for UNC paths. */ export declare function fromFsPath(path: string): [string, string]; /** * Converts a POSIX path to a filesystem path. * * @param path A POSIX path. * @param authority An optional authority used to build UNC paths. This only * makes sense for the Windows platform. * @returns A platform-specific representation of the given POSIX path. */ export declare function toFsPath(path: string, authority?: string): string; /** * Extracts the containing directory of a POSIX path, e.g. * - /d1/d2/f.ext -> /d1/d2 * - /d1/d2 -> /d1 * * @param path A POSIX path. * @returns true if the path is absolute, false otherwise. */ export declare function isAbsolute(path: string): boolean; /** * Extracts the containing directory of a POSIX path, e.g. * - /d1/d2/f.ext -> /d1/d2 * - /d1/d2 -> /d1 * * @param path A POSIX path. * @returns The containing directory of the given path. */ export declare function getDirectory(path: string): string; /** * Extracts the basename of a POSIX path, e.g. /d/f.ext -> f.ext. * * @param path A POSIX path. * @returns The basename of the given path. */ export declare function getBasename(path: string): string; /** * Extracts the name of a POSIX path, e.g. /d/f.ext -> f. * * @param path A POSIX path. * @returns The name of the given path. */ export declare function getName(path: string): string; /** * Extracts the extension of a POSIX path, e.g. * - /d/f.ext -> .ext * - /d/f.g.ext -> .ext * - /d/f -> '' * * @param path A POSIX path. * @returns The extension of the given path. */ export declare function getExtension(path: string): string; /** * Changes a POSIX path matching some extension to have another extension. * * @param path A POSIX path. * @param from The required current extension, or '*' to match any extension. * @param to The target extension. * @returns A POSIX path with its extension possibly changed. */ export declare function changeExtension(path: string, from: string, to: string): string; /** * Joins a number of POSIX paths into a single POSIX path, e.g. * - /d1, d2, f.ext -> /d1/d2/f.ext * - /d1/d2, .., f.ext -> /d1/f.ext * * @param paths A variable number of POSIX paths. * @returns A POSIX path built from the given POSIX paths. */ export declare function joinPath(...paths: string[]): string; /** * Makes a POSIX path relative to another POSIX path, e.g. * - /d1/d2 relative to /d1 -> d2 * - /d1/d2 relative to /d1/d3 -> ../d2 * * @param path The POSIX path to be made relative. * @param basePath The POSIX base path. * @returns A POSIX path relative to the base path. */ export declare function relativeTo(path: string, basePath: string): string; /** * Returns true when `path` is equal to or nested under `parent`. */ export declare function isWithinPath(path: URI, parent: URI): boolean; /** * Turns a relative path into an absolute path given a collection of base folders. * - if no base folder is provided, it will throw * - if the given path is already absolute, it will return it * - if the given path is relative it will return absolute paths for the ones matching the * first part of the path * - if no matching base folder is found, it will return an absolute path per base folder * @param path the path to evaluate * @param baseFolders the base folders to use * @returns an array of absolute path, guaranteed to have at least 1 element */ export declare function asAbsolutePaths(path: string, baseFolders: string[]): string[]; //# sourceMappingURL=path.d.ts.map