import { TreeLike } from './tree'; /** * Checks if a specified file within a tree-like structure is a valid YAML file. * * This function determines whether a file at a given path exists within the provided tree structure * and verifies if the content of the file is valid YAML. It utilizes a `TreeAdapter` to interact with * the tree structure, allowing file operations like checking existence and reading content. * * @param tree - An object representing a tree-like structure where files and directories are organized. * @param filePath - The path to the file within the tree structure to be checked. * @returns `true` if the file exists and contains valid YAML content, otherwise `false`. * * @typeparam Tree - A generic type that extends `TreeLike`, representing the structure containing the file. * * @example * * const fileTree = new FileTree(); * const result = HasYamlFile(fileTree, 'config/settings.yaml'); * console.log(result); // Outputs: true or false based on the file's validity as a YAML. * ``` */ export declare function HasYamlFile(tree: Tree, filePath: string): boolean; /** * Retrieves the contents of a JSON file and returns it as an object. * If the file does not exist and `create` flag is set to `true`, an empty JSON file will be created. * * @template T - The type of the returned JSON object. * @param tree - The file system tree-like object. * @param filePath - The path to the JSON file. * @param [create=false] - Flag indicating whether to create the file if it does not exist (default: false). * @throws If the JSON file does not exist and `create` flag is set to `false`. * @throws If the content of the JSON file could not be parsed. * @returns {T} The parsed JSON object. */ export declare function GetYamlFile(tree: TreeLike, filePath: string, create?: boolean): T; export interface UpdateYamlFileOptions { space?: string | number; /** * true - create the file if it does not exist */ coerce?: boolean; } export declare function UpdateYamlFile = Record>(tree: TreeLike, updaterOrYamlFile: T | ((yamlFile: T) => void), filePath: string, options?: UpdateYamlFileOptions): void; export declare function UpdateYamlFile = Record>(tree: TreeLike, updaterOrYamlFile: T | ((yamlFile: T) => Promise), filePath: string, options?: UpdateYamlFileOptions): Promise;