///
import { PortablePath } from '@yarnpkg/fslib';
import { Readable, Transform } from 'stream';
export declare function escapeRegExp(str: string): string;
export declare function overrideType(val: unknown): asserts val is T;
export declare function assertNever(arg: never): never;
export declare function validateEnum(def: {
[key: string]: T;
}, value: string): T;
export declare function mapAndFilter(iterable: Iterable, cb: (value: In) => Out | typeof mapAndFilterSkip): Array;
export declare namespace mapAndFilter {
var skip: typeof mapAndFilterSkip;
}
declare const mapAndFilterSkip: unique symbol;
export declare function mapAndFind(iterable: Iterable, cb: (value: In) => Out | typeof mapAndFindSkip): Out | undefined;
export declare namespace mapAndFind {
var skip: typeof mapAndFindSkip;
}
declare const mapAndFindSkip: unique symbol;
export declare function isIndexableObject(value: unknown): value is {
[key: string]: unknown;
};
export declare function getFactoryWithDefault(map: Map, key: K, factory: () => T): T;
export declare function getArrayWithDefault(map: Map>, key: K): T[];
export declare function getSetWithDefault(map: Map>, key: K): Set;
export declare function getMapWithDefault(map: Map>, key: K): Map;
export declare function releaseAfterUseAsync(fn: () => Promise, cleanup?: (() => any) | null): Promise;
export declare function prettifyAsyncErrors(fn: () => Promise, update: (message: string) => string): Promise;
export declare function prettifySyncErrors(fn: () => T, update: (message: string) => string): T;
export declare function bufferStream(stream: Readable): Promise;
export declare class BufferStream extends Transform {
private readonly chunks;
_transform(chunk: Buffer, encoding: string, cb: any): void;
_flush(cb: any): void;
}
export declare class DefaultStream extends Transform {
private readonly ifEmpty;
active: boolean;
constructor(ifEmpty?: Buffer);
_transform(chunk: Buffer, encoding: string, cb: any): void;
_flush(cb: any): void;
}
export declare function dynamicRequire(path: string): any;
export declare function dynamicRequireNoCache(path: PortablePath): any;
export declare function sortMap(values: Iterable, mappers: ((value: T) => string) | Array<(value: T) => string>): T[];
/**
* Combines an Array of glob patterns into a regular expression.
*
* @param ignorePatterns An array of glob patterns
*
* @returns A `string` representing a regular expression or `null` if no glob patterns are provided
*/
export declare function buildIgnorePattern(ignorePatterns: Array): string | null;
export declare function replaceEnvVariables(value: string, { env }: {
env: {
[key: string]: string | undefined;
};
}): string;
export {};