//#region src/url/index.d.ts /** * Convert a file URL to a file path * * @param url - A file URL string or URL object * @returns The file path * @throws {TypeError} If the URL is not a file URL * * @example * ```ts * fileURLToPath('file:///foo/bar/test.js') * // => '/foo/bar/test.js' * * fileURLToPath(new URL('file:///foo/bar/test.js')) * // => '/foo/bar/test.js' * ``` */ declare function fileURLToPath(url: string | URL): string; /** * Convert a file path to a file URL * * @param path - A file path * @returns A URL object representing the file URL * * @example * ```ts * pathToFileURL('/foo/bar/test.js') * // => URL { href: 'file:///foo/bar/test.js' } * * pathToFileURL('/foo/bar/test file.js') * // => URL { href: 'file:///foo/bar/test%20file.js' } * ``` */ declare function pathToFileURL(path: string): URL; //#endregion export { fileURLToPath, pathToFileURL };