UNPKG

1.94 kBJavaScriptView Raw
1"use strict";
2/**
3 * @license
4 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
5 * This code may only be used under the BSD style license found at
6 * http://polymer.github.io/LICENSE.txt
7 * The complete set of authors may be found at
8 * http://polymer.github.io/AUTHORS.txt
9 * The complete set of contributors may be found at
10 * http://polymer.github.io/CONTRIBUTORS.txt
11 * Code distributed by Google as part of the polymer project is also
12 * subject to an additional IP rights grant found at
13 * http://polymer.github.io/PATENTS.txt
14 */
15Object.defineProperty(exports, "__esModule", { value: true });
16/**
17 * The metadata for a JavaScript namespace.
18 */
19class ScannedNamespace {
20 constructor(name, description, summary, astNode, properties, jsdoc, sourceRange) {
21 this.name = name;
22 this.description = description;
23 this.summary = summary;
24 this.jsdoc = jsdoc;
25 this.sourceRange = sourceRange;
26 this.astNode = astNode;
27 this.warnings = [];
28 this.properties = properties;
29 }
30 resolve(_document) {
31 return new Namespace(this);
32 }
33}
34exports.ScannedNamespace = ScannedNamespace;
35class Namespace {
36 constructor(scannedNamespace) {
37 this.properties = new Map();
38 this.name = scannedNamespace.name;
39 this.description = scannedNamespace.description;
40 this.summary = scannedNamespace.summary;
41 this.kinds = new Set(['namespace']);
42 this.identifiers = new Set([this.name]);
43 this.sourceRange = scannedNamespace.sourceRange;
44 this.astNode = scannedNamespace.astNode;
45 this.warnings = Array.from(scannedNamespace.warnings);
46 for (const [key, prop] of scannedNamespace.properties) {
47 this.properties.set(key, prop);
48 }
49 }
50 toString() {
51 return `<Namespace id=${this.name}>`;
52 }
53}
54exports.Namespace = Namespace;
55//# sourceMappingURL=namespace.js.map
\No newline at end of file