UNPKG

919 BTypeScriptView 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/util" />
9import { ErrorCode } from './error_code';
10/**
11 * During formatting of `ts.Diagnostic`s, the numeric code of each diagnostic is prefixed with the
12 * hard-coded "TS" prefix. For Angular's own error codes, a prefix of "NG" is desirable. To achieve
13 * this, all Angular error codes start with "-99" so that the sequence "TS-99" can be assumed to
14 * correspond with an Angular specific error code. This function replaces those occurrences with
15 * just "NG".
16 *
17 * @param errors The formatted diagnostics
18 */
19export declare function replaceTsWithNgInErrors(errors: string): string;
20export declare function ngErrorCode(code: ErrorCode): number;