import { default as npath, type FormatInputPathObject } from 'path'; /** Normalize a string path, reducing '..' and '.' parts. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. @param path string path to normalize. @throws {TypeError} if `path` is not a string. */ export declare function normalize(path: string): string; /** Join all arguments together and normalize the resulting path. @param paths paths to join. @throws {TypeError} if any of the path segments is not a string. */ export declare function join(...paths: string[]): string; /** The right-most parameter is considered {to}. Other parameters are considered an array of {from}. Starting from leftmost {from} parameter, resolves {to} to an absolute path. If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. @param paths A sequence of paths or path segments. @throws {TypeError} if any of the arguments is not a string. */ export declare function resolve(...paths: string[]): string; /** 和 resolve 一样,但是保留最后一个 path 结尾的 / */ export declare function resolve_with_slash(...paths: string[]): string; /** 安全的解析用户提供的相对路径 rfp, 基于 fpd_root, 避免路径遍历攻击 返回 / 分割 (.fp 之后) 的路径,会保留文件夹尾部的 / */ export declare function resolve_safely(fpd_root: string, rfp: string): string; /** Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. If the given {path} is a zero-length string, `false` will be returned. @param path path to test. @throws {TypeError} if `path` is not a string. */ export declare function isAbsolute(path: string): boolean; /** Solve the relative path from {from} to {to} based on the current working directory. At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. @throws {TypeError} if either `from` or `to` is not a string. */ export declare function relative(from: string, to: string): string; /** Return the directory name of a path. Similar to the Unix dirname command. @param path the path to evaluate. @throws {TypeError} if `path` is not a string. */ export declare function dirname(path: string): string; /** Return the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path. @param path the path to evaluate. @param suffix optionally, an extension to remove from the result. @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. */ export declare function basename(path: string, suffix?: string): string; /** Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. @param path the path to evaluate. @throws {TypeError} if `path` is not a string. */ export declare function extname(path: string): string; /** `/` */ export declare const sep = "/"; /** The platform-specific file delimiter. ';' or ':'. */ export declare const delimiter: ":" | ";"; /** Returns an object from a path string - the opposite of format(). @param path path to evaluate. @throws {TypeError} if `path` is not a string. */ export declare function parse(path: string): npath.ParsedPath; /** Returns a path string from an object - the opposite of parse(). @param pathObject path to evaluate. */ export declare function format(pathObject: FormatInputPathObject): string; /** On Windows systems only, returns an equivalent namespace-prefixed path for the given path. If path is not a string, path will be returned without modifications. This method is meaningful only on Windows system. On POSIX systems, the method is non-operational and always returns path without modifications. */ export declare function toNamespacedPath(path: string): string; export declare const posix: typeof npath; export declare const win32: typeof npath; /** 统一使用 / 作为分隔符的 path 模块 */ export declare let path: { normalize: typeof normalize; join: typeof join; resolve: typeof resolve; resolve_with_slash: typeof resolve_with_slash; isAbsolute: typeof isAbsolute; relative: typeof relative; dirname: typeof dirname; basename: typeof basename; extname: typeof extname; sep: string; delimiter: ":" | ";"; parse: typeof parse; format: typeof format; toNamespacedPath: typeof toNamespacedPath; };