import * as fs from "node:fs"; import type { Reader } from "./pipes.js"; export declare const isWindows: boolean; /** A snapshot of `process.env` with `undefined` values filtered out. */ export declare function getRealEnvVars(): Record; interface Symbols { /** Use this symbol to enable the provided object to be written to in * an output redirect within a template literal expression. * * @example * ```ts * class MyClass { * [$.symbols.writable](): WritableStream { * // return a WritableStream here * } * } * const myObj = new MyClass(); * await $`echo 1 > ${myObj}`; * ``` */ readonly writable: symbol; /** Use this symbol to enable the provided object to be read from in * an input redirect within a template literal expression. * * @example * ```ts * class MyClass { * [$.symbols.readable](): ReadableStream { * // return a ReadableStream here * } * } * const myObj = new MyClass(); * await $`gzip < ${myObj}`; * ``` */ readonly readable: symbol; } export declare const symbols: Symbols; /** * Delay used for certain actions. * * @remarks Providing just a number will use milliseconds. */ export type Delay = number | `${number}ms` | `${number}s` | `${number}m` | `${number}m${number}s` | `${number}h` | `${number}h${number}m` | `${number}h${number}m${number}s`; /** Converts a {@link Delay} value into the equivalent number of milliseconds. */ export declare function delayToMs(delay: Delay): number; export declare function resolvePath(cwd: string, arg: string): string; export declare class Box { value: T; constructor(value: T); } export declare class TreeBox { #private; constructor(value: T | TreeBox); getValue(): T; setValue(value: T): void; createChild(): TreeBox; } /** A special kind of tree box that wraps logging so that terminal static * text (e.g. a host's progress bars) is momentarily cleared during writes. */ export declare class LoggerTreeBox extends TreeBox<(...args: any[]) => void> { getValue(): (...args: any[]) => void; } /** lstat that doesn't throw when the path is not found. */ export declare function safeLstat(path: string): Promise; /** * Gets an executable shebang from the provided file path. * @returns * - An object outlining information about the shebang. * - `undefined` if the file exists, but doesn't have a shebang. * - `false` if the file does NOT exist. */ export declare function getExecutableShebangFromPath(path: string): Promise; export interface ShebangInfo { stringSplit: boolean; command: string; } export declare function getExecutableShebang(reader: Reader): Promise; export declare function abortSignalToPromise(signal: AbortSignal): { [Symbol.dispose](): void; promise: Promise; }; export declare function errorToString(err: unknown): string; export {};