import { WorkspaceDefinition } from '@angular-devkit/core/src/workspace'; import { Tree } from '@angular-devkit/schematics'; import { Element, Migration, parse5, ResolvedResource } from '@angular/cdk/schematics'; import type { UpdateRecorder } from '@angular/cdk/schematics/update-tool/update-recorder'; import { Schema } from './ng-add/schema'; /** Whether the Angular module in the given path has the specified provider. */ export declare function hasNgModuleProvider(tree: Tree, modulePath: string, providerName: string): boolean; /** * Import and add module to specific module path. * @param host the tree we are updating * @param modulePath src location of the module to import * @param moduleName name of module to import * @param src src location to import */ export declare function addModuleImportToModule(host: Tree, modulePath: string, moduleName: string, src: string, recorder: UpdateRecorder): void; /** * Iterate over all nodes recursively and perform the given action. */ export declare function iterateNodes(contentOrRoot: string | Element, nodeAction: (node: Element) => void): void; export interface NodeCheck { is(name: string): boolean; hasAttribute(...name: string[]): boolean; } export declare function nodeCheck(element: Element): NodeCheck; export declare function findReferenceAttribute(element: Element): parse5.Token.Attribute | undefined; export declare class MigrationRecorderRegistry { private _migration; private _elements; get empty(): boolean; constructor(_migration: Migration); add(resource: ResolvedResource, element: Element): void; forEach(action: (changeSet: MigrationElement) => void): void; } export declare class MigrationElement { readonly element: Element; readonly resource: ResolvedResource; readonly recorder: UpdateRecorder; readonly location: parse5.Token.ElementLocation; private _properties; constructor(element: Element, resource: ResolvedResource, recorder: UpdateRecorder, location?: parse5.Token.ElementLocation); /** Checks whether this element matches the given tag name. */ is(name: string): boolean; /** Remove this element. */ remove(): void; /** Remove all content of this element. */ removeContent(): void; removeEndTag(): void; removeStartTag(): void; rename(tagName: string, attributeSelector?: string): void; /** Prepends the given content before this element. */ prepend(content: string): void; /** Appends the given content behind this element. */ append(content: string): void; /** Insert the given content at the start of the element. */ insertStart(content: string): void; /** Insert the given content at the end of the element. */ insertBeforeEnd(content: string): void; findElements(filter: (node: Element) => boolean): MigrationElement[]; properties(): MigrationElementProperty[]; /** * Looks for attribute (e.g. example="...") or property (e.g. [example]="...") assignments. */ findProperty(name: string): MigrationElementProperty | undefined; findPropertyByValue(value: string): MigrationElementProperty | undefined; private _createMigrationElementProperty; appendProperty(name: string, value?: string): void; outerHtml(): string; innerHtml(): string; toString(): string; } export declare class MigrationElementProperty { readonly attribute: parse5.Token.Attribute; readonly location: parse5.Token.Location; readonly value: string | undefined; private _element; readonly name: string; get isProperty(): boolean; get isAttribute(): boolean; get nativeValue(): string; constructor(attribute: parse5.Token.Attribute, location: parse5.Token.Location, value: string | undefined, _element: MigrationElement); /** Remove this attribute from the element. */ remove(): void; /** Replace this attribute with a new attribute. */ replace(newAttribute: string): void; rename(newName: string): void; replaceValue(newValue: string): void; appendValue(value: string): void; toTextNode(): string; toString(): string; } export declare function getProjectName(options: Schema, workspace: WorkspaceDefinition): string;