import * as ts from 'typescript'; import { KeyValuePair, FormatSettings, PropertyAssignment, TemplateDependency, TypeScriptFileUpdate, RouteEntry } from '@igniteui/cli-core'; import { AngularRouteLike, AngularDecoratorOptions } from './types'; export declare class AngularTypeScriptFileUpdate extends TypeScriptFileUpdate { readonly filePath: string; readonly standalone: boolean; protected formatSettings?: FormatSettings; /** * Creates a new AngularTypeScriptFileUpdate instance for the given file. * @param standalone Whether the file is a standalone component. * @param formatSettings Custom formatting settings to apply. */ constructor(filePath: string, standalone?: boolean, formatSettings?: FormatSettings, compilerOptions?: ts.CompilerOptions); /** * Adds a route entry to the Angular routing module's routes variable instance. * @param route The route to add. * @param multiline Whether to format the new entry as multiline. * @param prepend Whether to insert the new entry before the anchor element. * If no anchor is provided, the new entry will be added to the start or end of the array. * @param anchorElement The anchor element to insert to. */ addRoute(route: AngularRouteLike, multiline?: boolean, prepend?: boolean, anchorElement?: PropertyAssignment): void; addChildRoute(parentPath: string, route: AngularRouteLike, asIdentifier?: boolean, multiline?: boolean): void; /** * Adds an import identifier to a standalone component's metadata. * @param dep The dependency to add to the standalone component's metadata. * @param variables Variables to replace in the dependency strings. * @param multiline Whether to format the new entry as multiline. */ addStandaloneComponentMeta(dep: TemplateDependency, variables?: KeyValuePair, multiline?: boolean): void; /** * Adds metadata to an NgModule decorator. * @param dep The dependency to add to the NgModule decorator. * @param variables Variables to replace in the dependency strings. * @param multiline Whether to format the new entry as multiline. */ addNgModuleMeta(dep: TemplateDependency, variables?: KeyValuePair, multiline?: boolean): void; /** * Sorts the elements of an Angular decorator property that is an {@link ts.ArrayLiteralExpression}. * @param decoratorName The name of the decorator to look for. * @param target The target metadata property to sort. * * @remarks The {@link target} must be a {@link ts.PropertyAssignment} with an initializer that is an {@link ts.ArrayLiteralExpression}. */ sortDecoratorPropertyInitializer(decoratorName: string, target: AngularDecoratorOptions): void; /** * Adds metadata to the arguments provided in `TestBed.configureTestingModule`. * @param dep The dependency to add to the testing module's metadata. * @param variables Variables to replace in the dependency strings. * @param multiline Whether to format the new entry as multiline. */ addTestingModuleMeta(dep: TemplateDependency, variables?: KeyValuePair, multiline?: boolean): void; /** * Includes `{ bindToComponentInputs: true }` for a `forRoot` call in an `NgModule`'s `imports` member. * * For standalone projects, includes an `withComponentInputBinding` call in a `providers` variable. Mainly present in an `app.config` file. */ allowComponentInputBinding(): void; /** * Provides the `HttpClient` for standalone applications. */ provideHttpClientForStandaloneAppConfig(): void; protected buildRouteStructure(route: AngularRouteLike, multiline: boolean): RouteEntry[]; /** * Add an imort declaration for the dependency. * @param meta The metadata to use for the import declaration. * @param moduleName The name of the module to import from. * @param variables Variables to replace in the dependency strings. */ private addImportDeclarationForDependency; /** * Applies mutations to an Angular decorator's metadata. * @param decoratorName The name of the decorator to update. * @param meta The metadata to use for the mutations. * @param multiline Whether to format the new entry as multiline. */ private applyDecoratorMutations; /** * Updates an Angular decorator's metadata. * @param name The name of the decorator to update. * @param meta Names of identifiers to be added. * @param target The target metadata property to update. * @param multiline Whether to format the new entry as multiline. */ private addMetaToNgDecorator; /** * Updates Angular's metadata related to NgModules, Standalone Components or TestingModules. * @param target The name of the target metadata property to update. * @param targetMetaProp The property that is to be updated. * @param identifiers The identifiers to add. * @param visitorCondition The condition to find the object literal that contains the target property. * @param multiline Whether to format the new entry as multiline. */ private mutateNgMeta; /** * Checks if a node has an ancestor with a specific decorator. * @param name The name of the decorator. * @param node The node to start checking from. */ private checkNgDecorator; /** * Finds a property assignment that exists in a specific NG decorator meta. * @param decoratorName The name of the decorator to check. * @param propName The property name to check. * @param node The node to start checking from. */ private findNgDecoratorProperty; /** * Calls `forRoot` on a module identifier. * @param dep The dependency to add to the module's metadata. * @param copy The copy of the module's metadata. * @param args The arguments to pass to the `forRoot` call. */ private addRootToModule; }