import { Tree } from '@nx/devkit'; import { PolarisCliConfigData, PolarisCliProject, PolarisCliProjectType, PolarisControllerProject, PolarisControllerProjectType, PolarisLibraryProject } from './polaris-cli-config-data'; import { NormalizedLibraryClassGeneratorSchema, NormalizedProjectGeneratorSchema } from './schema'; /** * Provides access to and manages the Polaris CLI configuration file. */ export declare class PolarisCliConfig { protected host: Tree; /** * The config data of this project. * * While this can be modified directly, it is recommended to use the methods provided by this class. */ data: PolarisCliConfigData; protected constructor(data: PolarisCliConfigData, host: Tree); /** * Reads the `PolarisCliConfig` from file or initializes an empty `PolarisCliConfig` object. */ static readFromFile(host: Tree): PolarisCliConfig; /** Writes the current state of the config to the respective config file. */ writeToFile(): void; /** * Adds a new project to the config. */ addProject(name: string, config: PolarisCliProject): PolarisCliProject; /** * @returns The {@link PolarisCliProject} with the specified `name`. */ getProject(name: string): PolarisCliProject; /** * Ensures that the project with the specified `name` exists and that it is of the expected `type` * and then returns it. */ getAndValidateProject(name: string, type: PolarisCliProjectType.Library): PolarisLibraryProject; getAndValidateProject(name: string, type: PolarisControllerProjectType): PolarisControllerProject; /** * Gets the library project with the name `options.projectName` or creates it, if it does not exist. */ getOrCreateLibraryProject(options: NormalizedLibraryClassGeneratorSchema): PolarisLibraryProject; /** * Registers the generated Polaris type for CRD generation and adds a library project, * if it does not exist yet. */ registerPolarisTypeAsCrd(options: NormalizedLibraryClassGeneratorSchema, polarisTypeName: string): void; /** * Gets the controller project with the name `options.projectName` or creates it, if it does not exist. */ getOrCreateControllerProject(options: NormalizedProjectGeneratorSchema, type: PolarisControllerProjectType): PolarisControllerProject; }