@teambit/semantics.entities.semantic-schema 0.0.0-e4ef0e951da794f03096a5cc407420f4cde8b878

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/api-schema.ts +167 -0
  2. package/dist/api-schema.d.ts +36 -0
  3. package/dist/api-schema.js +171 -0
  4. package/dist/api-schema.js.map +1 -0
  5. package/dist/export.d.ts +38 -0
  6. package/dist/export.js +37 -0
  7. package/dist/export.js.map +1 -0
  8. package/dist/index.d.ts +11 -0
  9. package/dist/index.js +137 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/schema-node-constructor.d.ts +7 -0
  12. package/dist/schema-node-constructor.js +3 -0
  13. package/dist/schema-node-constructor.js.map +1 -0
  14. package/dist/schema-node.d.ts +51 -0
  15. package/dist/schema-node.js +67 -0
  16. package/dist/schema-node.js.map +1 -0
  17. package/dist/schema-registry.d.ts +17 -0
  18. package/dist/schema-registry.js +63 -0
  19. package/dist/schema-registry.js.map +1 -0
  20. package/dist/schemas/array-literal-expression.d.ts +15 -0
  21. package/dist/schemas/array-literal-expression.js +48 -0
  22. package/dist/schemas/array-literal-expression.js.map +1 -0
  23. package/dist/schemas/class.d.ts +59 -0
  24. package/dist/schemas/class.js +126 -0
  25. package/dist/schemas/class.js.map +1 -0
  26. package/dist/schemas/conditional-type.d.ts +25 -0
  27. package/dist/schemas/conditional-type.js +67 -0
  28. package/dist/schemas/conditional-type.js.map +1 -0
  29. package/dist/schemas/constructor.d.ts +9 -0
  30. package/dist/schemas/constructor.js +51 -0
  31. package/dist/schemas/constructor.js.map +1 -0
  32. package/dist/schemas/decorator.d.ts +35 -0
  33. package/dist/schemas/decorator.js +70 -0
  34. package/dist/schemas/decorator.js.map +1 -0
  35. package/dist/schemas/docs/doc.d.ts +30 -0
  36. package/dist/schemas/docs/doc.js +74 -0
  37. package/dist/schemas/docs/doc.js.map +1 -0
  38. package/dist/schemas/docs/index.d.ts +4 -0
  39. package/dist/schemas/docs/index.js +59 -0
  40. package/dist/schemas/docs/index.js.map +1 -0
  41. package/dist/schemas/docs/property-like-tag.d.ts +26 -0
  42. package/dist/schemas/docs/property-like-tag.js +59 -0
  43. package/dist/schemas/docs/property-like-tag.js.map +1 -0
  44. package/dist/schemas/docs/return-tag.d.ts +25 -0
  45. package/dist/schemas/docs/return-tag.js +55 -0
  46. package/dist/schemas/docs/return-tag.js.map +1 -0
  47. package/dist/schemas/docs/tag.d.ts +45 -0
  48. package/dist/schemas/docs/tag.js +75 -0
  49. package/dist/schemas/docs/tag.js.map +1 -0
  50. package/dist/schemas/enum-member.d.ts +36 -0
  51. package/dist/schemas/enum-member.js +66 -0
  52. package/dist/schemas/enum-member.js.map +1 -0
  53. package/dist/schemas/enum.d.ts +37 -0
  54. package/dist/schemas/enum.js +87 -0
  55. package/dist/schemas/enum.js.map +1 -0
  56. package/dist/schemas/export.d.ts +41 -0
  57. package/dist/schemas/export.js +92 -0
  58. package/dist/schemas/export.js.map +1 -0
  59. package/dist/schemas/expression-with-arguments.d.ts +19 -0
  60. package/dist/schemas/expression-with-arguments.js +59 -0
  61. package/dist/schemas/expression-with-arguments.js.map +1 -0
  62. package/dist/schemas/function-like.d.ts +66 -0
  63. package/dist/schemas/function-like.js +147 -0
  64. package/dist/schemas/function-like.js.map +1 -0
  65. package/dist/schemas/get-accessor.d.ts +22 -0
  66. package/dist/schemas/get-accessor.js +73 -0
  67. package/dist/schemas/get-accessor.js.map +1 -0
  68. package/dist/schemas/ignored.d.ts +17 -0
  69. package/dist/schemas/ignored.js +54 -0
  70. package/dist/schemas/ignored.js.map +1 -0
  71. package/dist/schemas/index-signature.d.ts +23 -0
  72. package/dist/schemas/index-signature.js +65 -0
  73. package/dist/schemas/index-signature.js.map +1 -0
  74. package/dist/schemas/index.d.ts +49 -0
  75. package/dist/schemas/index.js +623 -0
  76. package/dist/schemas/index.js.map +1 -0
  77. package/dist/schemas/indexed-access-type.d.ts +17 -0
  78. package/dist/schemas/indexed-access-type.js +55 -0
  79. package/dist/schemas/indexed-access-type.js.map +1 -0
  80. package/dist/schemas/inference-type.d.ts +22 -0
  81. package/dist/schemas/inference-type.js +65 -0
  82. package/dist/schemas/inference-type.js.map +1 -0
  83. package/dist/schemas/interface.d.ts +49 -0
  84. package/dist/schemas/interface.js +108 -0
  85. package/dist/schemas/interface.js.map +1 -0
  86. package/dist/schemas/keyword-type.d.ts +15 -0
  87. package/dist/schemas/keyword-type.js +43 -0
  88. package/dist/schemas/keyword-type.js.map +1 -0
  89. package/dist/schemas/literal-type.d.ts +15 -0
  90. package/dist/schemas/literal-type.js +43 -0
  91. package/dist/schemas/literal-type.js.map +1 -0
  92. package/dist/schemas/literal-value.d.ts +12 -0
  93. package/dist/schemas/literal-value.js +41 -0
  94. package/dist/schemas/literal-value.js.map +1 -0
  95. package/dist/schemas/module.d.ts +22 -0
  96. package/dist/schemas/module.js +87 -0
  97. package/dist/schemas/module.js.map +1 -0
  98. package/dist/schemas/named-tuple.d.ts +19 -0
  99. package/dist/schemas/named-tuple.js +53 -0
  100. package/dist/schemas/named-tuple.js.map +1 -0
  101. package/dist/schemas/object-literal-expression.d.ts +18 -0
  102. package/dist/schemas/object-literal-expression.js +52 -0
  103. package/dist/schemas/object-literal-expression.js.map +1 -0
  104. package/dist/schemas/parameter.d.ts +27 -0
  105. package/dist/schemas/parameter.js +95 -0
  106. package/dist/schemas/parameter.js.map +1 -0
  107. package/dist/schemas/parenthesized-type.d.ts +21 -0
  108. package/dist/schemas/parenthesized-type.js +54 -0
  109. package/dist/schemas/parenthesized-type.js.map +1 -0
  110. package/dist/schemas/property-assignment.d.ts +37 -0
  111. package/dist/schemas/property-assignment.js +67 -0
  112. package/dist/schemas/property-assignment.js.map +1 -0
  113. package/dist/schemas/set-accessor.d.ts +28 -0
  114. package/dist/schemas/set-accessor.js +65 -0
  115. package/dist/schemas/set-accessor.js.map +1 -0
  116. package/dist/schemas/template-literal-type-span.d.ts +19 -0
  117. package/dist/schemas/template-literal-type-span.js +53 -0
  118. package/dist/schemas/template-literal-type-span.js.map +1 -0
  119. package/dist/schemas/template-literal-type.d.ts +22 -0
  120. package/dist/schemas/template-literal-type.js +52 -0
  121. package/dist/schemas/template-literal-type.js.map +1 -0
  122. package/dist/schemas/this-type.d.ts +12 -0
  123. package/dist/schemas/this-type.js +37 -0
  124. package/dist/schemas/this-type.js.map +1 -0
  125. package/dist/schemas/tuple-type.d.ts +16 -0
  126. package/dist/schemas/tuple-type.js +47 -0
  127. package/dist/schemas/tuple-type.js.map +1 -0
  128. package/dist/schemas/type-array.d.ts +17 -0
  129. package/dist/schemas/type-array.js +50 -0
  130. package/dist/schemas/type-array.js.map +1 -0
  131. package/dist/schemas/type-intersection.d.ts +17 -0
  132. package/dist/schemas/type-intersection.js +50 -0
  133. package/dist/schemas/type-intersection.js.map +1 -0
  134. package/dist/schemas/type-literal.d.ts +18 -0
  135. package/dist/schemas/type-literal.js +64 -0
  136. package/dist/schemas/type-literal.js.map +1 -0
  137. package/dist/schemas/type-operator.d.ts +19 -0
  138. package/dist/schemas/type-operator.js +53 -0
  139. package/dist/schemas/type-operator.js.map +1 -0
  140. package/dist/schemas/type-predicate.d.ts +33 -0
  141. package/dist/schemas/type-predicate.js +75 -0
  142. package/dist/schemas/type-predicate.js.map +1 -0
  143. package/dist/schemas/type-query.d.ts +23 -0
  144. package/dist/schemas/type-query.js +59 -0
  145. package/dist/schemas/type-query.js.map +1 -0
  146. package/dist/schemas/type-ref.d.ts +80 -0
  147. package/dist/schemas/type-ref.js +159 -0
  148. package/dist/schemas/type-ref.js.map +1 -0
  149. package/dist/schemas/type-union.d.ts +17 -0
  150. package/dist/schemas/type-union.js +56 -0
  151. package/dist/schemas/type-union.js.map +1 -0
  152. package/dist/schemas/type.d.ts +23 -0
  153. package/dist/schemas/type.js +80 -0
  154. package/dist/schemas/type.js.map +1 -0
  155. package/dist/schemas/unimplemented-schema.d.ts +14 -0
  156. package/dist/schemas/unimplemented-schema.js +43 -0
  157. package/dist/schemas/unimplemented-schema.js.map +1 -0
  158. package/dist/schemas/unknown-schema.d.ts +18 -0
  159. package/dist/schemas/unknown-schema.js +47 -0
  160. package/dist/schemas/unknown-schema.js.map +1 -0
  161. package/dist/schemas/unresolved-schema.d.ts +14 -0
  162. package/dist/schemas/unresolved-schema.js +41 -0
  163. package/dist/schemas/unresolved-schema.js.map +1 -0
  164. package/dist/schemas/variable-like.d.ts +47 -0
  165. package/dist/schemas/variable-like.js +95 -0
  166. package/dist/schemas/variable-like.js.map +1 -0
  167. package/dist/semantic-schema.docs.md +6 -0
  168. package/dist/type.d.ts +1 -0
  169. package/dist/type.js +3 -0
  170. package/dist/type.js.map +1 -0
  171. package/dist/unknown-schema-factory.d.ts +4 -0
  172. package/dist/unknown-schema-factory.js +19 -0
  173. package/dist/unknown-schema-factory.js.map +1 -0
  174. package/export.ts +31 -0
  175. package/index.ts +13 -0
  176. package/package.json +46 -0
  177. package/schema-node-constructor.ts +8 -0
  178. package/schema-node.ts +96 -0
  179. package/schema-registry.ts +53 -0
  180. package/schemas/array-literal-expression.ts +33 -0
  181. package/schemas/class.ts +135 -0
  182. package/schemas/conditional-type.ts +63 -0
  183. package/schemas/constructor.ts +28 -0
  184. package/schemas/decorator.ts +54 -0
  185. package/schemas/docs/doc.ts +69 -0
  186. package/schemas/docs/index.ts +4 -0
  187. package/schemas/docs/property-like-tag.ts +47 -0
  188. package/schemas/docs/return-tag.ts +44 -0
  189. package/schemas/docs/tag.ts +66 -0
  190. package/schemas/enum-member.ts +57 -0
  191. package/schemas/enum.ts +73 -0
  192. package/schemas/export.ts +91 -0
  193. package/schemas/expression-with-arguments.ts +51 -0
  194. package/schemas/function-like.ts +154 -0
  195. package/schemas/get-accessor.ts +57 -0
  196. package/schemas/ignored.ts +43 -0
  197. package/schemas/index-signature.ts +49 -0
  198. package/schemas/index.ts +49 -0
  199. package/schemas/indexed-access-type.ts +47 -0
  200. package/schemas/inference-type.ts +60 -0
  201. package/schemas/interface.ts +94 -0
  202. package/schemas/keyword-type.ts +34 -0
  203. package/schemas/literal-type.ts +34 -0
  204. package/schemas/literal-value.ts +32 -0
  205. package/schemas/module.ts +87 -0
  206. package/schemas/named-tuple.ts +39 -0
  207. package/schemas/object-literal-expression.ts +42 -0
  208. package/schemas/parameter.ts +104 -0
  209. package/schemas/parenthesized-type.ts +42 -0
  210. package/schemas/property-assignment.ts +50 -0
  211. package/schemas/set-accessor.ts +47 -0
  212. package/schemas/template-literal-type-span.ts +42 -0
  213. package/schemas/template-literal-type.ts +40 -0
  214. package/schemas/this-type.ts +27 -0
  215. package/schemas/tuple-type.ts +35 -0
  216. package/schemas/type-array.ts +39 -0
  217. package/schemas/type-intersection.ts +39 -0
  218. package/schemas/type-literal.ts +60 -0
  219. package/schemas/type-operator.ts +41 -0
  220. package/schemas/type-predicate.ts +64 -0
  221. package/schemas/type-query.ts +49 -0
  222. package/schemas/type-ref.ts +143 -0
  223. package/schemas/type-union.ts +41 -0
  224. package/schemas/type.ts +61 -0
  225. package/schemas/unimplemented-schema.ts +35 -0
  226. package/schemas/unknown-schema.ts +38 -0
  227. package/schemas/unresolved-schema.ts +32 -0
  228. package/schemas/variable-like.ts +76 -0
  229. package/semantic-schema.docs.md +6 -0
  230. package/type.ts +1 -0
  231. package/types/asset.d.ts +41 -0
  232. package/types/style.d.ts +42 -0
  233. package/unknown-schema-factory.ts +10 -0
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ConstructorSchema = void 0;
7
+ function _parameter() {
8
+ const data = require("./parameter");
9
+ _parameter = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _functionLike() {
15
+ const data = require("./function-like");
16
+ _functionLike = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _docs() {
22
+ const data = require("./docs");
23
+ _docs = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _thisType() {
29
+ const data = require("./this-type");
30
+ _thisType = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ class ConstructorSchema extends _functionLike().FunctionLikeSchema {
36
+ constructor(location, params, returnType, signature, modifiers = [], doc) {
37
+ super(location, 'constructor', params, returnType, signature, modifiers, doc, undefined);
38
+ }
39
+ static fromObject(obj) {
40
+ const location = obj.location;
41
+ const params = obj.params.map(param => _parameter().ParameterSchema.fromObject(param));
42
+ const returns = _thisType().ThisTypeSchema.fromObject(obj.returnType);
43
+ const signature = obj.signature;
44
+ const modifiers = obj.modifiers;
45
+ const doc = obj.doc ? _docs().DocSchema.fromObject(obj.doc) : undefined;
46
+ return new ConstructorSchema(location, params, returns, signature, modifiers, doc);
47
+ }
48
+ }
49
+ exports.ConstructorSchema = ConstructorSchema;
50
+
51
+ //# sourceMappingURL=constructor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_parameter","data","require","_functionLike","_docs","_thisType","ConstructorSchema","FunctionLikeSchema","constructor","location","params","returnType","signature","modifiers","doc","undefined","fromObject","obj","map","param","ParameterSchema","returns","ThisTypeSchema","DocSchema","exports"],"sources":["constructor.ts"],"sourcesContent":["import { SchemaLocation } from '../schema-node';\nimport { ParameterSchema } from './parameter';\nimport { FunctionLikeSchema, Modifier } from './function-like';\nimport { DocSchema } from './docs';\nimport { ThisTypeSchema } from './this-type';\n\nexport class ConstructorSchema extends FunctionLikeSchema {\n constructor(\n location: SchemaLocation,\n params: ParameterSchema[],\n returnType: ThisTypeSchema,\n signature: string,\n modifiers: Modifier[] = [],\n doc?: DocSchema\n ) {\n super(location, 'constructor', params, returnType, signature, modifiers, doc, undefined);\n }\n\n static fromObject(obj: Record<string, any>): ConstructorSchema {\n const location = obj.location;\n const params = obj.params.map((param: any) => ParameterSchema.fromObject(param));\n const returns = ThisTypeSchema.fromObject(obj.returnType);\n const signature = obj.signature;\n const modifiers = obj.modifiers;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n return new ConstructorS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IAC/B,MAAMC,GAAG,GAAGG,GAAG,CAACH,GAAG,GAAGS,iBAAS,CAACP,UAAU,CAACC,GAAG,CAACH,GAAG,CAAC,GAAGC,SAAS;IAC/D,OAAO,IAAIT,iBAAiB,CAACG,QAAQ,EAAEC,MAAM,EAAEW,OAAO,EAAET,SAAS,EAAEC,SAAS,EAAEC,GAAG,CAAC;EACpF;AACF;AAACU,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ import { SchemaLocation, SchemaNode } from '../schema-node';
2
+ import { DocSchema } from './docs';
3
+ export declare class DecoratorSchema extends SchemaNode {
4
+ readonly location: SchemaLocation;
5
+ readonly name: string;
6
+ readonly doc?: DocSchema | undefined;
7
+ readonly args?: SchemaNode[] | undefined;
8
+ constructor(location: SchemaLocation, name: string, doc?: DocSchema | undefined, args?: SchemaNode[] | undefined);
9
+ getNodes(): SchemaNode[];
10
+ toString(): string;
11
+ toFullSignature(options?: {
12
+ showDocs?: boolean;
13
+ }): string;
14
+ toObject(): {
15
+ name: string;
16
+ doc: {
17
+ __schema: string;
18
+ name: string | undefined;
19
+ location: SchemaLocation;
20
+ signature: string | undefined;
21
+ raw: string;
22
+ comment: string | undefined;
23
+ tags: {
24
+ __schema: string;
25
+ location: SchemaLocation;
26
+ name: string | undefined;
27
+ signature: string | undefined;
28
+ tagName: string;
29
+ comment: string | undefined;
30
+ }[] | undefined;
31
+ } | undefined;
32
+ args: Record<string, any>[] | undefined;
33
+ };
34
+ static fromObject(obj: Record<string, any>): DecoratorSchema;
35
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DecoratorSchema = void 0;
7
+ function _schemaNode() {
8
+ const data = require("../schema-node");
9
+ _schemaNode = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _schemaRegistry() {
15
+ const data = require("../schema-registry");
16
+ _schemaRegistry = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _docs() {
22
+ const data = require("./docs");
23
+ _docs = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ class DecoratorSchema extends _schemaNode().SchemaNode {
29
+ constructor(location, name, doc, args) {
30
+ super();
31
+ this.location = location;
32
+ this.name = name;
33
+ this.doc = doc;
34
+ this.args = args;
35
+ }
36
+ getNodes() {
37
+ return this.args || [];
38
+ }
39
+ toString() {
40
+ const argsStr = this.args?.map(arg => arg.toString()).join(', ');
41
+ return `@${this.name}${argsStr ? `(${argsStr})` : ''}`;
42
+ }
43
+ toFullSignature(options) {
44
+ let result = '';
45
+ if (options?.showDocs && this.doc) {
46
+ result += `${this.doc.toFullSignature()}\n`;
47
+ }
48
+ const argsStr = this.args?.map(arg => arg.toFullSignature(options)).join(', ');
49
+ result += `@${this.name}${argsStr ? `(${argsStr})` : ''}`;
50
+ return result;
51
+ }
52
+ toObject() {
53
+ return {
54
+ ...super.toObject(),
55
+ name: this.name,
56
+ doc: this.doc?.toObject(),
57
+ args: this.args?.map(arg => arg.toObject())
58
+ };
59
+ }
60
+ static fromObject(obj) {
61
+ const location = obj.location;
62
+ const name = obj.name;
63
+ const doc = obj.doc ? _docs().DocSchema.fromObject(obj.doc) : undefined;
64
+ const args = obj.args ? obj.args.map(arg => _schemaRegistry().SchemaRegistry.fromObject(arg)) : undefined;
65
+ return new DecoratorSchema(location, name, doc, args);
66
+ }
67
+ }
68
+ exports.DecoratorSchema = DecoratorSchema;
69
+
70
+ //# sourceMappingURL=decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_schemaNode","data","require","_schemaRegistry","_docs","DecoratorSchema","SchemaNode","constructor","location","name","doc","args","getNodes","toString","argsStr","map","arg","join","toFullSignature","options","result","showDocs","toObject","fromObject","obj","DocSchema","undefined","SchemaRegistry","exports"],"sources":["decorator.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\nimport { SchemaRegistry } from '../schema-registry';\nimport { DocSchema } from './docs';\n\nexport class DecoratorSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n readonly doc?: DocSchema,\n readonly args?: SchemaNode[]\n ) {\n super();\n }\n\n getNodes() {\n return this.args || [];\n }\n\n toString() {\n const argsStr = this.args?.map((arg) => arg.toString()).join(', ');\n return `@${this.name}${argsStr ? `(${argsStr})` : ''}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n\n const argsStr = this.args?.map((arg) => arg.toFullSignature(options)).join(', ');\n\n result += `@${this.name}${argsStr ? `(${argsStr})` : ''}`;\n\n return result;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n doc: this.doc?.toObject(),\n args: this.args?.map((arg) => arg.toObject()),\n };\n }\n\n static fromObject(obj: Record<string, any>): DecoratorSchema {\n const location = obj.location;\n const name = obj.name;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n const args = obj.args ? obj.args.map((arg) => SchemaRegistry.fromObject(arg)) : undefined;\n return new DecoratorSchema(location, name, doc, args);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMI,eAAe,SAASC,wBAAU,CAAC;EAC9CC,WAAWA,CACAC,QAAwB,EACxBC,IAAY,EACZC,G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,EAAEI,GAAG,CAAEC,GAAG,IAAKA,GAAG,CAACM,QAAQ,CAAC,CAAC;IAC9C,CAAC;EACH;EAEA,OAAOC,UAAUA,CAACC,GAAwB,EAAmB;IAC3D,MAAMhB,QAAQ,GAAGgB,GAAG,CAAChB,QAAQ;IAC7B,MAAMC,IAAI,GAAGe,GAAG,CAACf,IAAI;IACrB,MAAMC,GAAG,GAAGc,GAAG,CAACd,GAAG,GAAGe,iBAAS,CAACF,UAAU,CAACC,GAAG,CAACd,GAAG,CAAC,GAAGgB,SAAS;IAC/D,MAAMf,IAAI,GAAGa,GAAG,CAACb,IAAI,GAAGa,GAAG,CAACb,IAAI,CAACI,GAAG,CAAEC,GAAG,IAAKW,gCAAc,CAACJ,UAAU,CAACP,GAAG,CAAC,CAAC,GAAGU,SAAS;IACzF,OAAO,IAAIrB,eAAe,CAACG,QAAQ,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,CAAC;EACvD;AACF;AAACiB,OAAA,CAAAvB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ import { SchemaLocation, SchemaNode } from '../../schema-node';
2
+ import { TagName, TagSchema } from './tag';
3
+ export declare class DocSchema extends SchemaNode {
4
+ readonly location: SchemaLocation;
5
+ readonly raw: string;
6
+ readonly comment?: string | undefined;
7
+ readonly tags?: TagSchema[];
8
+ constructor(location: SchemaLocation, raw: string, comment?: string | undefined, tags?: TagSchema[]);
9
+ toString(): string;
10
+ toFullSignature(): string;
11
+ hasTag(tagName: TagName): boolean;
12
+ findTag(tagName: TagName): TagSchema | undefined;
13
+ toObject(): {
14
+ __schema: string;
15
+ name: string | undefined;
16
+ location: SchemaLocation;
17
+ signature: string | undefined;
18
+ raw: string;
19
+ comment: string | undefined;
20
+ tags: {
21
+ __schema: string;
22
+ location: SchemaLocation;
23
+ name: string | undefined;
24
+ signature: string | undefined;
25
+ tagName: string;
26
+ comment: string | undefined;
27
+ }[] | undefined;
28
+ };
29
+ static fromObject(obj: Record<string, any>): DocSchema;
30
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DocSchema = void 0;
7
+ function _schemaNode() {
8
+ const data = require("../../schema-node");
9
+ _schemaNode = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _schemaRegistry() {
15
+ const data = require("../../schema-registry");
16
+ _schemaRegistry = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ class DocSchema extends _schemaNode().SchemaNode {
22
+ constructor(location, raw, comment, tags) {
23
+ super();
24
+ this.location = location;
25
+ this.raw = raw;
26
+ this.comment = comment;
27
+ this.tags = tags;
28
+ }
29
+ toString() {
30
+ const comment = this.comment ? `${this.comment}\n` : '';
31
+ const tags = this.tags ? this.tags.map(tag => tag.toString()).join('\n') : '';
32
+ return `${comment}${tags}`;
33
+ }
34
+ toFullSignature() {
35
+ const lines = [];
36
+ if (this.comment) {
37
+ lines.push(...this.comment.split('\n').map(line => ` * ${line.trim()}`));
38
+ }
39
+ if (this.tags && this.tags.length > 0) {
40
+ for (const tag of this.tags) {
41
+ lines.push(` * ${tag.toString().trim()}`);
42
+ }
43
+ }
44
+ if (lines.length === 0) {
45
+ return '';
46
+ }
47
+ return `/**\n${lines.join('\n')}\n */`;
48
+ }
49
+ hasTag(tagName) {
50
+ return Boolean(this.findTag(tagName));
51
+ }
52
+ findTag(tagName) {
53
+ return this.tags?.find(tag => tag.tagName === tagName);
54
+ }
55
+ toObject() {
56
+ return {
57
+ __schema: this.__schema,
58
+ name: this.name,
59
+ location: this.location,
60
+ signature: this.signature,
61
+ raw: this.raw,
62
+ comment: this.comment,
63
+ tags: this.tags ? this.tags.map(tag => tag.toObject()) : undefined
64
+ };
65
+ }
66
+ static fromObject(obj) {
67
+ const location = obj.location;
68
+ const tags = obj.tags ? obj.tags.map(tag => _schemaRegistry().SchemaRegistry.fromObject(tag)) : undefined;
69
+ return new DocSchema(location, obj.raw, obj.comment, tags);
70
+ }
71
+ }
72
+ exports.DocSchema = DocSchema;
73
+
74
+ //# sourceMappingURL=doc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_schemaNode","data","require","_schemaRegistry","DocSchema","SchemaNode","constructor","location","raw","comment","tags","toString","map","tag","join","toFullSignature","lines","push","split","line","trim","length","hasTag","tagName","Boolean","findTag","find","toObject","__schema","name","signature","undefined","fromObject","obj","SchemaRegistry","exports"],"sources":["doc.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../../schema-node';\nimport { SchemaRegistry } from '../../schema-registry';\nimport { TagName, TagSchema } from './tag';\n\nexport class DocSchema extends SchemaNode {\n readonly tags?: TagSchema[];\n\n constructor(\n readonly location: SchemaLocation,\n readonly raw: string,\n readonly comment?: string,\n tags?: TagSchema[]\n ) {\n super();\n this.tags = tags;\n }\n\n toString() {\n const comment = this.comment ? `${this.comment}\\n` : '';\n const tags = this.tags ? this.tags.map((tag) => tag.toString()).join('\\n') : '';\n return `${comment}${tags}`;\n }\n\n toFullSignature(): string {\n const lines: string[] = [];\n\n if (this.comment) {\n lines.push(...this.comment.split('\\n').map((line) => ` * ${line.trim()}`));\n }\n\n if (this.tags && this.tags.length > 0) {\n for (const tag of this.tags) {\n lines.push(` * ${tag.toString().trim()}`);\n }\n }\n\n if (lines.length === 0) {\n return '';\n }\n\n return `/**\\n${lines.join('\\n')}\\n */`;\n }\n\n hasTag(tagName: TagName) {\n return Boolean(this.findTag(tagName));\n }\n\n findTag(tagName: TagName) {\n return this.tags?.find((tag) => tag.tagName === tagName);\n }\n\n toObject() {\n return {\n __schema: this.__schema,\n name: this.name,\n location: this.location,\n signature: this.signature,\n raw: this.raw,\n comment: this.comment,\n tags: this.tags ? this.tags.map((tag) => tag.toObject()) : undefined,\n };\n }\n\n static fromObject(obj: Record<string, any>): DocSchema {\n const location = obj.location;\n const tags = obj.tags ? obj.tags.map((tag: any) => SchemaRegistry.fromObject(tag)) : undefined;\n return new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GAAG,CAAEC,GAAQ,IAAKqB,gCAAc,CAACF,UAAU,CAACnB,GAAG,CAAC,CAAC,GAAGkB,SAAS;IAC9F,OAAO,IAAI3B,SAAS,CAACG,QAAQ,EAAE0B,GAAG,CAACzB,GAAG,EAAEyB,GAAG,CAACxB,OAAO,EAAEC,IAAI,CAAC;EAC5D;AACF;AAACyB,OAAA,CAAA/B,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export { DocSchema } from './doc';
2
+ export { TagSchema } from './tag';
3
+ export { ReturnTagSchema } from './return-tag';
4
+ export { PropertyLikeTagSchema } from './property-like-tag';
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "DocSchema", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _doc().DocSchema;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "PropertyLikeTagSchema", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _propertyLikeTag().PropertyLikeTagSchema;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "ReturnTagSchema", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _returnTag().ReturnTagSchema;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "TagSchema", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _tag().TagSchema;
28
+ }
29
+ });
30
+ function _doc() {
31
+ const data = require("./doc");
32
+ _doc = function () {
33
+ return data;
34
+ };
35
+ return data;
36
+ }
37
+ function _tag() {
38
+ const data = require("./tag");
39
+ _tag = function () {
40
+ return data;
41
+ };
42
+ return data;
43
+ }
44
+ function _returnTag() {
45
+ const data = require("./return-tag");
46
+ _returnTag = function () {
47
+ return data;
48
+ };
49
+ return data;
50
+ }
51
+ function _propertyLikeTag() {
52
+ const data = require("./property-like-tag");
53
+ _propertyLikeTag = function () {
54
+ return data;
55
+ };
56
+ return data;
57
+ }
58
+
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_doc","data","require","_tag","_returnTag","_propertyLikeTag"],"sources":["index.ts"],"sourcesContent":["export { DocSchema } from './doc';\nexport { TagSchema } from './tag';\nexport { ReturnTagSchema } from './return-tag';\nexport { PropertyLikeTagSchema } from './property-like-tag';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,iBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,gBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ import { SchemaLocation, SchemaNode } from '../../schema-node';
2
+ import { TagSchema } from './tag';
3
+ /**
4
+ * e.g. `@param myParam {string} some comment`
5
+ */
6
+ export declare class PropertyLikeTagSchema extends TagSchema {
7
+ readonly location: SchemaLocation;
8
+ readonly name: string;
9
+ readonly comment?: string | undefined;
10
+ readonly type?: SchemaNode;
11
+ constructor(location: SchemaLocation, name: string, comment?: string | undefined, type?: SchemaNode);
12
+ toString(): string;
13
+ toFullSignature(options?: {
14
+ showDocs?: boolean;
15
+ }): string;
16
+ toObject(): {
17
+ name: string;
18
+ type: Record<string, any> | undefined;
19
+ __schema: string;
20
+ location: SchemaLocation;
21
+ signature: string | undefined;
22
+ tagName: string;
23
+ comment: string | undefined;
24
+ };
25
+ static fromObject(obj: Record<string, any>): PropertyLikeTagSchema;
26
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PropertyLikeTagSchema = void 0;
7
+ function _schemaRegistry() {
8
+ const data = require("../../schema-registry");
9
+ _schemaRegistry = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _tag() {
15
+ const data = require("./tag");
16
+ _tag = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ /**
22
+ * e.g. `@param myParam {string} some comment`
23
+ */
24
+ class PropertyLikeTagSchema extends _tag().TagSchema {
25
+ constructor(location, name, comment, type) {
26
+ super(location, _tag().TagName.parameter, comment);
27
+ this.location = location;
28
+ this.name = name;
29
+ this.comment = comment;
30
+ this.type = type;
31
+ }
32
+ toString() {
33
+ const comment = this.comment ? ` ${this.comment}` : '';
34
+ const type = this.type ? ` {${this.type.toString()}} ` : '';
35
+ return `@${this.tagName} ${this.name}${type} ${comment}`;
36
+ }
37
+ toFullSignature(options) {
38
+ const typeStr = this.type ? ` {${this.type.toFullSignature(options)}} ` : '';
39
+ const comment = this.comment ? ` ${this.comment}` : '';
40
+ return `@${this.tagName} ${this.name}${typeStr}${comment}`;
41
+ }
42
+ toObject() {
43
+ return {
44
+ ...super.toObject(),
45
+ name: this.name,
46
+ type: this.type?.toObject()
47
+ };
48
+ }
49
+ static fromObject(obj) {
50
+ const location = obj.location;
51
+ const name = obj.name;
52
+ const comment = obj.comment;
53
+ const type = obj.type ? _schemaRegistry().SchemaRegistry.fromObject(obj.type) : undefined;
54
+ return new PropertyLikeTagSchema(location, name, comment, type);
55
+ }
56
+ }
57
+ exports.PropertyLikeTagSchema = PropertyLikeTagSchema;
58
+
59
+ //# sourceMappingURL=property-like-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_schemaRegistry","data","require","_tag","PropertyLikeTagSchema","TagSchema","constructor","location","name","comment","type","TagName","parameter","toString","tagName","toFullSignature","options","typeStr","toObject","fromObject","obj","SchemaRegistry","undefined","exports"],"sources":["property-like-tag.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../../schema-node';\nimport { SchemaRegistry } from '../../schema-registry';\nimport { TagName, TagSchema } from './tag';\n\n/**\n * e.g. `@param myParam {string} some comment`\n */\nexport class PropertyLikeTagSchema extends TagSchema {\n readonly type?: SchemaNode;\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n readonly comment?: string,\n type?: SchemaNode\n ) {\n super(location, TagName.parameter, comment);\n this.type = type;\n }\n\n toString() {\n const comment = this.comment ? ` ${this.comment}` : '';\n const type = this.type ? ` {${this.type.toString()}} ` : '';\n return `@${this.tagName} ${this.name}${type} ${comment}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n const typeStr = this.type ? ` {${this.type.toFullSignature(options)}} ` : '';\n const comment = this.comment ? ` ${this.comment}` : '';\n return `@${this.tagName} ${this.name}${typeStr}${comment}`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n type: this.type?.toObject(),\n };\n }\n\n static fromObject(obj: Record<string, any>): PropertyLikeTagSchema {\n const location = obj.location;\n const name = obj.name;\n const comment = obj.comment;\n const type = obj.type ? SchemaRegistry.fromObject(obj.type) : undefined;\n return new PropertyLikeTagSchema(location, name, comment, type);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACO,MAAMG,qBAAqB,SAASC,gBAAS,CAAC;EAEnDC,WAAWA,CACAC,QAAwB,EACxBC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C,IAAI,GAAGY,GAAG,CAACZ,IAAI;IACrB,MAAMC,OAAO,GAAGW,GAAG,CAACX,OAAO;IAC3B,MAAMC,IAAI,GAAGU,GAAG,CAACV,IAAI,GAAGW,gCAAc,CAACF,UAAU,CAACC,GAAG,CAACV,IAAI,CAAC,GAAGY,SAAS;IACvE,OAAO,IAAIlB,qBAAqB,CAACG,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,IAAI,CAAC;EACjE;AACF;AAACa,OAAA,CAAAnB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ import { SchemaLocation, SchemaNode } from '../../schema-node';
2
+ import { TagSchema } from './tag';
3
+ /**
4
+ * e.g. `@return {string} some comment`
5
+ */
6
+ export declare class ReturnTagSchema extends TagSchema {
7
+ readonly location: SchemaLocation;
8
+ readonly comment?: string | undefined;
9
+ readonly type?: SchemaNode;
10
+ constructor(location: SchemaLocation, comment?: string | undefined, type?: SchemaNode);
11
+ toString(): string;
12
+ toFullSignature(options?: {
13
+ showDocs?: boolean;
14
+ }): string;
15
+ toObject(): {
16
+ type: Record<string, any> | undefined;
17
+ __schema: string;
18
+ location: SchemaLocation;
19
+ name: string | undefined;
20
+ signature: string | undefined;
21
+ tagName: string;
22
+ comment: string | undefined;
23
+ };
24
+ static fromObject(obj: Record<string, any>): ReturnTagSchema;
25
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ReturnTagSchema = void 0;
7
+ function _schemaRegistry() {
8
+ const data = require("../../schema-registry");
9
+ _schemaRegistry = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _tag() {
15
+ const data = require("./tag");
16
+ _tag = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ /**
22
+ * e.g. `@return {string} some comment`
23
+ */
24
+ class ReturnTagSchema extends _tag().TagSchema {
25
+ constructor(location, comment, type) {
26
+ super(location, _tag().TagName.return, comment);
27
+ this.location = location;
28
+ this.comment = comment;
29
+ this.type = type;
30
+ }
31
+ toString() {
32
+ const comment = this.comment ? ` ${this.comment}` : '';
33
+ return `@${this.tagName}${comment}`;
34
+ }
35
+ toFullSignature(options) {
36
+ const typeStr = this.type ? ` {${this.type.toFullSignature(options)}}` : '';
37
+ const comment = this.comment ? ` ${this.comment}` : '';
38
+ return `@${this.tagName}${typeStr}${comment}`;
39
+ }
40
+ toObject() {
41
+ return {
42
+ ...super.toObject(),
43
+ type: this.type?.toObject()
44
+ };
45
+ }
46
+ static fromObject(obj) {
47
+ const location = obj.location;
48
+ const comment = obj.comment;
49
+ const type = obj.type ? _schemaRegistry().SchemaRegistry.fromObject(obj.type) : undefined;
50
+ return new ReturnTagSchema(location, comment, type);
51
+ }
52
+ }
53
+ exports.ReturnTagSchema = ReturnTagSchema;
54
+
55
+ //# sourceMappingURL=return-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_schemaRegistry","data","require","_tag","ReturnTagSchema","TagSchema","constructor","location","comment","type","TagName","return","toString","tagName","toFullSignature","options","typeStr","toObject","fromObject","obj","SchemaRegistry","undefined","exports"],"sources":["return-tag.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../../schema-node';\nimport { SchemaRegistry } from '../../schema-registry';\nimport { TagName, TagSchema } from './tag';\n\n/**\n * e.g. `@return {string} some comment`\n */\nexport class ReturnTagSchema extends TagSchema {\n readonly type?: SchemaNode;\n\n constructor(\n readonly location: SchemaLocation,\n readonly comment?: string,\n type?: SchemaNode\n ) {\n super(location, TagName.return, comment);\n this.type = type;\n }\n\n toString() {\n const comment = this.comment ? ` ${this.comment}` : '';\n return `@${this.tagName}${comment}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n const typeStr = this.type ? ` {${this.type.toFullSignature(options)}}` : '';\n const comment = this.comment ? ` ${this.comment}` : '';\n return `@${this.tagName}${typeStr}${comment}`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n type: this.type?.toObject(),\n };\n }\n\n static fromObject(obj: Record<string, any>): ReturnTagSchema {\n const location = obj.location;\n const comment = obj.comment;\n const type = obj.type ? SchemaRegistry.fromObject(obj.type) : undefined;\n return new ReturnTagSchema(location, comment, type);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACO,MAAMG,eAAe,SAASC,gBAAS,CAAC;EAG7CC,WAAWA,CACAC,QAAwB,EACxBC,OAAgB,EACzBC,IAAiB,EACjB;IACA,KAAK,CAACF,QAAQ,EAAEG,cAAO,CAACC,MAAM,EAAEH,OAAO,CAAC;IAAC,KAJhCD,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,OAAgB,GAAhBA,OAAgB;IAIzB,IAAI,CAACC,IAAI,GAAGA,IAAI;EAClB;EAEAG,QAAQA,CAAA,EAAG;IACT,MAAMJ,OAAO,GAAG,IAAI,CAACA,OAAO,GAAG,IAAI,IAAI,CAACA,OAAO,EAAE,GAAG,EAAE;IACtD,OAAO,IAAI,IAAI,CAACK,OAAO,GAAGL,OAAO,EAAE;EACrC;EAEAM,eAAeA,CAACC,OAAgC,EAAU;IACxD,MAAMC,OAAO,GAAG,IAAI,CAACP,IAAI,GAAG,KAAK,IAAI,CAACA,IAAI,CAACK,eAAe,CAACC,OAAO,CAAC,GAAG,GAAG,EAAE;IAC3E,MAAMP,OAAO,GAAG,IAAI,CAACA,OAAO,GAAG,IAAI,IAAI,CAACA,OAAO,EAAE,GAAG,EAAE;IACtD,OAAO,IAAI,IAAI,CAACK,OAAO,GAAGG,OAAO,GAAGR,OAAO,EAAE;EAC/C;EAEAS,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBR,IAAI,EAAE,IAAI,CAACA,IAAI,EAAEQ,QAAQ,CAAC;IAC5B,CAAC;EACH;EAEA,OAAOC,UAAUA,CAACC,GAAwB,EAAmB;IAC3D,MAAMZ,QAAQ,GAAGY,GAAG,CAACZ,QAAQ;IAC7B,MAAMC,OAAO,GAAGW,GAAG,CAACX,OAAO;IAC3B,MAAMC,IAAI,GAAGU,GAAG,CAACV,IAAI,GAAGW,gCAAc,CAACF,UAAU,CAACC,GAAG,CAACV,IAAI,CAAC,GAAGY,SAAS;IACvE,OAAO,IAAIjB,eAAe,CAACG,QAAQ,EAAEC,OAAO,EAAEC,IAAI,CAAC;EACrD;AACF;AAACa,OAAA,CAAAlB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ import { SchemaLocation, SchemaNode } from '../../schema-node';
2
+ /**
3
+ * e.g. `@deprecated please use something else`
4
+ */
5
+ export declare class TagSchema extends SchemaNode {
6
+ readonly location: SchemaLocation;
7
+ readonly tagName: TagName | string;
8
+ readonly comment?: string | undefined;
9
+ constructor(location: SchemaLocation, tagName: TagName | string, comment?: string | undefined);
10
+ toString(): string;
11
+ toFullSignature(): string;
12
+ static fromObject(obj: Record<string, any>): TagSchema;
13
+ toObject(): {
14
+ __schema: string;
15
+ location: SchemaLocation;
16
+ name: string | undefined;
17
+ signature: string | undefined;
18
+ tagName: string;
19
+ comment: string | undefined;
20
+ };
21
+ }
22
+ export declare enum TagName {
23
+ augments = "augments",
24
+ author = "author",
25
+ class = "class",
26
+ callback = "callback",
27
+ public = "public",
28
+ private = "private",
29
+ protected = "protected",
30
+ readonly = "readonly",
31
+ override = "override",
32
+ see = "see",
33
+ enum = "enum",
34
+ parameter = "parameter",
35
+ this = "this",
36
+ type = "type",
37
+ template = "template",
38
+ typedef = "typedef",
39
+ property = "property",
40
+ implements = "implements",
41
+ return = "return",
42
+ deprecated = "deprecated",
43
+ exports = "exports",
44
+ link = "link"
45
+ }