export declare const basename: typeof _posix.basename | typeof _win32.basename; /** * Return the last portion of a `path`. Trailing directory separators are ignored. * @param path to process * @param ext of path directory */ declare function basename_2(path: string, ext?: string): string; /** * Return the last portion of a `path`. Trailing directory separators are ignored. * @param path to process * @param ext of path directory */ declare function basename_3(path: string, ext?: string): string; /** Determines the common path from a set of paths, using an optional separator, * which defaults to the OS default separator. * * ```ts * import { common } from "https://deno.land/std@$STD_VERSION/path/mod.ts"; * const p = common([ * "./deno/std/path/mod.ts", * "./deno/std/fs/mod.ts", * ]); * console.log(p); // "./deno/std/" * ``` */ export declare function common(paths: string[], sep?: string): string; export declare const delimiter: string; declare const delimiter_2 = ";"; declare const delimiter_3 = ":"; export declare const dirname: typeof _posix.dirname | typeof _win32.dirname; /** * Return the directory name of a `path`. * @param path to determine name for */ declare function dirname_2(path: string): string; /** * Return the directory name of a `path`. * @param path to determine name for */ declare function dirname_3(path: string): string; export declare const extname: typeof _posix.extname | typeof _win32.extname; /** * Return the extension of the `path` with leading period. * @param path with extension * @returns extension (ex. for `file.ts` returns `.ts`) */ declare function extname_2(path: string): string; /** * Return the extension of the `path` with leading period. * @param path with extension * @returns extension (ex. for `file.ts` returns `.ts`) */ declare function extname_3(path: string): string; export declare const format: typeof _posix.format | typeof _win32.format; /** * Generate a path from `FormatInputPathObject` object. * @param pathObject with path */ declare function format_2(pathObject: FormatInputPathObject): string; /** * Generate a path from `FormatInputPathObject` object. * @param pathObject with path */ declare function format_3(pathObject: FormatInputPathObject): string; export declare type FormatInputPathObject = Partial; export declare const fromFileUrl: typeof _posix.fromFileUrl | typeof _win32.fromFileUrl; /** * Converts a file URL to a path string. * * ```ts * import { fromFileUrl } from "./win32.ts"; * fromFileUrl("file:///home/foo"); // "\\home\\foo" * fromFileUrl("file:///C:/Users/foo"); // "C:\\Users\\foo" * fromFileUrl("file://localhost/home/foo"); // "\\\\localhost\\home\\foo" * ``` * @param url of a file URL */ declare function fromFileUrl_2(url: string | URL): string; /** * Converts a file URL to a path string. * * ```ts * import { fromFileUrl } from "./posix.ts"; * fromFileUrl("file:///home/foo"); // "/home/foo" * ``` * @param url of a file URL */ declare function fromFileUrl_3(url: string | URL): string; export declare interface GlobOptions { /** Extended glob syntax. * See https://www.linuxjournal.com/content/bash-extended-globbing. Defaults * to true. */ extended?: boolean; /** Globstar syntax. * See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option. * If false, `**` is treated like `*`. Defaults to true. */ globstar?: boolean; /** Whether globstar should be case insensitive. */ caseInsensitive?: boolean; /** Operating system. Defaults to the native OS. */ os?: OSType; } /** Convert a glob string to a regular expression. * * Tries to match bash glob expansion as closely as possible. * * Basic glob syntax: * - `*` - Matches everything without leaving the path segment. * - `?` - Matches any single character. * - `{foo,bar}` - Matches `foo` or `bar`. * - `[abcd]` - Matches `a`, `b`, `c` or `d`. * - `[a-d]` - Matches `a`, `b`, `c` or `d`. * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`. * - `[[::]]` - Matches any character belonging to ``. * - `[[:alnum:]]` - Matches any digit or letter. * - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`. * - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes * for a complete list of supported character classes. * - `\` - Escapes the next character for an `os` other than `"windows"`. * - \` - Escapes the next character for `os` set to `"windows"`. * - `/` - Path separator. * - `\` - Additional path separator only for `os` set to `"windows"`. * * Extended syntax: * - Requires `{ extended: true }`. * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`. * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same. * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`. * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`. * - `!(foo|bar)` - Matches anything other than `{foo,bar}`. * - See https://www.linuxjournal.com/content/bash-extended-globbing. * * Globstar syntax: * - Requires `{ globstar: true }`. * - `**` - Matches any number of any path segments. * - Must comprise its entire path segment in the provided glob. * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option. * * Note the following properties: * - The generated `RegExp` is anchored at both start and end. * - Repeating and trailing separators are tolerated. Trailing separators in the * provided glob have no meaning and are discarded. * - Absolute globs will only match absolute paths, etc. * - Empty globs will match nothing. * - Any special glob syntax must be contained to one path segment. For example, * `?(foo|bar/baz)` is invalid. The separator will take precedence and the * first segment ends with an unclosed group. * - If a path segment ends with unclosed groups or a dangling escape prefix, a * parse error has occurred. Every character for that segment is taken * literally in this event. * * Limitations: * - A negative group like `!(foo|bar)` will wrongly be converted to a negative * look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly * fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively, * `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if * the group occurs not nested at the end of the segment. */ export declare function globToRegExp(glob: string, { extended, globstar: globstarOption, os, caseInsensitive, }?: GlobToRegExpOptions): RegExp; export declare type GlobToRegExpOptions = GlobOptions; export declare const isAbsolute: typeof _win32.isAbsolute | typeof _posix.isAbsolute; /** * Verifies whether path is absolute * @param path to verify */ declare function isAbsolute_2(path: string): boolean; /** * Verifies whether provided path is absolute * @param path to be verified as absolute */ declare function isAbsolute_3(path: string): boolean; /** Test whether the given string is a glob */ export declare function isGlob(str: string): boolean; export declare const join: typeof _posix.join | typeof _win32.join; /** * Join all given a sequence of `paths`,then normalizes the resulting path. * @param paths to be joined and normalized */ declare function join_2(...paths: string[]): string; /** * Join all given a sequence of `paths`,then normalizes the resulting path. * @param paths to be joined and normalized */ declare function join_3(...paths: string[]): string; /** Like join(), but doesn't collapse "**\/.." when `globstar` is true. */ export declare function joinGlobs(globs: string[], { extended, globstar }?: GlobOptions): string; export declare const normalize: typeof _win32.normalize | typeof _posix.normalize; /** * Normalizes a `path` * @param path to normalize */ declare function normalize_2(path: string): string; /** * Normalize the `path`, resolving `'..'` and `'.'` segments. * @param path to be normalized */ declare function normalize_3(path: string): string; /** Like normalize(), but doesn't collapse "**\/.." when `globstar` is true. */ export declare function normalizeGlob(glob: string, { globstar }?: GlobOptions): string; declare type OSType = "windows" | "linux" | "darwin"; export declare const parse: typeof _posix.parse | typeof _win32.parse; /** * Return a `ParsedPath` object of the `path`. * @param path to process */ declare function parse_2(path: string): ParsedPath; /** * Return a `ParsedPath` object of the `path`. * @param path to process */ declare function parse_3(path: string): ParsedPath; /** * A parsed path object generated by path.parse() or consumed by path.format(). */ export declare interface ParsedPath { /** * The root of the path such as '/' or 'c:\' */ root: string; /** * The full directory path such as '/home/user/dir' or 'c:\path\dir' */ dir: string; /** * The file name including extension (if any) such as 'index.html' */ base: string; /** * The file extension (if any) such as '.html' */ ext: string; /** * The file name without extension (if any) such as 'index' */ name: string; } export declare const posix: typeof _posix; declare namespace _posix { export { resolve_3 as resolve, normalize_3 as normalize, isAbsolute_3 as isAbsolute, join_3 as join, relative_3 as relative, toNamespacedPath_3 as toNamespacedPath, dirname_3 as dirname, basename_3 as basename, extname_3 as extname, format_3 as format, parse_3 as parse, fromFileUrl_3 as fromFileUrl, toFileUrl_3 as toFileUrl, sep_3 as sep, delimiter_3 as delimiter } } export declare const relative: typeof _posix.relative | typeof _win32.relative; /** * It will solve the relative path from `from` to `to`, for instance: * from = 'C:\\orandea\\test\\aaa' * to = 'C:\\orandea\\impl\\bbb' * The output of the function should be: '..\\..\\impl\\bbb' * @param from relative path * @param to relative path */ declare function relative_2(from: string, to: string): string; /** * Return the relative path from `from` to `to` based on current working directory. * @param from path in current working directory * @param to path in current working directory */ declare function relative_3(from: string, to: string): string; export declare const resolve: typeof _win32.resolve | typeof _posix.resolve; /** * Resolves path segments into a `path` * @param pathSegments to process to path */ declare function resolve_2(...pathSegments: string[]): string; /** * Resolves `pathSegments` into an absolute path. * @param pathSegments an array of path segments */ declare function resolve_3(...pathSegments: string[]): string; export declare const SEP: string; export declare const sep: string; declare const sep_2 = "\\"; declare const sep_3 = "/"; export declare const SEP_PATTERN: RegExp; export declare const toFileUrl: typeof _posix.toFileUrl | typeof _win32.toFileUrl; /** * Converts a path string to a file URL. * * ```ts * import { toFileUrl } from "./win32.ts"; * toFileUrl("\\home\\foo"); // new URL("file:///home/foo") * toFileUrl("C:\\Users\\foo"); // new URL("file:///C:/Users/foo") * toFileUrl("\\\\127.0.0.1\\home\\foo"); // new URL("file://127.0.0.1/home/foo") * ``` * @param path to convert to file URL */ declare function toFileUrl_2(path: string): URL; /** * Converts a path string to a file URL. * * ```ts * import { toFileUrl } from "./posix.ts"; * toFileUrl("/home/foo"); // new URL("file:///home/foo") * ``` * @param path to convert to file URL */ declare function toFileUrl_3(path: string): URL; export declare const toNamespacedPath: typeof _posix.toNamespacedPath | typeof _win32.toNamespacedPath; /** * Resolves path to a namespace path * @param path to resolve to namespace */ declare function toNamespacedPath_2(path: string): string; /** * Resolves path to a namespace path * @param path to resolve to namespace */ declare function toNamespacedPath_3(path: string): string; export declare const win32: typeof _win32; declare namespace _win32 { export { resolve_2 as resolve, normalize_2 as normalize, isAbsolute_2 as isAbsolute, join_2 as join, relative_2 as relative, toNamespacedPath_2 as toNamespacedPath, dirname_2 as dirname, basename_2 as basename, extname_2 as extname, format_2 as format, parse_2 as parse, fromFileUrl_2 as fromFileUrl, toFileUrl_2 as toFileUrl, sep_2 as sep, delimiter_2 as delimiter } } export { }