UNPKG

1.31 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/src/diagnostics" />
9import { NgAnalyzedModules } from '@angular/compiler';
10import * as ts from 'typescript';
11import * as ng from './types';
12import { TypeScriptServiceHost } from './typescript_host';
13/**
14 * Return diagnostic information for the parsed AST of the template.
15 * @param ast contains HTML and template AST
16 */
17export declare function getTemplateDiagnostics(ast: ng.AstResult): ng.Diagnostic[];
18/**
19 * Performs a variety diagnostics on directive declarations.
20 *
21 * @param declarations Angular directive declarations
22 * @param modules NgModules in the project
23 * @param host TypeScript service host used to perform TypeScript queries
24 * @return diagnosed errors, if any
25 */
26export declare function getDeclarationDiagnostics(declarations: ng.Declaration[], modules: NgAnalyzedModules, host: Readonly<TypeScriptServiceHost>): ng.Diagnostic[];
27/**
28 * Convert ng.Diagnostic to ts.Diagnostic.
29 * @param d diagnostic
30 * @param file
31 */
32export declare function ngDiagnosticToTsDiagnostic(d: ng.Diagnostic, file: ts.SourceFile | undefined): ts.Diagnostic;