UNPKG

1.36 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8/// <amd-module name="@angular/language-service/api" />
9/**
10 * @module
11 * @description
12 * Entry point for all public APIs of the language service package.
13 */
14import * as ts from 'typescript';
15export declare type GetTcbResponse = {
16 /**
17 * The filename of the SourceFile this typecheck block belongs to.
18 * The filename is entirely opaque and unstable, useful only for debugging
19 * purposes.
20 */
21 fileName: string;
22 /** The content of the SourceFile this typecheck block belongs to. */
23 content: string;
24 /**
25 * Spans over node(s) in the typecheck block corresponding to the
26 * TS code generated for template node under the current cursor position.
27 *
28 * When the cursor position is over a source for which there is no generated
29 * code, `selections` is empty.
30 */
31 selections: ts.TextSpan[];
32} | undefined;
33/**
34 * `NgLanguageService` describes an instance of an Angular language service,
35 * whose API surface is a strict superset of TypeScript's language service.
36 */
37export interface NgLanguageService extends ts.LanguageService {
38 getTcb(fileName: string, position: number): GetTcbResponse;
39}