import { Node } from '@angular/compiler'; import ts from 'typescript'; import { MigrationError } from '../utils/types'; import { AnalyzedFile, ElementCollector, ElementToMigrate } from './types'; /** * Analyzes a source file to find file that need to be migrated and the text ranges within them. * @param sourceFile File to be analyzed. * @param analyzedFiles Map in which to store the results. */ export declare function analyze(sourceFile: ts.SourceFile, analyzedFiles: Map): void; /** * calculates the level of nesting of the items in the collector * @param visitor The collector. * @param hasLineBreaks Whether the template contains line breaks or not. */ export declare function calculateNesting(visitor: ElementCollector, hasLineBreaks: boolean): void; /** * Edits the call expression of the file * @param template The template * @param callExpression The original call expression * @returns The new call expression */ export declare function editCallExpression(template: string, callExpression: ts.Node): string; /** * Edits the imports of the file * @param template The template * @param node The node to remove * @returns The new import */ export declare function editImports(template: string, node: ts.Node): string; /** * Edits the property declaration * @param template The template * @param property The property to edit * @returns The new property */ export declare function editPropertyDeclaration(template: string, property: ts.Node): string; /** * Retrieves the original block of text in the template for length comparison during migration processing. * @param elementToMigrate The element. * @param template The current template. * @param offset The current offset. * @returns The original block */ export declare function getOriginals(elementToMigrate: ElementToMigrate, template: string, offset: number): { childLength: number; childNodes: Node[]; children: string[]; end: string; start: string; }; /** * determines if a given template string contains line breaks * @param template The template to verify. * @returns If the template has line breaks */ export declare function hasLineBreaks(template: string): boolean; /** * properly adjusts template offsets based on current nesting levels * @param element The element * @param nestLevel The current nesting level * @param offset The current offset * @param postOffsets The post offsets to apply * @returns The resulting offset */ export declare function reduceNestingOffset(element: ElementToMigrate, nestLevel: number, offset: number, postOffsets: number[]): number; /** * Returns the errors when parsing the template. * @param migrated The new template * @param fileName The name of the file * @returns The potential errors */ export declare function validateMigratedTemplate(migrated: string, fileName: string): MigrationError[];