import https from "https"; import { FS } from "./fs"; import { LoggerWithErrors } from "./logging"; export declare function readFile(path: string): Promise; export declare function readFileSync(path: string): string; /** If a file doesn't exist, warn and tell the step it should have been generated by. */ export declare function readFileAndWarn(generatedBy: string, filePath: string): Promise>; export declare function readJsonSync(path: string): unknown; export declare function readJsonSync(path: string, predicate: (parsed: unknown) => parsed is T): T; export declare function readJson(path: string): Promise; export declare function readJson(path: string, predicate: (parsed: unknown) => parsed is T): Promise; export declare function tryReadJson(path: string): Promise; export declare function tryReadJson(path: string, predicate: (parsed: unknown) => parsed is T): Promise; export declare function writeFile(path: string, content: string): Promise; export declare function writeJson(path: string, content: unknown, formatted?: boolean): Promise; export declare function streamOfString(text: string): NodeJS.ReadableStream; export declare function stringOfStream(stream: NodeJS.ReadableStream, description: string): Promise; export declare function streamDone(stream: NodeJS.WritableStream): Promise; type FetchOptions = https.RequestOptions & { readonly retries?: boolean | number; readonly body?: string; }; export declare class Fetcher { private readonly agent; fetchJson(options: FetchOptions): Promise; fetch(options: FetchOptions): Promise; } /** Only used for testing. */ export declare function makeHttpRequest(options: FetchOptions): Promise; export declare function isDirectory(path: string): Promise; export declare function downloadAndExtractFile(url: string, log: LoggerWithErrors): Promise; export declare function streamToBuffer(stream: NodeJS.ReadableStream): Promise; export declare function gzip(input: NodeJS.ReadableStream): NodeJS.ReadableStream; export declare function unGzip(input: NodeJS.ReadableStream): NodeJS.ReadableStream; export declare function writeTgz(inputDirectory: string, outFileName: string): Promise; export declare function createTgz(dir: string, onError: (error: any) => void): NodeJS.ReadableStream; export declare function createGitHubStringSetGetter(repoPath: string, fallbackPath: string): () => Promise>; export {};