UNPKG

4.54 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.typeScriptTags = exports.closureTags = exports.jsdocTags = void 0;
7
8function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
9
10function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11
12function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
14const jsdocTagsUndocumented = {
15 // Undocumented but present; see
16 // https://github.com/jsdoc/jsdoc/issues/1283#issuecomment-516816802
17 // https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js#L594
18 modifies: []
19};
20
21const jsdocTags = _objectSpread({}, jsdocTagsUndocumented, {
22 abstract: ['virtual'],
23 access: [],
24 alias: [],
25 async: [],
26 augments: ['extends'],
27 author: [],
28 borrows: [],
29 callback: [],
30 class: ['constructor'],
31 classdesc: [],
32 constant: ['const'],
33 constructs: [],
34 copyright: [],
35 default: ['defaultvalue'],
36 deprecated: [],
37 description: ['desc'],
38 enum: [],
39 event: [],
40 example: [],
41 exports: [],
42 external: ['host'],
43 file: ['fileoverview', 'overview'],
44 fires: ['emits'],
45 function: ['func', 'method'],
46 generator: [],
47 global: [],
48 hideconstructor: [],
49 ignore: [],
50 implements: [],
51 inheritdoc: [],
52 inner: [],
53 instance: [],
54 interface: [],
55 kind: [],
56 lends: [],
57 license: [],
58 listens: [],
59 member: ['var'],
60 memberof: [],
61 'memberof!': [],
62 mixes: [],
63 mixin: [],
64 module: [],
65 name: [],
66 namespace: [],
67 override: [],
68 package: [],
69 param: ['arg', 'argument'],
70 private: [],
71 property: ['prop'],
72 protected: [],
73 public: [],
74 readonly: [],
75 requires: [],
76 returns: ['return'],
77 see: [],
78 since: [],
79 static: [],
80 summary: [],
81 this: [],
82 throws: ['exception'],
83 todo: [],
84 tutorial: [],
85 type: [],
86 typedef: [],
87 variation: [],
88 version: [],
89 yields: ['yield']
90});
91
92exports.jsdocTags = jsdocTags;
93
94const typeScriptTags = _objectSpread({}, jsdocTags, {
95 // `@template` is also in TypeScript per:
96 // https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc
97 template: []
98});
99
100exports.typeScriptTags = typeScriptTags;
101const undocumentedClosureTags = {
102 // These are in Closure source but not in jsdoc source nor in the Closure
103 // docs: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java
104 closurePrimitive: [],
105 customElement: [],
106 expose: [],
107 hidden: [],
108 idGenerator: [],
109 meaning: [],
110 mixinClass: [],
111 mixinFunction: [],
112 ngInject: [],
113 owner: [],
114 typeSummary: [],
115 wizaction: []
116};
117
118const closureTags = _objectSpread({}, typeScriptTags, {}, undocumentedClosureTags, {
119 // From https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler
120 // These are all recognized in https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js
121 // except for the experimental `noinline` and the casing differences noted below
122 // Defined as a synonym of `const` in jsdoc `definitions.js`
123 define: [],
124 dict: [],
125 export: [],
126 externs: [],
127 final: [],
128 // With casing distinct from jsdoc `definitions.js`
129 implicitCast: [],
130 // With casing distinct from jsdoc `definitions.js`
131 inheritDoc: [],
132 noalias: [],
133 nocollapse: [],
134 nocompile: [],
135 noinline: [],
136 nosideeffects: [],
137 polymer: [],
138 polymerBehavior: [],
139 preserve: [],
140 // Defined as a synonym of `interface` in jsdoc `definitions.js`
141 record: [],
142 struct: [],
143 suppress: [],
144 unrestricted: []
145});
146
147exports.closureTags = closureTags;
148//# sourceMappingURL=tagNames.js.map
\No newline at end of file