UNPKG

1.94 kBTypeScriptView Raw
1/// <amd-module name="@angular/language-service/ivy/references" />
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9import { AST, TmplAstNode } from '@angular/compiler';
10import { NgCompiler } from '@angular/compiler-cli/src/ngtsc/core';
11import { TypeCheckingProgramStrategy } from '@angular/compiler-cli/src/ngtsc/typecheck/api';
12import * as ts from 'typescript';
13declare enum RequestKind {
14 Template = 0,
15 TypeScript = 1
16}
17interface TemplateRequest {
18 kind: RequestKind.Template;
19 requestNode: TmplAstNode | AST;
20 position: number;
21}
22interface TypeScriptRequest {
23 kind: RequestKind.TypeScript;
24 requestNode: ts.Node;
25}
26declare type RequestOrigin = TemplateRequest | TypeScriptRequest;
27export declare class ReferencesAndRenameBuilder {
28 private readonly strategy;
29 private readonly tsLS;
30 private readonly compiler;
31 private readonly ttc;
32 constructor(strategy: TypeCheckingProgramStrategy, tsLS: ts.LanguageService, compiler: NgCompiler);
33 getRenameInfo(filePath: string, position: number): Omit<ts.RenameInfoSuccess, 'kind' | 'kindModifiers'> | ts.RenameInfoFailure;
34 findRenameLocations(filePath: string, position: number): readonly ts.RenameLocation[] | undefined;
35 private findRenameLocationsAtTemplatePosition;
36 private getTsNodeAtPosition;
37 findRenameLocationsAtTypescriptPosition(filePath: string, position: number, requestOrigin: RequestOrigin): readonly ts.RenameLocation[] | undefined;
38 getReferencesAtPosition(filePath: string, position: number): ts.ReferenceEntry[] | undefined;
39 private getReferencesAtTemplatePosition;
40 private getTargetDetailsAtTemplatePosition;
41 private getPositionsForDirectives;
42 private getReferencesAtTypescriptPosition;
43 private convertToTemplateDocumentSpan;
44}
45export {};