UNPKG

1.34 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/compiler-cli/src/ngtsc/diagnostics/src/error" />
9import ts from 'typescript';
10import { ErrorCode } from './error_code';
11export declare class FatalDiagnosticError {
12 readonly code: ErrorCode;
13 readonly node: ts.Node;
14 readonly message: string | ts.DiagnosticMessageChain;
15 readonly relatedInformation?: ts.DiagnosticRelatedInformation[] | undefined;
16 constructor(code: ErrorCode, node: ts.Node, message: string | ts.DiagnosticMessageChain, relatedInformation?: ts.DiagnosticRelatedInformation[] | undefined);
17 toDiagnostic(): ts.DiagnosticWithLocation;
18}
19export declare function makeDiagnostic(code: ErrorCode, node: ts.Node, messageText: string | ts.DiagnosticMessageChain, relatedInformation?: ts.DiagnosticRelatedInformation[]): ts.DiagnosticWithLocation;
20export declare function makeDiagnosticChain(messageText: string, next?: ts.DiagnosticMessageChain[]): ts.DiagnosticMessageChain;
21export declare function makeRelatedInformation(node: ts.Node, messageText: string): ts.DiagnosticRelatedInformation;
22export declare function isFatalDiagnosticError(err: any): err is FatalDiagnosticError;