UNPKG

1.93 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt
6 * The complete set of authors may be found at
7 * http://polymer.github.io/AUTHORS.txt
8 * The complete set of contributors may be found at
9 * http://polymer.github.io/CONTRIBUTORS.txt
10 * Code distributed by Google as part of the polymer project is also
11 * subject to an additional IP rights grant found at
12 * http://polymer.github.io/PATENTS.txt
13 */
14import { Feature, HtmlAstNode, Resolvable, SourceRange, Warning } from '../model/model';
15import { Document } from './document';
16import { ImmutableArray, ImmutableMap, ImmutableSet } from './immutable';
17export interface Attribute {
18 readonly name: string;
19 readonly sourceRange: SourceRange;
20 readonly nameSourceRange: SourceRange;
21 readonly valueSourceRange: SourceRange | undefined;
22 readonly value?: string;
23}
24declare module '../model/queryable' {
25 interface FeatureKindMap {
26 'element-reference': ElementReference;
27 }
28}
29export declare class ElementReference implements Feature {
30 readonly tagName: string;
31 readonly attributes: ImmutableMap<string, Attribute>;
32 readonly sourceRange: SourceRange;
33 readonly astNode: HtmlAstNode;
34 readonly warnings: ImmutableArray<Warning>;
35 readonly kinds: ImmutableSet<string>;
36 constructor(scannedRef: ScannedElementReference, _document: Document);
37 readonly identifiers: ImmutableSet<string>;
38}
39export declare class ScannedElementReference implements Resolvable {
40 readonly tagName: string;
41 readonly attributes: Map<string, Attribute>;
42 readonly sourceRange: SourceRange;
43 readonly astNode: HtmlAstNode;
44 readonly warnings: ImmutableArray<Warning>;
45 constructor(tagName: string, sourceRange: SourceRange, ast: HtmlAstNode);
46 resolve(document: Document): ElementReference;
47}