/// <reference types="node" />
/// <reference types="node" />
import * as path from "path";
/**
 * Executes a command with STDOUT > STDERR.
 */
export declare function exec(command: string, options: {
    cwd: string;
    env?: Record<string, string>;
}): void;
/**
 * Executes command and returns STDOUT. If the command fails (non-zero), throws an error.
 */
export declare function execCapture(command: string, options: {
    cwd: string;
}): Buffer;
/**
 * Executes `command` and returns its value or undefined if the command failed.
 */
export declare function execOrUndefined(command: string, options: {
    cwd: string;
}): string | undefined;
export interface WriteFileOptions {
    /**
     * Whether the generated file should be marked as executable.
     *
     * @default false
     */
    executable?: boolean;
    /**
     * Whether the generated file should be readonly.
     *
     * @default false
     */
    readonly?: boolean;
}
export declare function getFilePermissions(options: WriteFileOptions): string;
export declare function writeFile(filePath: string, data: any, options?: WriteFileOptions): void;
/**
 * Decamelizes the keys of an object structure, recursing through child objects and arrays.
 * @experimental
 */
export interface DecamelizeRecursivelyOptions {
    /**
     * Max depth to recurse before erroring.
     * @default 10
     */
    maxDepth?: number;
    /**
     * Returns true when a key should be decamelized
     * @default - all keys are decamelized
     */
    shouldDecamelize?: (path: string[], value: any) => boolean;
    /**
     * Separator for decamelizing.
     * @default "_"
     */
    separator?: string;
    /**
     * Current path.
     * @internal
     */
    path?: string[];
}
export declare function decamelizeKeysRecursively(input: any, opt?: DecamelizeRecursivelyOptions): any;
/**
 * Returns false if value is unset or a falsey value, and true otherwise.
 * @param value an environment variable
 */
export declare function isTruthy(value: string | undefined): boolean;
/**
 * Type of a map mapping strings to some arbitrary type
 */
export type Obj<T> = {
    [key: string]: T;
};
/**
 * Return whether the given value is an object
 *
 * Even though arrays and instances of classes technically are objects, we
 * usually want to treat them differently, so we return false in those cases.
 */
export declare function isObject(x: any): x is Obj<any>;
/**
 * Recursively merge objects together
 *
 * The leftmost object is mutated and returned. Arrays are not merged
 * but overwritten just like scalars.
 *
 * If an object is merged into a non-object, the non-object is lost.
 *
 * `undefined`s will cause a value to be deleted if destructive is enabled.
 */
export declare function deepMerge(objects: Array<Obj<any> | undefined>, destructive?: boolean): Obj<any>;
export declare function dedupArray<T>(array: T[]): T[];
/**
 * Returns a sorted version of `x` or `undefined` if it is an empty array or object.
 */
export declare function sorted<T>(x: T): unknown[] | T | undefined;
export declare function formatAsPythonModule(name: string): string;
/**
 * Extract git version number from command line
 *
 * @param gitVersionOutput the output from `git version` CLI
 * @returns the version of git
 */
export declare function getGitVersion(gitVersionOutput: string): string;
export declare function kebabCaseKeys<T = unknown>(obj: T, recursive?: boolean): T;
export declare function snakeCaseKeys<T = unknown>(obj: T, recursive?: boolean, exclusiveForRecordKeys?: string[]): T;
export declare function tryReadFile(file: string): Promise<string>;
export declare function tryReadFileSync(file: string): string | undefined;
export declare function isWritable(file: string): boolean;
/**
 * Asserts that the file should be executable. Always returns true on Windows.
 *
 * In Windows, the executable attribute is stored in the system setting PATHEXT, not in each file. Then, checking for executability is equivalent to checking for existence. To bypass checking for executability, we always return true on Windows.
 *
 * @param filePath The path to the file
 * @param shouldBeExecutable Whether the file should be executable
 * @returns true if `filePath` executable attribute matches `shouldBeExecutable` or if the platform is Windows, false otherwise
 */
export declare function assertExecutablePermissions(filePath: string, shouldBeExecutable: boolean): boolean;
export declare function isExecutable(file: string): boolean;
export declare function getNodeMajorVersion(): number | undefined;
export declare function anySelected(options: (boolean | undefined)[]): boolean;
export declare function multipleSelected(options: (boolean | undefined)[]): boolean;
/**
 * Checks if a path is a FS root
 *
 * Optional uses a provided OS specific path implementation,
 * defaults to use the implementation for the current OS.
 *
 * @internal
 */
export declare function isRoot(dir: string, osPathLib?: typeof path): boolean;
/**
 * Run up project tree to find a file or directory
 *
 * @param lookFor the file or directory to look for
 * @param cwd current working directory, must be an absolute path
 * @returns path to the file or directory we are looking for, undefined if not found
 */
export declare function findUp(lookFor: string, cwd?: string): string | undefined;
