import * as ts from 'typescript'; import * as tss from 'typescript/lib/tsserverlibrary'; import type { Tree } from '@angular-devkit/schematics'; import type { MemberChange } from './schema'; export declare const IG_PACKAGE_NAME = "igniteui-angular"; export declare const IG_LICENSED_PACKAGE_NAME = "@infragistics/igniteui-angular"; export declare const NG_LANG_SERVICE_PACKAGE_NAME = "@angular/language-service"; export declare const NG_CORE_PACKAGE_NAME = "@angular/core"; export declare const CUSTOM_TS_PLUGIN_PATH = "./tsPlugin"; export declare const CUSTOM_TS_PLUGIN_NAME = "igx-ts-plugin"; /** * Checks if the given import path is from igniteui-angular package. * Handles both OSS (igniteui-angular) and licensed (@infragistics/igniteui-angular) versions, * as well as subpaths (e.g., igniteui-angular/core, @infragistics/igniteui-angular/grids). * @param importPath The module specifier text to check * @returns true if the import path is from igniteui-angular package */ export declare const isIgniteuiImport: (importPath: string) => boolean; export declare class MemberInfo implements Pick { name: string; fileName: string; } /** Returns a source file */ export declare const getIdentifierPositions: (source: string | ts.SourceFile, name: string) => Array<{ start: number; end: number; }>; /** Returns the positions of import from module string literals */ export declare const getImportModulePositions: (sourceText: string, startsWith: string) => Array<{ start: number; end: number; }>; /** Filters out statements to named imports (e.g. `import {x, y}`) from IG_PACKAGE_NAME */ export declare const igNamedImportFilter: (statement: ts.Statement) => statement is ts.ImportDeclaration & { moduleSpecifier: ts.StringLiteral; } & { importClause: { namedBindings: ts.NamedImports; }; }; export declare const getRenamePositions: (sourcePath: string, name: string, service: ts.LanguageService) => Array<{ start: number; end: number; }>; export declare const findMatches: (content: string, toFind: string) => number[]; /** * Create a TypeScript language service * * @param serviceHost A TypeScript language service host */ export declare const getLanguageService: (filePaths: string[], host: Tree, options?: ts.CompilerOptions) => ts.LanguageService; /** * Create a project service singleton that holds all projects within a directory tree * * @param serverHost Used by the tss to navigate the directory tree */ export declare const createProjectService: (serverHost: tss.server.ServerHost) => tss.server.ProjectService; /** * Get type information about a TypeScript identifier * * @param langServ TypeScript/Angular LanguageService * @param entryPath path to file (absolute) * @param position Index of identifier */ export declare const getTypeDefinitionAtPosition: (langServ: tss.LanguageService, entryPath: string, position: number) => MemberInfo | null; /** * Determines if a member belongs to a type in the `igniteui-angular` toolkit. * * @param change The change that will be applied. * @param langServ The Typescript/Angular Language Service * @param entryPath Relative file path. * @param matchPosition The position of the identifier. */ export declare const isMemberIgniteUI: (change: MemberChange, langServ: tss.LanguageService, entryPath: string, matchPosition: number) => boolean;