@ts-common/azure-js-dev-tools
Version:
Developer dependencies for TypeScript related projects
66 lines • 2.81 kB
TypeScript
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
/**
* Join the provided path segments using a forward slash (/) as a path separator.
* @param pathSegments The path segments to resolve.
* @returns The resolved path.
*/
export declare function joinPath(...pathSegments: string[]): string;
/**
* Resolve the provided path segments using a forward slash (/) as a path separator.
* @param pathSegments The path segments to resolve.
* @returns The resolved path.
*/
export declare function resolvePath(...pathSegments: string[]): string;
/**
* Get the relative path from the provided basePath to the provided absolutePath. For example,
* pathRelativeTo("/my/path", "/") will return "my/path".
*/
export declare function pathRelativeTo(absolutePath: string, basePath: string): string;
/**
* Replace all of the backslashes (\) with forward slashes (/), unless the provided osPlatform is
* win32. If the osPlatform is win32, then all forward slashes (/) will be replaced with backslahes
* (\).
* @param pathString The path to normalize.
* @returns The normalized path.
*/
export declare function normalizePath(pathString: string, osPlatform?: string): string;
/**
* Return the provided path without its file extension.
* @param path The path.
*/
export declare function pathWithoutFileExtension(path: string): string;
/**
* Get the root path of the provided path string. If the provided path string is relative (not
* rooted), then undefined will be returned.
* @param pathString The path to get the root of.
*/
export declare function getRootPath(pathString: string): string | undefined;
/**
* Check whether or not the provided pathString is rooted (absolute).
* @param pathString The path to check.
* @returns Whether or not the provided pathString is rooted (absolute).
*/
export declare function isRooted(pathString: string): boolean;
/**
* Get the name/last segment of the provided path string.
* @param pathString The path to get the name/last segment of.
* @returns The name/last segment of the provided path string.
*/
export declare function getName(pathString: string): string;
/**
* Get the name/last segment of the provided path string.
* @param pathString The path to get the name/last segment of.
* @returns The name/last segment of the provided path string.
*/
export declare function getPathName(pathString: string): string;
/**
* Get the path to the parent folder of the provided path string.
* @param pathString The path to the get the parent folder path of.
* @returns The path to the parent folder of the provided path string.
*/
export declare function getParentFolderPath(pathString: string): string;
//# sourceMappingURL=path.d.ts.map