export { rmSync } from "node:fs"; export declare const ensureDir: (path: string) => string; export declare const readFile: (path: string) => string; export declare const writeFile: (path: string, contents: string) => string; export declare const rewriteFile: (path: string, transform: (contents: string) => string) => string; export declare const readJson: (path: string) => Record; export declare const writeJson: (path: string, data: object) => void; export type JsonTransformer = (data: object) => object; export declare const rewriteJson: (path: string, transform: (data: object) => object) => void; export declare const rmRf: (target: string) => void; export declare const cpR: (from: string, to: string) => void; export type WalkOptions = { ignoreDirsMatching?: RegExp; ignoreFilesMatching?: RegExp; excludeFiles?: boolean; excludeDirs?: boolean; exclude?: (path: string) => boolean; include?: (path: string) => boolean; }; export declare const walkPaths: (dir: string, options?: WalkOptions) => string[]; /** Fetch the file and directory paths from a path, uri, or `import.meta.url` */ export declare const filePath: (path: string) => string; export declare const fileName: () => string; export declare const dirName: () => string; export declare const fromHere: (...joinWith: string[]) => string; export declare const fromCwd: (...joinWith: string[]) => string; export declare const fromHome: (...joinWith: string[]) => string; export declare const fsRoot: string; export declare const findPackageRoot: (fromDir?: string) => string | null; export declare const assertPackageRoot: (fromDir?: string) => string; export declare const findPackageAncestors: (fromDir?: string) => string[]; export declare const readPackageJsonAncestors: (fromDir?: string) => any[]; export declare const fromPackageRoot: (...joinWith: string[]) => string; export declare const readPackageJson: (startDir?: string) => any; export declare const getSourceControlPaths: () => string[]; export declare const tsFileMatcher: RegExp; export declare const getSourceFilePaths: (dir?: string) => string[]; export type SourceFileEntry = [path: string, contents: string]; export declare const getSourceFileEntries: (dir?: string) => SourceFileEntry[]; export type ReplacementDictionary = Record; export type Matchers = ReadonlyArray; export type Matcher = { pattern: RegExp; replacement: string; }; /** * Given a directory and a set of {@link Matchers}, recursively walks * the directory and applies every set of changes in the dictionary * to all files except those matching `ignoreFilesMatching`. */ export declare const findReplaceAll: (matchDictionary: ReplacementDictionary, ignoreFilesMatching: RegExp) => (dirPath: string) => void;