UNPKG

1.32 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/binding_utils" />
9/**
10 * Represents possible Angular attribute bindings, as indices on a match of `BIND_NAME_REGEXP`.
11 */
12export declare enum ATTR {
13 /** "bind-" */
14 KW_BIND = 1,
15 /** "let-" */
16 KW_LET = 2,
17 /** "ref-/#" */
18 KW_REF = 3,
19 /** "on-" */
20 KW_ON = 4,
21 /** "bindon-" */
22 KW_BINDON = 5,
23 /** "@" */
24 KW_AT = 6,
25 /**
26 * "*"
27 * Microsyntax template starts with '*'. See https://angular.io/api/core/TemplateRef
28 */
29 KW_MICROSYNTAX = 7,
30 /** The identifier after "bind-", "let-", "ref-/#", "on-", "bindon-", "@", or "*" */
31 IDENT_KW = 8,
32 /** Identifier inside [()] */
33 IDENT_BANANA_BOX = 9,
34 /** Identifier inside [] */
35 IDENT_PROPERTY = 10,
36 /** Identifier inside () */
37 IDENT_EVENT = 11
38}
39export interface BindingDescriptor {
40 kind: ATTR;
41 name: string;
42}
43/**
44 * Returns a descriptor for a given Angular attribute, or undefined if the attribute is
45 * not an Angular attribute.
46 */
47export declare function getBindingDescriptor(attribute: string): BindingDescriptor | undefined;