UNPKG

2.43 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2017 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 { NodePath } from '@babel/traverse';
15import { AstNodeWithLanguage } from '..';
16import { Annotation } from '../javascript/jsdoc';
17import { Document } from './document';
18import { Feature, ScannedFeature } from './feature';
19import { FeatureKindMap } from './queryable';
20import { Resolvable } from './resolvable';
21import { SourceRange } from './source-range';
22import { Warning } from './warning';
23/**
24 * A reference to another feature by identifier.
25 */
26export declare class ScannedReference<K extends keyof FeatureKindMap> extends ScannedFeature implements Resolvable {
27 readonly identifier: string;
28 readonly kind: K;
29 readonly sourceRange: SourceRange | undefined;
30 readonly astPath: NodePath;
31 readonly astNode: AstNodeWithLanguage | undefined;
32 constructor(kind: K, identifier: string, sourceRange: SourceRange | undefined, astNode: AstNodeWithLanguage | undefined, astPath: NodePath, description?: string, jsdoc?: Annotation, warnings?: Warning[]);
33 resolve(document: Document): Reference<FeatureKindMap[K]>;
34 resolveWithKind<DK extends keyof FeatureKindMap>(document: Document, kind: DK): Reference<FeatureKindMap[DK]>;
35}
36declare module './queryable' {
37 interface FeatureKindMap {
38 'reference': Reference<Feature>;
39 }
40}
41/**
42 * A reference to another feature by identifier.
43 */
44export declare class Reference<F extends Feature> implements Feature {
45 readonly kinds: ReadonlySet<"reference">;
46 readonly identifiers: ReadonlySet<string>;
47 readonly identifier: string;
48 readonly sourceRange: SourceRange | undefined;
49 readonly astNode: AstNodeWithLanguage | undefined;
50 readonly feature: F | undefined;
51 readonly warnings: ReadonlyArray<Warning>;
52 constructor(identifier: string, sourceRange: SourceRange | undefined, astNode: AstNodeWithLanguage | undefined, feature: F | undefined, warnings: ReadonlyArray<Warning>);
53}