@pkerschbaum/code-oss-file-service
Version:
VS Code ([microsoft/vscode](https://github.com/microsoft/vscode)) includes a rich "`FileService`" and "`DiskFileSystemProvider`" abstraction built on top of Node.js core modules (`fs`, `path`) and Electron's `shell` module. This package allows to use that
46 lines • 2.54 kB
TypeScript
export declare function isPathSeparator(code: number): boolean;
/**
* 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;
/**
* Takes a Windows OS path (using backward or forward slashes) and turns it into a posix path:
* - turns backward slashes into forward slashes
* - makes it absolute if it starts with a drive letter
* 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 toPosixPath(osPath: string): string;
/**
* Computes the _root_ this path, like `getRoot('c:\files') === c:\`,
* `getRoot('files:///files/path') === files:///`,
* or `getRoot('\\server\shares\path') === \\server\shares\`
*/
export declare function getRoot(path: string, sep?: string): string;
/**
* Check if the path follows this pattern: `\\hostname\sharename`.
*
* @see https://msdn.microsoft.com/en-us/library/gg465305.aspx
* @return A boolean indication if the path is a UNC path, on none-windows
* always false.
*/
export declare function isUNC(path: string): boolean;
export declare function isValidBasename(name: string | null | undefined, isWindowsOS?: boolean): boolean;
export declare function isEqual(pathA: string, pathB: string, ignoreCase?: boolean): boolean;
export declare function isEqualOrParent(base: string, parentCandidate: string, ignoreCase?: boolean, separator?: "/" | "\\"): boolean;
export declare function isWindowsDriveLetter(char0: number): boolean;
export declare function sanitizeFilePath(candidate: string, cwd: string): string;
export declare function isRootOrDriveLetter(path: string): boolean;
export declare function hasDriveLetter(path: string, continueAsWindows?: boolean): boolean;
export declare function getDriveLetter(path: string): string | undefined;
export declare function indexOfPath(path: string, candidate: string, ignoreCase?: boolean): number;
export interface IPathWithLineAndColumn {
path: string;
line?: number;
column?: number;
}
export declare function parseLineAndColumnAware(rawPath: string): IPathWithLineAndColumn;
export declare function randomPath(parent?: string, prefix?: string, randomLength?: number): string;
//# sourceMappingURL=extpath.d.ts.map