UNPKG

1.72 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/diagnostic_messages" />
9import * as ts from 'typescript';
10import * as ng from './types';
11export interface DiagnosticMessage {
12 message: string;
13 kind: keyof typeof ts.DiagnosticCategory;
14}
15declare type DiagnosticName = 'directive_not_in_module' | 'missing_template_and_templateurl' | 'both_template_and_templateurl' | 'invalid_templateurl' | 'template_context_missing_member' | 'callable_expression_expected_method_call' | 'call_target_not_callable' | 'expression_might_be_null' | 'expected_a_number_type' | 'expected_a_string_or_number_type' | 'expected_operands_of_comparable_types_or_any' | 'unrecognized_operator' | 'unrecognized_primitive' | 'no_pipe_found' | 'unable_to_resolve_compatible_call_signature' | 'unable_to_resolve_signature' | 'could_not_resolve_type' | 'identifier_not_callable' | 'identifier_possibly_undefined' | 'identifier_not_defined_in_app_context' | 'identifier_not_defined_on_receiver' | 'identifier_is_private';
16export declare const Diagnostic: Record<DiagnosticName, DiagnosticMessage>;
17/**
18 * Creates a language service diagnostic.
19 * @param span location the diagnostic for
20 * @param dm diagnostic message
21 * @param formatArgs run-time arguments to format the diagnostic message with (see the messages in
22 * the `Diagnostic` object for an example).
23 * @returns a created diagnostic
24 */
25export declare function createDiagnostic(span: ng.Span, dm: DiagnosticMessage, ...formatArgs: string[]): ng.Diagnostic;
26export {};