import { n as ResultAsync } from "./result-Dg2-rfn6.js"; import { n as fs_d_exports } from "./fs-iohSpuvY.js"; //#region src/node/path.d.ts declare namespace path_d_exports { export { toImportUrl, toPosixPath }; } /** * Convert a filesystem path to an ESM import specifier (a `file://` URL). * * Required wherever a filesystem path becomes a JavaScript import string — * dynamic `import()` calls or static import specifiers embedded in generated * source code. On Windows, raw paths like `C:\foo\bar.ts` contain `\f`, `\b`, * `\u`, and other sequences that JavaScript parses as string escapes, which * either crashes the bundler or breaks runtime resolution. The `file://` URL * form is platform-neutral (`file:///C:/foo/bar.ts` on Windows, * `file:///foo/bar.ts` on POSIX). * * @param filePath - An absolute filesystem path. * @returns A `file://` URL string suitable as an ESM import specifier. */ declare function toImportUrl(filePath: string): string; /** * Normalize a native path string to use forward-slash separators. * * `path.relative()` and `path.join()` return separators native to the OS * (`\` on Windows, `/` elsewhere). When paths flow into string operations — * regex matching, `includes()` / `startsWith()` checks, template-engine * lookups — Windows backslashes silently break POSIX-shaped patterns. * Normalizing once at the boundary lets downstream code assume `/`. * * Node's `path.join()` accepts forward slashes on Windows and produces * correct native paths during filesystem operations, so the normalized form * remains usable for subsequent path composition. * * @param p - A native path string. * @returns The path with all `\` replaced by `/`. */ declare function toPosixPath(p: string): string; declare namespace process_d_exports { export { ExecOutput, exec, exists, spawn }; } /** * Output from a successful command execution. */ interface ExecOutput { readonly stdout: string; readonly stderr: string; } /** * Execute a command with arguments and return the result. * * Wraps `child_process.execFile` into an async Result tuple. On failure, * the error includes stderr as a property for diagnostic access. * * @param params - The command and arguments to execute. * @returns A result tuple with stdout/stderr on success or an Error on failure. */ declare function exec(params: { readonly cmd: string; readonly args?: readonly string[]; readonly cwd?: string; }): ResultAsync; /** * Spawn an interactive process with inherited stdio. * * Returns the exit code of the child process. Stdio is inherited so the * child process shares the parent's terminal. * * @param cmd - The command to spawn. * @param args - Arguments to pass to the command. * @param cwd - Working directory for the child process. * @returns The exit code of the spawned process. */ declare function spawn(params: { readonly cmd: string; readonly args: readonly string[]; readonly cwd: string; }): Promise; /** * Check whether a binary is available on the system PATH. * * Uses `which` (unix) or `where` (windows) to resolve the binary * without executing it. * * @param cmd - The command name to check. * @returns `true` when the command is found on PATH. */ declare function exists(cmd: string): Promise; //#endregion export { fs_d_exports as fs, path_d_exports as path, process_d_exports as process }; //# sourceMappingURL=node.d.ts.map