import { UpdateJsonFileOptions } from './json-file'; import { TreeLike } from './tree'; import { TsConfigJson } from './ts-config'; /** * Retrieves a TypeScript configuration file (`tsconfig.json`) from a given tree structure. * The function can fetch a specific `tsconfig` file by using an optional infix to target variant configurations. * * @param tree - The tree-like structure containing the file(s). * @param infix - Optional. A string used to specify a variant of the tsconfig file (e.g., 'prod' for 'tsconfig.prod.json'). * @returns The TypeScript configuration object (`TsConfigJson`) from the specified file. * * @template Tree - A generic type that must conform to a tree-like interface, allowing file retrieval. */ export declare function GetTsConfigJson(tree: Tree, infix?: string): TsConfigJson; /** * Updates the `paths` property in the TypeScript configuration file (`tsconfig.json`) of a given project tree. * * This function allows for custom modifications to the `paths` property, which is used for module resolution aliases in TypeScript. * The modifications are made by passing an updater function that directly mutates the `paths` object. * * @param tree - The project tree structure which contains the `tsconfig.json` file. * @param updater - A function that receives the current `paths` object (from `tsconfig.json`) and mutates it to apply desired changes. * @param options - Optional configuration options for updating the `tsconfig.json` file. Defaults to an empty object if not provided. * If `options.basePath` is not set, it defaults to using an infix of 'base'. * * @typeParam Tree - A generic type that extends `TreeLike`, representing the structure of the project tree. * * @remarks * This function internally calls `UpdateTsConfigJson` to handle the reading and writing of the `tsconfig.json` file. * It ensures that the `compilerOptions` and `paths` properties exist before calling the updater function. */ export declare function UpdateTsConfigPaths(tree: Tree, updater: (paths: Record>) => void, options?: UpdateTsConfigJsonOptions): void; export interface UpdateTsConfigJsonOptions extends UpdateJsonFileOptions { infix?: string; basePath?: string; } export declare function UpdateTsConfigJson(tree: Tree, updater: (tsConfig: TsConfigJson) => void, options?: UpdateTsConfigJsonOptions): void; export declare function UpdateTsConfigJson(tree: Tree, updater: (tsConfig: TsConfigJson) => Promise, options?: UpdateTsConfigJsonOptions): Promise; export declare function HasTsConfigJson(tree: Tree, options?: UpdateTsConfigJsonOptions): boolean; export interface UpdateProjectTsConfigJsonOptions extends UpdateJsonFileOptions { infix?: string; project: string; } export declare function UpdateProjectTsConfigJson(tree: Tree, updater: (tsConfig: TsConfigJson) => void, options: UpdateProjectTsConfigJsonOptions): void; export declare function UpdateProjectTsConfigJson(tree: Tree, updater: (tsConfig: TsConfigJson) => Promise, options: UpdateProjectTsConfigJsonOptions): Promise;