UNPKG

igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

60 lines (59 loc) 2.73 kB
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 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"; export declare class MemberInfo implements Pick<tss.DefinitionInfo, 'name' | 'fileName'> { 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 PACKAGE_IMPORT */ export declare const namedImportFilter: (statement: ts.Statement) => boolean; 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;