Leon4gr45 commited on
Commit
3d2101a
·
verified ·
1 Parent(s): 6abff73

Re-add Swagger dependencies (part 4)

Browse files
Files changed (21) hide show
  1. node_modules/@microsoft/tsdoc/lib-commonjs/parser/StringChecks.js.map +1 -0
  2. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocMessageId.js +428 -0
  3. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocMessageId.js.map +1 -0
  4. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocParser.js +40 -0
  5. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocParser.js.map +1 -0
  6. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TextRange.js +130 -0
  7. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TextRange.js.map +1 -0
  8. node_modules/@microsoft/tsdoc/lib-commonjs/parser/Token.js +174 -0
  9. node_modules/@microsoft/tsdoc/lib-commonjs/parser/Token.js.map +1 -0
  10. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenReader.js +175 -0
  11. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenReader.js.map +1 -0
  12. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenSequence.js +88 -0
  13. node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenSequence.js.map +1 -0
  14. node_modules/@microsoft/tsdoc/lib-commonjs/parser/Tokenizer.js +143 -0
  15. node_modules/@microsoft/tsdoc/lib-commonjs/parser/Tokenizer.js.map +1 -0
  16. node_modules/@microsoft/tsdoc/lib-commonjs/transforms/DocNodeTransforms.js +56 -0
  17. node_modules/@microsoft/tsdoc/lib-commonjs/transforms/DocNodeTransforms.js.map +1 -0
  18. node_modules/@microsoft/tsdoc/lib-commonjs/transforms/TrimSpacesTransform.js +88 -0
  19. node_modules/@microsoft/tsdoc/lib-commonjs/transforms/TrimSpacesTransform.js.map +1 -0
  20. node_modules/@microsoft/tsdoc/package.json +35 -0
  21. node_modules/@microsoft/tsdoc/schemas/tsdoc.schema.json +82 -0
node_modules/@microsoft/tsdoc/lib-commonjs/parser/StringChecks.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"StringChecks.js","sourceRoot":"","sources":["../../src/parser/StringChecks.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;GAEG;AACH,MAAa,YAAY;IA6CvB;;;;OAIG;IACI,MAAM,CAAC,4BAA4B,CAAC,OAAe;QACxD,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACvB,OAAO,gDAAgD,CAAC;QAC1D,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACpD,OAAO,gFAAgF,CAAC;QAC1F,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,oBAAoB,CAAC,OAAe;QAChD,MAAM,WAAW,GAAuB,YAAY,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;QAC3F,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,uBAAuB,CAAC,GAAW;QAC/C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,yBAAyB,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7C,OAAO,CACL,gGAAgG;gBAChG,qDAAqD,CACtD,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAClD,OAAO,2DAA2D,CAAC;QACrE,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,wBAAwB,C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Ae,GAAW,sBAAsB,CAAC;AAEzE,0FAA0F;AAC1F,sGAAsG;AACtG,sGAAsG;AACtG,0EAA0E;AAClD,qCAAwB,GAAW,cAAc,CAAC;AAE1E,4CAA4C;AACpB,yCAA4B,GAAW,QAAQ,CAAC;AAExE,yDAAyD;AACzD,2CAA2C;AAC3C,4IAA4I;AACpH,oCAAuB,GAAW,yCAAyC,CAAC;AAE5E,6BAAgB,GAAgB,IAAI,GAAG,CAAS;IACtE,eAAe;IACf,UAAU;IACV,QAAQ;IACR,aAAa;IAEb,2BAA2B;IAC3B,OAAO;IACP,MAAM;IACN,UAAU;IACV,WAAW;IACX,WAAW;IACX,MAAM;IACN,UAAU;CACX,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * Helpers for validating various text string formats.\r\n */\r\nexport class StringChecks {\r\n private static readonly _tsdocTagNameRegExp: RegExp = /^@[a-z][a-z0-9]*$/i;\r\n\r\n private static readonly _urlSchemeRegExp: RegExp = /^[a-z][a-z0-9]*\\:\\/\\//i;\r\n private static readonly _urlSchemeAfterRegExp: RegExp = /^[a-z][a-z0-9]*\\:\\/\\/./i;\r\n\r\n // HTML element definitions:\r\n // https://spec.commonmark.org/0.29/#tag-name\r\n // https://www.w3.org/TR/html5/syntax.html#tag-name\r\n // https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\r\n //\r\n // We use the CommonMark spec:\r\n // \"A tag name consists of an ASCII letter followed by zero or more ASCII letters, digits, or hyphens (-).\"\r\n private static readonly _htmlNameRegExp: RegExp = /^[a-z]+[a-z0-9\\-]*$/i;\r\n\r\n // Note: In addition to letters, numbers, underscores, and dollar signs, modern ECMAScript\r\n // also allows Unicode categories such as letters, combining marks, digits, and connector punctuation.\r\n // These are mostly supported in all environments except IE11, so if someone wants it, we would accept\r\n // a PR to allow them (although the test surface might be somewhat large).\r\n private static readonly _identifierBadCharRegExp: RegExp = /[^a-z0-9_$]/i;\r\n\r\n // Identifiers most not start with a number.\r\n private static readonly _identifierNumberStartRegExp: RegExp = /^[0-9]/;\r\n\r\n // For detailed notes about NPM package name syntax, see:\r\n // tslint:disable-next-line:max-line-length\r\n // https://github.com/Microsoft/web-build-tools/blob/a417ca25c63aca31dba43a34d39cc9cd529b9c78/libraries/node-core-library/src/PackageName.ts\r\n private static readonly _validPackageNameRegExp: RegExp = /^(?:@[a-z0-9\\-_\\.]+\\/)?[a-z0-9\\-_\\.]+$/i;\r\n\r\n private static readonly _systemSelectors: Set<string> = new Set<string>([\r\n // For classes:\r\n 'instance',\r\n 'static',\r\n 'constructor',\r\n\r\n // For merged declarations:\r\n 'class',\r\n 'enum',\r\n 'function',\r\n 'interface',\r\n 'namespace',\r\n 'type',\r\n 'variable'\r\n ]);\r\n\r\n /**\r\n * Tests whether the input string is a valid TSDoc tag name; if not, returns an error message.\r\n * TSDoc tag names start with an at-sign (\"@\") followed by ASCII letters using\r\n * \"camelCase\" capitalization.\r\n */\r\n public static explainIfInvalidTSDocTagName(tagName: string): string | undefined {\r\n if (tagName[0] !== '@') {\r\n return 'A TSDoc tag name must start with an \"@\" symbol';\r\n }\r\n\r\n if (!StringChecks._tsdocTagNameRegExp.test(tagName)) {\r\n return 'A TSDoc tag name must start with a letter and contain only letters and numbers';\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Throws an exception if the input string is not a valid TSDoc tag name.\r\n * TSDoc tag names start with an at-sign (\"@\") followed by ASCII letters using\r\n * \"camelCase\" capitalization.\r\n */\r\n public static validateTSDocTagName(tagName: string): void {\r\n const explanation: string | undefined = StringChecks.explainIfInvalidTSDocTagName(tagName);\r\n if (explanation) {\r\n throw new Error(explanation);\r\n }\r\n }\r\n\r\n /**\r\n * Tests whether the input string is a URL form supported inside an \"@link\" tag; if not,\r\n * returns an error message.\r\n */\r\n public static explainIfInvalidLinkUrl(url: string): string | undefined {\r\n if (url.length === 0) {\r\n return 'The URL cannot be empty';\r\n }\r\n if (!StringChecks._urlSchemeRegExp.test(url)) {\r\n return (\r\n 'An @link URL must begin with a scheme comprised only of letters and numbers followed by \"://\".' +\r\n ' (For general URLs, use an HTML \"<a>\" tag instead.)'\r\n );\r\n }\r\n if (!StringChecks._urlSchemeAfterRegExp.test(url)) {\r\n return 'An @link URL must have at least one character after \"://\"';\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Tests whether the input string is a valid HTML element or attribute name.\r\n */\r\n public static explainIfInvalidHtmlName(htmlName: string): string | undefined {\r\n if (!StringChecks._htmlNameRegExp.test(htmlName)) {\r\n return 'An HTML name must be an ASCII letter followed by zero or more letters, digits, or hyphens';\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Throws an exception if the input string is a not valid HTML element or attribute name.\r\n */\r\n public static validateHtmlName(htmlName: string): void {\r\n const explanation: string | undefined = StringChecks.explainIfInvalidHtmlName(htmlName);\r\n if (explanation) {\r\n throw new Error(explanation);\r\n }\r\n }\r\n\r\n /**\r\n * Tests whether the input string is a valid NPM package name.\r\n */\r\n public static explainIfInvalidPackageName(packageName: string): string | undefined {\r\n if (packageName.length === 0) {\r\n return 'The package name cannot be an empty string';\r\n }\r\n\r\n if (!StringChecks._validPackageNameRegExp.test(packageName)) {\r\n return `The package name ${JSON.stringify(packageName)} is not a valid package name`;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Tests whether the input string is a valid declaration reference import path.\r\n */\r\n public static explainIfInvalidImportPath(\r\n importPath: string,\r\n prefixedByPackageName: boolean\r\n ): string | undefined {\r\n if (importPath.length > 0) {\r\n if (importPath.indexOf('//') >= 0) {\r\n return 'An import path must not contain \"//\"';\r\n }\r\n if (importPath[importPath.length - 1] === '/') {\r\n return 'An import path must not end with \"/\"';\r\n }\r\n\r\n if (!prefixedByPackageName) {\r\n if (importPath[0] === '/') {\r\n return 'An import path must not start with \"/\" unless prefixed by a package name';\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Returns true if the input string is a TSDoc system selector.\r\n */\r\n public static isSystemSelector(selector: string): boolean {\r\n return StringChecks._systemSelectors.has(selector);\r\n }\r\n\r\n /**\r\n * Tests whether the input string is a valid ECMAScript identifier.\r\n * A precise check is extremely complicated and highly dependent on the standard version\r\n * and how faithfully the interpreter implements it, so here we use a conservative heuristic.\r\n */\r\n public static explainIfInvalidUnquotedIdentifier(identifier: string): string | undefined {\r\n if (identifier.length === 0) {\r\n return 'The identifier cannot be an empty string';\r\n }\r\n\r\n if (StringChecks._identifierBadCharRegExp.test(identifier)) {\r\n return 'The identifier cannot non-word characters';\r\n }\r\n\r\n if (StringChecks._identifierNumberStartRegExp.test(identifier)) {\r\n return 'The identifier must not start with a number';\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Tests whether the input string can be used without quotes as a member identifier in a declaration reference.\r\n * If not, it should be enclosed in quotes.\r\n */\r\n public static explainIfInvalidUnquotedMemberIdentifier(identifier: string): string | undefined {\r\n const explanation: string | undefined = StringChecks.explainIfInvalidUnquotedIdentifier(identifier);\r\n if (explanation !== undefined) {\r\n return explanation;\r\n }\r\n\r\n if (StringChecks.isSystemSelector(identifier)) {\r\n // We do this to avoid confusion about the declaration reference syntax rules.\r\n // For example if someone were to see \"MyClass.(static:instance)\" it would be unclear which\r\n // side the colon is the selector.\r\n return `The identifier \"${identifier}\" must be quoted because it is a TSDoc system selector name`;\r\n }\r\n\r\n return undefined;\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocMessageId.js ADDED
@@ -0,0 +1,428 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.allTsdocMessageIdsSet = exports.allTsdocMessageIds = exports.TSDocMessageId = void 0;
6
+ /**
7
+ * Unique identifiers for messages reported by the TSDoc parser.
8
+ *
9
+ * @remarks
10
+ *
11
+ * These strings are possible values for the {@link ParserMessage.messageId} property.
12
+ * These identifiers can be used to suppress or configure the reporting of individual messages.
13
+ * They are also useful when searching for help about a particular error.
14
+ *
15
+ * @public
16
+ */
17
+ var TSDocMessageId;
18
+ (function (TSDocMessageId) {
19
+ /**
20
+ * File not found
21
+ * @remarks
22
+ * Reported by the `@microsoft/tsdoc-config` package when it failed to find a `tsdoc.json` file.
23
+ */
24
+ TSDocMessageId["ConfigFileNotFound"] = "tsdoc-config-file-not-found";
25
+ /**
26
+ * Error parsing JSON input: ___
27
+ * @remarks
28
+ * Reported by the `@microsoft/tsdoc-config` package when the `tsdoc.json` file has invalid JSON syntax.
29
+ */
30
+ TSDocMessageId["ConfigInvalidJson"] = "tsdoc-config-invalid-json";
31
+ /**
32
+ * Unsupported JSON "$schema" value
33
+ * @remarks
34
+ * Reported by the `@microsoft/tsdoc-config` package when the file format is not supported.
35
+ */
36
+ TSDocMessageId["ConfigFileUnsupportedSchema"] = "tsdoc-config-unsupported-schema";
37
+ /**
38
+ * Error loading config file: ___
39
+ * @remarks
40
+ * Reported by the `@microsoft/tsdoc-config` package when the config file doesn't conform to its schema.
41
+ */
42
+ TSDocMessageId["ConfigFileSchemaError"] = "tsdoc-config-schema-error";
43
+ /**
44
+ * Circular reference encountered for "extends" field of "___"
45
+ * @remarks
46
+ * Reported by the `@microsoft/tsdoc-config` package when the "extends" field creates a chain of references
47
+ * that causes a file to indirectly extend itself.
48
+ */
49
+ TSDocMessageId["ConfigFileCyclicExtends"] = "tsdoc-config-cyclic-extends";
50
+ /**
51
+ * Unable to resolve "extends" reference to "___"
52
+ * @remarks
53
+ * Reported by the `@microsoft/tsdoc-config` package when module resolution fails for the "extends" field.
54
+ */
55
+ TSDocMessageId["ConfigFileUnresolvedExtends"] = "tsdoc-config-unresolved-extends";
56
+ /**
57
+ * The "supportForTags" field refers to an undefined tag "___".
58
+ * @remarks
59
+ * Reported by the `@microsoft/tsdoc-config` package when loading the tsdoc.json config file.
60
+ */
61
+ TSDocMessageId["ConfigFileUndefinedTag"] = "tsdoc-config-undefined-tag";
62
+ /**
63
+ * The "tagDefinitions" field specifies more than one tag with the name "___".
64
+ * @remarks
65
+ * Reported by the `@microsoft/tsdoc-config` package when loading the tsdoc.json config file.
66
+ */
67
+ TSDocMessageId["ConfigFileDuplicateTagName"] = "tsdoc-config-duplicate-tag-name";
68
+ /**
69
+ * A TSDoc tag name must start with a letter and contain only letters and numbers.
70
+ * @remarks
71
+ * Reported by the `@microsoft/tsdoc-config` package when loading the tsdoc.json config file.
72
+ */
73
+ TSDocMessageId["ConfigFileInvalidTagName"] = "tsdoc-config-invalid-tag-name";
74
+ /**
75
+ * Expecting a `/**` comment.
76
+ * Unexpected end of input.
77
+ */
78
+ TSDocMessageId["CommentNotFound"] = "tsdoc-comment-not-found";
79
+ /**
80
+ * Expecting a leading `/**`
81
+ */
82
+ TSDocMessageId["CommentOpeningDelimiterSyntax"] = "tsdoc-comment-missing-opening-delimiter";
83
+ /**
84
+ * Unexpected end of input.
85
+ */
86
+ TSDocMessageId["CommentMissingClosingDelimiter"] = "tsdoc-comment-missing-closing-delimiter";
87
+ /**
88
+ * A doc comment cannot have more than one `@inheritDoc` tag
89
+ */
90
+ TSDocMessageId["ExtraInheritDocTag"] = "tsdoc-extra-inheritdoc-tag";
91
+ /**
92
+ * The `}` character should be escaped using a backslash to avoid confusion with a TSDoc inline tag.
93
+ */
94
+ TSDocMessageId["EscapeRightBrace"] = "tsdoc-escape-right-brace";
95
+ /**
96
+ * The `>` character should be escaped using a backslash to avoid confusion with an HTML tag.
97
+ */
98
+ TSDocMessageId["EscapeGreaterThan"] = "tsdoc-escape-greater-than";
99
+ /**
100
+ * The ___ block must include a deprecation message, e.g. describing the recommended alternative.
101
+ */
102
+ TSDocMessageId["MissingDeprecationMessage"] = "tsdoc-missing-deprecation-message";
103
+ /**
104
+ * A ___ block must not be used, because that content is provided by the `@inheritDoc` tag.
105
+ */
106
+ TSDocMessageId["InheritDocIncompatibleTag"] = "tsdoc-inheritdoc-incompatible-tag";
107
+ /**
108
+ * The summary section must not have any content, because that content is provided by the `@inheritDoc` tag.
109
+ */
110
+ TSDocMessageId["InheritDocIncompatibleSummary"] = "tsdoc-inheritdoc-incompatible-summary";
111
+ /**
112
+ * The TSDoc tag ___ is an inline tag; it must be enclosed in `{ }` braces.
113
+ */
114
+ TSDocMessageId["InlineTagMissingBraces"] = "tsdoc-inline-tag-missing-braces";
115
+ /**
116
+ * The TSDoc tag ___ is not an inline tag; it must not be enclosed in `{ }` braces.
117
+ */
118
+ TSDocMessageId["TagShouldNotHaveBraces"] = "tsdoc-tag-should-not-have-braces";
119
+ /**
120
+ * The TSDoc tag ___ is not supported by this tool.
121
+ */
122
+ TSDocMessageId["UnsupportedTag"] = "tsdoc-unsupported-tag";
123
+ /**
124
+ * The TSDoc tag ___ is not defined in this configuration.
125
+ */
126
+ TSDocMessageId["UndefinedTag"] = "tsdoc-undefined-tag";
127
+ /**
128
+ * The `@param` block should not include a JSDoc-style `{type}`.
129
+ */
130
+ TSDocMessageId["ParamTagWithInvalidType"] = "tsdoc-param-tag-with-invalid-type";
131
+ /**
132
+ * The `@param` block should not include a JSDoc-style optional name; it must not be enclosed in `[ ]` brackets.
133
+ */
134
+ TSDocMessageId["ParamTagWithInvalidOptionalName"] = "tsdoc-param-tag-with-invalid-optional-name";
135
+ /**
136
+ * The `@param` block should be followed by a parameter name.
137
+ */
138
+ TSDocMessageId["ParamTagWithInvalidName"] = "tsdoc-param-tag-with-invalid-name";
139
+ /**
140
+ * The `@param` block should be followed by a parameter name and then a hyphen.
141
+ */
142
+ TSDocMessageId["ParamTagMissingHyphen"] = "tsdoc-param-tag-missing-hyphen";
143
+ /**
144
+ * A backslash must precede another character that is being escaped. OR
145
+ * A backslash can only be used to escape a punctuation character.
146
+ */
147
+ TSDocMessageId["UnnecessaryBackslash"] = "tsdoc-unnecessary-backslash";
148
+ /**
149
+ * Expecting a TSDoc tag starting with `@`. OR
150
+ * Expecting a TSDoc tag starting with `{`.
151
+ */
152
+ TSDocMessageId["MissingTag"] = "tsdoc-missing-tag";
153
+ /**
154
+ * The `@` character looks like part of a TSDoc tag; use a backslash to escape it.
155
+ */
156
+ TSDocMessageId["AtSignInWord"] = "tsdoc-at-sign-in-word";
157
+ /**
158
+ * Expecting a TSDoc tag name after `@`; if it is not a tag, use a backslash to escape this character.
159
+ */
160
+ TSDocMessageId["AtSignWithoutTagName"] = "tsdoc-at-sign-without-tag-name";
161
+ /**
162
+ * Expecting a TSDoc tag starting with `{@`. OR
163
+ * Expecting a TSDoc inline tag name after the `{@` characters.
164
+ */
165
+ TSDocMessageId["MalformedInlineTag"] = "tsdoc-malformed-inline-tag";
166
+ /**
167
+ * The token ___ looks like a TSDoc tag but contains an invalid character ___; if it is not a tag,
168
+ * use a backslash to escape the `@`.
169
+ */
170
+ TSDocMessageId["CharactersAfterBlockTag"] = "tsdoc-characters-after-block-tag";
171
+ /**
172
+ * A TSDoc tag name must start with a letter and contain only letters and numbers.
173
+ */
174
+ TSDocMessageId["MalformedTagName"] = "tsdoc-malformed-tag-name";
175
+ /**
176
+ * The character ___ cannot appear after the TSDoc tag name; expecting a space.
177
+ */
178
+ TSDocMessageId["CharactersAfterInlineTag"] = "tsdoc-characters-after-inline-tag";
179
+ /**
180
+ * The TSDoc inline tag name is missing its closing `}`.
181
+ */
182
+ TSDocMessageId["InlineTagMissingRightBrace"] = "tsdoc-inline-tag-missing-right-brace";
183
+ /**
184
+ * The `{` character must be escaped with a backslash when used inside a TSDoc inline tag.
185
+ */
186
+ TSDocMessageId["InlineTagUnescapedBrace"] = "tsdoc-inline-tag-unescaped-brace";
187
+ /**
188
+ * Unexpected character after declaration reference.
189
+ */
190
+ TSDocMessageId["InheritDocTagSyntax"] = "tsdoc-inheritdoc-tag-syntax";
191
+ /**
192
+ * The `@link` tag content is missing.
193
+ */
194
+ TSDocMessageId["LinkTagEmpty"] = "tsdoc-link-tag-empty";
195
+ /**
196
+ * The ___ character may not be used in the link text without escaping it.
197
+ */
198
+ TSDocMessageId["LinkTagUnescapedText"] = "tsdoc-link-tag-unescaped-text";
199
+ /**
200
+ * Unexpected character after link destination.
201
+ */
202
+ TSDocMessageId["LinkTagDestinationSyntax"] = "tsdoc-link-tag-destination-syntax";
203
+ /**
204
+ * The URL cannot be empty. OR
205
+ * An `@link` URL must begin with a scheme comprised only of letters and numbers followed by `://`. OR
206
+ * An `@link` URL must have at least one character after `://`.
207
+ */
208
+ TSDocMessageId["LinkTagInvalidUrl"] = "tsdoc-link-tag-invalid-url";
209
+ /**
210
+ * The declaration reference appears to contain a package name or import path, but it is missing the `#` delimiter.
211
+ */
212
+ TSDocMessageId["ReferenceMissingHash"] = "tsdoc-reference-missing-hash";
213
+ /**
214
+ * The hash character must be preceded by a package name or import path.
215
+ */
216
+ TSDocMessageId["ReferenceHashSyntax"] = "tsdoc-reference-hash-syntax";
217
+ /**
218
+ * The package name cannot be an empty string. OR
219
+ * The package name ___ is not a valid package name.
220
+ */
221
+ TSDocMessageId["ReferenceMalformedPackageName"] = "tsdoc-reference-malformed-package-name";
222
+ /**
223
+ * An import path must not contain `//`. OR
224
+ * An import path must not end with `/`. OR
225
+ * An import path must not start with `/` unless prefixed by a package name.
226
+ */
227
+ TSDocMessageId["ReferenceMalformedImportPath"] = "tsdoc-reference-malformed-import-path";
228
+ /**
229
+ * Expecting a declaration reference.
230
+ */
231
+ TSDocMessageId["MissingReference"] = "tsdoc-missing-reference";
232
+ /**
233
+ * Expecting a period before the next component of a declaration reference
234
+ */
235
+ TSDocMessageId["ReferenceMissingDot"] = "tsdoc-reference-missing-dot";
236
+ /**
237
+ * Syntax error in declaration reference: the member selector must be enclosed in parentheses.
238
+ */
239
+ TSDocMessageId["ReferenceSelectorMissingParens"] = "tsdoc-reference-selector-missing-parens";
240
+ /**
241
+ * Expecting a colon after the identifier because the expression is in parentheses.
242
+ */
243
+ TSDocMessageId["ReferenceMissingColon"] = "tsdoc-reference-missing-colon";
244
+ /**
245
+ * Expecting a matching right parenthesis.
246
+ */
247
+ TSDocMessageId["ReferenceMissingRightParen"] = "tsdoc-reference-missing-right-paren";
248
+ /**
249
+ * Missing declaration reference in symbol reference
250
+ */
251
+ TSDocMessageId["ReferenceSymbolSyntax"] = "tsdoc-reference-symbol-syntax";
252
+ /**
253
+ * Missing closing square bracket for symbol reference
254
+ */
255
+ TSDocMessageId["ReferenceMissingRightBracket"] = "tsdoc-reference-missing-right-bracket";
256
+ /**
257
+ * Unexpected end of input inside quoted member identifier.
258
+ */
259
+ TSDocMessageId["ReferenceMissingQuote"] = "tsdoc-reference-missing-quote";
260
+ /**
261
+ * The quoted identifier cannot be empty.
262
+ */
263
+ TSDocMessageId["ReferenceEmptyIdentifier"] = "tsdoc-reference-empty-identifier";
264
+ /**
265
+ * Syntax error in declaration reference: expecting a member identifier.
266
+ */
267
+ TSDocMessageId["ReferenceMissingIdentifier"] = "tsdoc-reference-missing-identifier";
268
+ /**
269
+ * The identifier cannot be an empty string. OR
270
+ * The identifier cannot non-word characters. OR
271
+ * The identifier must not start with a number. OR
272
+ * The identifier ___ must be quoted because it is a TSDoc system selector name.
273
+ */
274
+ TSDocMessageId["ReferenceUnquotedIdentifier"] = "tsdoc-reference-unquoted-identifier";
275
+ /**
276
+ * Expecting a selector label after the colon.
277
+ */
278
+ TSDocMessageId["ReferenceMissingLabel"] = "tsdoc-reference-missing-label";
279
+ /**
280
+ * The selector cannot be an empty string. OR
281
+ * If the selector begins with a number, it must be a positive integer value. OR
282
+ * A label selector must be comprised of upper case letters, numbers, and underscores
283
+ * and must not start with a number. OR
284
+ * The selector ___ is not a recognized TSDoc system selector name.
285
+ */
286
+ TSDocMessageId["ReferenceSelectorSyntax"] = "tsdoc-reference-selector-syntax";
287
+ /**
288
+ * Expecting an attribute or `>` or `/>`.
289
+ */
290
+ TSDocMessageId["HtmlTagMissingGreaterThan"] = "tsdoc-html-tag-missing-greater-than";
291
+ /**
292
+ * Expecting `=` after HTML attribute name.
293
+ */
294
+ TSDocMessageId["HtmlTagMissingEquals"] = "tsdoc-html-tag-missing-equals";
295
+ /**
296
+ * Expecting an HTML string starting with a single-quote or double-quote character.
297
+ */
298
+ TSDocMessageId["HtmlTagMissingString"] = "tsdoc-html-tag-missing-string";
299
+ /**
300
+ * The HTML string is missing its closing quote.
301
+ */
302
+ TSDocMessageId["HtmlStringMissingQuote"] = "tsdoc-html-string-missing-quote";
303
+ /**
304
+ * The next character after a closing quote must be spacing or punctuation.
305
+ */
306
+ TSDocMessageId["TextAfterHtmlString"] = "tsdoc-text-after-html-string";
307
+ /**
308
+ * Expecting an HTML tag starting with `</`.
309
+ */
310
+ TSDocMessageId["MissingHtmlEndTag"] = "tsdoc-missing-html-end-tag";
311
+ /**
312
+ * A space is not allowed here. OR
313
+ * Expecting an HTML name. OR
314
+ * An HTML name must be a sequence of letters separated by hyphens.
315
+ */
316
+ TSDocMessageId["MalformedHtmlName"] = "tsdoc-malformed-html-name";
317
+ /**
318
+ * This HTML element name is not defined by your TSDoc configuration.
319
+ */
320
+ TSDocMessageId["UnsupportedHtmlElementName"] = "tsdoc-unsupported-html-name";
321
+ /**
322
+ * The opening backtick for a code fence must appear at the start of the line.
323
+ */
324
+ TSDocMessageId["CodeFenceOpeningIndent"] = "tsdoc-code-fence-opening-indent";
325
+ /**
326
+ * The language specifier cannot contain backtick characters.
327
+ */
328
+ TSDocMessageId["CodeFenceSpecifierSyntax"] = "tsdoc-code-fence-specifier-syntax";
329
+ /**
330
+ * The closing delimiter for a code fence must not be indented.
331
+ */
332
+ TSDocMessageId["CodeFenceClosingIndent"] = "tsdoc-code-fence-closing-indent";
333
+ /**
334
+ * Missing closing delimiter.
335
+ */
336
+ TSDocMessageId["CodeFenceMissingDelimiter"] = "tsdoc-code-fence-missing-delimiter";
337
+ /**
338
+ * Unexpected characters after closing delimiter for code fence.
339
+ */
340
+ TSDocMessageId["CodeFenceClosingSyntax"] = "tsdoc-code-fence-closing-syntax";
341
+ /**
342
+ * A code span must contain at least one character between the backticks.
343
+ */
344
+ TSDocMessageId["CodeSpanEmpty"] = "tsdoc-code-span-empty";
345
+ /**
346
+ * The code span is missing its closing backtick.
347
+ */
348
+ TSDocMessageId["CodeSpanMissingDelimiter"] = "tsdoc-code-span-missing-delimiter";
349
+ })(TSDocMessageId || (exports.TSDocMessageId = TSDocMessageId = {}));
350
+ // Exposed via TSDocConfiguration.allTsdocMessageIds()
351
+ exports.allTsdocMessageIds = [
352
+ // To make comparisons easy, keep these in the same order as the enum above:
353
+ 'tsdoc-config-file-not-found',
354
+ 'tsdoc-config-invalid-json',
355
+ 'tsdoc-config-unsupported-schema',
356
+ 'tsdoc-config-schema-error',
357
+ 'tsdoc-config-cyclic-extends',
358
+ 'tsdoc-config-unresolved-extends',
359
+ 'tsdoc-config-undefined-tag',
360
+ 'tsdoc-config-duplicate-tag-name',
361
+ 'tsdoc-config-invalid-tag-name',
362
+ 'tsdoc-comment-not-found',
363
+ 'tsdoc-comment-missing-opening-delimiter',
364
+ 'tsdoc-comment-missing-closing-delimiter',
365
+ 'tsdoc-extra-inheritdoc-tag',
366
+ 'tsdoc-escape-right-brace',
367
+ 'tsdoc-escape-greater-than',
368
+ 'tsdoc-missing-deprecation-message',
369
+ 'tsdoc-inheritdoc-incompatible-tag',
370
+ 'tsdoc-inheritdoc-incompatible-summary',
371
+ 'tsdoc-inline-tag-missing-braces',
372
+ 'tsdoc-tag-should-not-have-braces',
373
+ 'tsdoc-unsupported-tag',
374
+ 'tsdoc-undefined-tag',
375
+ 'tsdoc-param-tag-with-invalid-type',
376
+ 'tsdoc-param-tag-with-invalid-optional-name',
377
+ 'tsdoc-param-tag-with-invalid-name',
378
+ 'tsdoc-param-tag-missing-hyphen',
379
+ 'tsdoc-unnecessary-backslash',
380
+ 'tsdoc-missing-tag',
381
+ 'tsdoc-at-sign-in-word',
382
+ 'tsdoc-at-sign-without-tag-name',
383
+ 'tsdoc-malformed-inline-tag',
384
+ 'tsdoc-characters-after-block-tag',
385
+ 'tsdoc-malformed-tag-name',
386
+ 'tsdoc-characters-after-inline-tag',
387
+ 'tsdoc-inline-tag-missing-right-brace',
388
+ 'tsdoc-inline-tag-unescaped-brace',
389
+ 'tsdoc-inheritdoc-tag-syntax',
390
+ 'tsdoc-link-tag-empty',
391
+ 'tsdoc-link-tag-unescaped-text',
392
+ 'tsdoc-link-tag-destination-syntax',
393
+ 'tsdoc-link-tag-invalid-url',
394
+ 'tsdoc-reference-missing-hash',
395
+ 'tsdoc-reference-hash-syntax',
396
+ 'tsdoc-reference-malformed-package-name',
397
+ 'tsdoc-reference-malformed-import-path',
398
+ 'tsdoc-missing-reference',
399
+ 'tsdoc-reference-missing-dot',
400
+ 'tsdoc-reference-selector-missing-parens',
401
+ 'tsdoc-reference-missing-colon',
402
+ 'tsdoc-reference-missing-right-paren',
403
+ 'tsdoc-reference-symbol-syntax',
404
+ 'tsdoc-reference-missing-right-bracket',
405
+ 'tsdoc-reference-missing-quote',
406
+ 'tsdoc-reference-empty-identifier',
407
+ 'tsdoc-reference-missing-identifier',
408
+ 'tsdoc-reference-unquoted-identifier',
409
+ 'tsdoc-reference-missing-label',
410
+ 'tsdoc-reference-selector-syntax',
411
+ 'tsdoc-html-tag-missing-greater-than',
412
+ 'tsdoc-html-tag-missing-equals',
413
+ 'tsdoc-html-tag-missing-string',
414
+ 'tsdoc-html-string-missing-quote',
415
+ 'tsdoc-text-after-html-string',
416
+ 'tsdoc-missing-html-end-tag',
417
+ 'tsdoc-malformed-html-name',
418
+ 'tsdoc-code-fence-opening-indent',
419
+ 'tsdoc-code-fence-specifier-syntax',
420
+ 'tsdoc-code-fence-closing-indent',
421
+ 'tsdoc-code-fence-missing-delimiter',
422
+ 'tsdoc-code-fence-closing-syntax',
423
+ 'tsdoc-code-span-empty',
424
+ 'tsdoc-code-span-missing-delimiter'
425
+ ];
426
+ exports.allTsdocMessageIds.sort();
427
+ exports.allTsdocMessageIdsSet = new Set(exports.allTsdocMessageIds);
428
+ //# sourceMappingURL=TSDocMessageId.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocMessageId.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"TSDocMessageId.js","sourceRoot":"","sources":["../../src/parser/TSDocMessageId.ts"],"names":[],"mappings":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nC,iCAAiC;IACjC,oCAAoC;IACpC,iCAAiC;IACjC,uBAAuB;IACvB,mCAAmC;CACpC,CAAC;AACF,0BAAkB,CAAC,IAAI,EAAE,CAAC;AAEb,QAAA,qBAAqB,GAAwB,IAAI,GAAG,CAAS,0BAAkB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * Unique identifiers for messages reported by the TSDoc parser.\r\n *\r\n * @remarks\r\n *\r\n * These strings are possible values for the {@link ParserMessage.messageId} property.\r\n * These identifiers can be used to suppress or configure the reporting of individual messages.\r\n * They are also useful when searching for help about a particular error.\r\n *\r\n * @public\r\n */\r\nexport enum TSDocMessageId {\r\n /**\r\n * File not found\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when it failed to find a `tsdoc.json` file.\r\n */\r\n ConfigFileNotFound = 'tsdoc-config-file-not-found',\r\n\r\n /**\r\n * Error parsing JSON input: ___\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when the `tsdoc.json` file has invalid JSON syntax.\r\n */\r\n ConfigInvalidJson = 'tsdoc-config-invalid-json',\r\n\r\n /**\r\n * Unsupported JSON \"$schema\" value\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when the file format is not supported.\r\n */\r\n ConfigFileUnsupportedSchema = 'tsdoc-config-unsupported-schema',\r\n\r\n /**\r\n * Error loading config file: ___\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when the config file doesn't conform to its schema.\r\n */\r\n ConfigFileSchemaError = 'tsdoc-config-schema-error',\r\n\r\n /**\r\n * Circular reference encountered for \"extends\" field of \"___\"\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when the \"extends\" field creates a chain of references\r\n * that causes a file to indirectly extend itself.\r\n */\r\n ConfigFileCyclicExtends = 'tsdoc-config-cyclic-extends',\r\n\r\n /**\r\n * Unable to resolve \"extends\" reference to \"___\"\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when module resolution fails for the \"extends\" field.\r\n */\r\n ConfigFileUnresolvedExtends = 'tsdoc-config-unresolved-extends',\r\n\r\n /**\r\n * The \"supportForTags\" field refers to an undefined tag \"___\".\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when loading the tsdoc.json config file.\r\n */\r\n ConfigFileUndefinedTag = 'tsdoc-config-undefined-tag',\r\n\r\n /**\r\n * The \"tagDefinitions\" field specifies more than one tag with the name \"___\".\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when loading the tsdoc.json config file.\r\n */\r\n ConfigFileDuplicateTagName = 'tsdoc-config-duplicate-tag-name',\r\n\r\n /**\r\n * A TSDoc tag name must start with a letter and contain only letters and numbers.\r\n * @remarks\r\n * Reported by the `@microsoft/tsdoc-config` package when loading the tsdoc.json config file.\r\n */\r\n ConfigFileInvalidTagName = 'tsdoc-config-invalid-tag-name',\r\n\r\n /**\r\n * Expecting a `/**` comment.\r\n * Unexpected end of input.\r\n */\r\n CommentNotFound = 'tsdoc-comment-not-found',\r\n\r\n /**\r\n * Expecting a leading `/**`\r\n */\r\n CommentOpeningDelimiterSyntax = 'tsdoc-comment-missing-opening-delimiter',\r\n\r\n /**\r\n * Unexpected end of input.\r\n */\r\n CommentMissingClosingDelimiter = 'tsdoc-comment-missing-closing-delimiter',\r\n\r\n /**\r\n * A doc comment cannot have more than one `@inheritDoc` tag\r\n */\r\n ExtraInheritDocTag = 'tsdoc-extra-inheritdoc-tag',\r\n\r\n /**\r\n * The `}` character should be escaped using a backslash to avoid confusion with a TSDoc inline tag.\r\n */\r\n EscapeRightBrace = 'tsdoc-escape-right-brace',\r\n\r\n /**\r\n * The `>` character should be escaped using a backslash to avoid confusion with an HTML tag.\r\n */\r\n EscapeGreaterThan = 'tsdoc-escape-greater-than',\r\n\r\n /**\r\n * The ___ block must include a deprecation message, e.g. describing the recommended alternative.\r\n */\r\n MissingDeprecationMessage = 'tsdoc-missing-deprecation-message',\r\n\r\n /**\r\n * A ___ block must not be used, because that content is provided by the `@inheritDoc` tag.\r\n */\r\n InheritDocIncompatibleTag = 'tsdoc-inheritdoc-incompatible-tag',\r\n\r\n /**\r\n * The summary section must not have any content, because that content is provided by the `@inheritDoc` tag.\r\n */\r\n InheritDocIncompatibleSummary = 'tsdoc-inheritdoc-incompatible-summary',\r\n\r\n /**\r\n * The TSDoc tag ___ is an inline tag; it must be enclosed in `{ }` braces.\r\n */\r\n InlineTagMissingBraces = 'tsdoc-inline-tag-missing-braces',\r\n\r\n /**\r\n * The TSDoc tag ___ is not an inline tag; it must not be enclosed in `{ }` braces.\r\n */\r\n TagShouldNotHaveBraces = 'tsdoc-tag-should-not-have-braces',\r\n\r\n /**\r\n * The TSDoc tag ___ is not supported by this tool.\r\n */\r\n UnsupportedTag = 'tsdoc-unsupported-tag',\r\n\r\n /**\r\n * The TSDoc tag ___ is not defined in this configuration.\r\n */\r\n UndefinedTag = 'tsdoc-undefined-tag',\r\n\r\n /**\r\n * The `@param` block should not include a JSDoc-style `{type}`.\r\n */\r\n ParamTagWithInvalidType = 'tsdoc-param-tag-with-invalid-type',\r\n\r\n /**\r\n * The `@param` block should not include a JSDoc-style optional name; it must not be enclosed in `[ ]` brackets.\r\n */\r\n ParamTagWithInvalidOptionalName = 'tsdoc-param-tag-with-invalid-optional-name',\r\n\r\n /**\r\n * The `@param` block should be followed by a parameter name.\r\n */\r\n ParamTagWithInvalidName = 'tsdoc-param-tag-with-invalid-name',\r\n\r\n /**\r\n * The `@param` block should be followed by a parameter name and then a hyphen.\r\n */\r\n ParamTagMissingHyphen = 'tsdoc-param-tag-missing-hyphen',\r\n\r\n /**\r\n * A backslash must precede another character that is being escaped. OR\r\n * A backslash can only be used to escape a punctuation character.\r\n */\r\n UnnecessaryBackslash = 'tsdoc-unnecessary-backslash',\r\n\r\n /**\r\n * Expecting a TSDoc tag starting with `@`. OR\r\n * Expecting a TSDoc tag starting with `{`.\r\n */\r\n MissingTag = 'tsdoc-missing-tag',\r\n\r\n /**\r\n * The `@` character looks like part of a TSDoc tag; use a backslash to escape it.\r\n */\r\n AtSignInWord = 'tsdoc-at-sign-in-word',\r\n\r\n /**\r\n * Expecting a TSDoc tag name after `@`; if it is not a tag, use a backslash to escape this character.\r\n */\r\n AtSignWithoutTagName = 'tsdoc-at-sign-without-tag-name',\r\n\r\n /**\r\n * Expecting a TSDoc tag starting with `{@`. OR\r\n * Expecting a TSDoc inline tag name after the `{@` characters.\r\n */\r\n MalformedInlineTag = 'tsdoc-malformed-inline-tag',\r\n\r\n /**\r\n * The token ___ looks like a TSDoc tag but contains an invalid character ___; if it is not a tag,\r\n * use a backslash to escape the `@`.\r\n */\r\n CharactersAfterBlockTag = 'tsdoc-characters-after-block-tag',\r\n\r\n /**\r\n * A TSDoc tag name must start with a letter and contain only letters and numbers.\r\n */\r\n MalformedTagName = 'tsdoc-malformed-tag-name',\r\n\r\n /**\r\n * The character ___ cannot appear after the TSDoc tag name; expecting a space.\r\n */\r\n CharactersAfterInlineTag = 'tsdoc-characters-after-inline-tag',\r\n\r\n /**\r\n * The TSDoc inline tag name is missing its closing `}`.\r\n */\r\n InlineTagMissingRightBrace = 'tsdoc-inline-tag-missing-right-brace',\r\n\r\n /**\r\n * The `{` character must be escaped with a backslash when used inside a TSDoc inline tag.\r\n */\r\n InlineTagUnescapedBrace = 'tsdoc-inline-tag-unescaped-brace',\r\n\r\n /**\r\n * Unexpected character after declaration reference.\r\n */\r\n InheritDocTagSyntax = 'tsdoc-inheritdoc-tag-syntax',\r\n\r\n /**\r\n * The `@link` tag content is missing.\r\n */\r\n LinkTagEmpty = 'tsdoc-link-tag-empty',\r\n\r\n /**\r\n * The ___ character may not be used in the link text without escaping it.\r\n */\r\n LinkTagUnescapedText = 'tsdoc-link-tag-unescaped-text',\r\n\r\n /**\r\n * Unexpected character after link destination.\r\n */\r\n LinkTagDestinationSyntax = 'tsdoc-link-tag-destination-syntax',\r\n\r\n /**\r\n * The URL cannot be empty. OR\r\n * An `@link` URL must begin with a scheme comprised only of letters and numbers followed by `://`. OR\r\n * An `@link` URL must have at least one character after `://`.\r\n */\r\n LinkTagInvalidUrl = 'tsdoc-link-tag-invalid-url',\r\n\r\n /**\r\n * The declaration reference appears to contain a package name or import path, but it is missing the `#` delimiter.\r\n */\r\n ReferenceMissingHash = 'tsdoc-reference-missing-hash',\r\n\r\n /**\r\n * The hash character must be preceded by a package name or import path.\r\n */\r\n ReferenceHashSyntax = 'tsdoc-reference-hash-syntax',\r\n\r\n /**\r\n * The package name cannot be an empty string. OR\r\n * The package name ___ is not a valid package name.\r\n */\r\n ReferenceMalformedPackageName = 'tsdoc-reference-malformed-package-name',\r\n\r\n /**\r\n * An import path must not contain `//`. OR\r\n * An import path must not end with `/`. OR\r\n * An import path must not start with `/` unless prefixed by a package name.\r\n */\r\n ReferenceMalformedImportPath = 'tsdoc-reference-malformed-import-path',\r\n\r\n /**\r\n * Expecting a declaration reference.\r\n */\r\n MissingReference = 'tsdoc-missing-reference',\r\n\r\n /**\r\n * Expecting a period before the next component of a declaration reference\r\n */\r\n ReferenceMissingDot = 'tsdoc-reference-missing-dot',\r\n\r\n /**\r\n * Syntax error in declaration reference: the member selector must be enclosed in parentheses.\r\n */\r\n ReferenceSelectorMissingParens = 'tsdoc-reference-selector-missing-parens',\r\n\r\n /**\r\n * Expecting a colon after the identifier because the expression is in parentheses.\r\n */\r\n ReferenceMissingColon = 'tsdoc-reference-missing-colon',\r\n\r\n /**\r\n * Expecting a matching right parenthesis.\r\n */\r\n ReferenceMissingRightParen = 'tsdoc-reference-missing-right-paren',\r\n\r\n /**\r\n * Missing declaration reference in symbol reference\r\n */\r\n ReferenceSymbolSyntax = 'tsdoc-reference-symbol-syntax',\r\n\r\n /**\r\n * Missing closing square bracket for symbol reference\r\n */\r\n ReferenceMissingRightBracket = 'tsdoc-reference-missing-right-bracket',\r\n\r\n /**\r\n * Unexpected end of input inside quoted member identifier.\r\n */\r\n ReferenceMissingQuote = 'tsdoc-reference-missing-quote',\r\n\r\n /**\r\n * The quoted identifier cannot be empty.\r\n */\r\n ReferenceEmptyIdentifier = 'tsdoc-reference-empty-identifier',\r\n\r\n /**\r\n * Syntax error in declaration reference: expecting a member identifier.\r\n */\r\n ReferenceMissingIdentifier = 'tsdoc-reference-missing-identifier',\r\n\r\n /**\r\n * The identifier cannot be an empty string. OR\r\n * The identifier cannot non-word characters. OR\r\n * The identifier must not start with a number. OR\r\n * The identifier ___ must be quoted because it is a TSDoc system selector name.\r\n */\r\n ReferenceUnquotedIdentifier = 'tsdoc-reference-unquoted-identifier',\r\n\r\n /**\r\n * Expecting a selector label after the colon.\r\n */\r\n ReferenceMissingLabel = 'tsdoc-reference-missing-label',\r\n\r\n /**\r\n * The selector cannot be an empty string. OR\r\n * If the selector begins with a number, it must be a positive integer value. OR\r\n * A label selector must be comprised of upper case letters, numbers, and underscores\r\n * and must not start with a number. OR\r\n * The selector ___ is not a recognized TSDoc system selector name.\r\n */\r\n ReferenceSelectorSyntax = 'tsdoc-reference-selector-syntax',\r\n\r\n /**\r\n * Expecting an attribute or `>` or `/>`.\r\n */\r\n HtmlTagMissingGreaterThan = 'tsdoc-html-tag-missing-greater-than',\r\n\r\n /**\r\n * Expecting `=` after HTML attribute name.\r\n */\r\n HtmlTagMissingEquals = 'tsdoc-html-tag-missing-equals',\r\n\r\n /**\r\n * Expecting an HTML string starting with a single-quote or double-quote character.\r\n */\r\n HtmlTagMissingString = 'tsdoc-html-tag-missing-string',\r\n\r\n /**\r\n * The HTML string is missing its closing quote.\r\n */\r\n HtmlStringMissingQuote = 'tsdoc-html-string-missing-quote',\r\n\r\n /**\r\n * The next character after a closing quote must be spacing or punctuation.\r\n */\r\n TextAfterHtmlString = 'tsdoc-text-after-html-string',\r\n\r\n /**\r\n * Expecting an HTML tag starting with `</`.\r\n */\r\n MissingHtmlEndTag = 'tsdoc-missing-html-end-tag',\r\n\r\n /**\r\n * A space is not allowed here. OR\r\n * Expecting an HTML name. OR\r\n * An HTML name must be a sequence of letters separated by hyphens.\r\n */\r\n MalformedHtmlName = 'tsdoc-malformed-html-name',\r\n\r\n /**\r\n * This HTML element name is not defined by your TSDoc configuration.\r\n */\r\n UnsupportedHtmlElementName = 'tsdoc-unsupported-html-name',\r\n\r\n /**\r\n * The opening backtick for a code fence must appear at the start of the line.\r\n */\r\n CodeFenceOpeningIndent = 'tsdoc-code-fence-opening-indent',\r\n\r\n /**\r\n * The language specifier cannot contain backtick characters.\r\n */\r\n CodeFenceSpecifierSyntax = 'tsdoc-code-fence-specifier-syntax',\r\n\r\n /**\r\n * The closing delimiter for a code fence must not be indented.\r\n */\r\n CodeFenceClosingIndent = 'tsdoc-code-fence-closing-indent',\r\n\r\n /**\r\n * Missing closing delimiter.\r\n */\r\n CodeFenceMissingDelimiter = 'tsdoc-code-fence-missing-delimiter',\r\n\r\n /**\r\n * Unexpected characters after closing delimiter for code fence.\r\n */\r\n CodeFenceClosingSyntax = 'tsdoc-code-fence-closing-syntax',\r\n\r\n /**\r\n * A code span must contain at least one character between the backticks.\r\n */\r\n CodeSpanEmpty = 'tsdoc-code-span-empty',\r\n\r\n /**\r\n * The code span is missing its closing backtick.\r\n */\r\n CodeSpanMissingDelimiter = 'tsdoc-code-span-missing-delimiter'\r\n}\r\n\r\n// Exposed via TSDocConfiguration.allTsdocMessageIds()\r\nexport const allTsdocMessageIds: string[] = [\r\n // To make comparisons easy, keep these in the same order as the enum above:\r\n 'tsdoc-config-file-not-found',\r\n 'tsdoc-config-invalid-json',\r\n 'tsdoc-config-unsupported-schema',\r\n 'tsdoc-config-schema-error',\r\n 'tsdoc-config-cyclic-extends',\r\n 'tsdoc-config-unresolved-extends',\r\n 'tsdoc-config-undefined-tag',\r\n 'tsdoc-config-duplicate-tag-name',\r\n 'tsdoc-config-invalid-tag-name',\r\n\r\n 'tsdoc-comment-not-found',\r\n 'tsdoc-comment-missing-opening-delimiter',\r\n 'tsdoc-comment-missing-closing-delimiter',\r\n 'tsdoc-extra-inheritdoc-tag',\r\n 'tsdoc-escape-right-brace',\r\n 'tsdoc-escape-greater-than',\r\n 'tsdoc-missing-deprecation-message',\r\n 'tsdoc-inheritdoc-incompatible-tag',\r\n 'tsdoc-inheritdoc-incompatible-summary',\r\n 'tsdoc-inline-tag-missing-braces',\r\n 'tsdoc-tag-should-not-have-braces',\r\n 'tsdoc-unsupported-tag',\r\n 'tsdoc-undefined-tag',\r\n 'tsdoc-param-tag-with-invalid-type',\r\n 'tsdoc-param-tag-with-invalid-optional-name',\r\n 'tsdoc-param-tag-with-invalid-name',\r\n 'tsdoc-param-tag-missing-hyphen',\r\n 'tsdoc-unnecessary-backslash',\r\n 'tsdoc-missing-tag',\r\n 'tsdoc-at-sign-in-word',\r\n 'tsdoc-at-sign-without-tag-name',\r\n 'tsdoc-malformed-inline-tag',\r\n 'tsdoc-characters-after-block-tag',\r\n 'tsdoc-malformed-tag-name',\r\n 'tsdoc-characters-after-inline-tag',\r\n 'tsdoc-inline-tag-missing-right-brace',\r\n 'tsdoc-inline-tag-unescaped-brace',\r\n 'tsdoc-inheritdoc-tag-syntax',\r\n 'tsdoc-link-tag-empty',\r\n 'tsdoc-link-tag-unescaped-text',\r\n 'tsdoc-link-tag-destination-syntax',\r\n 'tsdoc-link-tag-invalid-url',\r\n 'tsdoc-reference-missing-hash',\r\n 'tsdoc-reference-hash-syntax',\r\n 'tsdoc-reference-malformed-package-name',\r\n 'tsdoc-reference-malformed-import-path',\r\n 'tsdoc-missing-reference',\r\n 'tsdoc-reference-missing-dot',\r\n 'tsdoc-reference-selector-missing-parens',\r\n 'tsdoc-reference-missing-colon',\r\n 'tsdoc-reference-missing-right-paren',\r\n 'tsdoc-reference-symbol-syntax',\r\n 'tsdoc-reference-missing-right-bracket',\r\n 'tsdoc-reference-missing-quote',\r\n 'tsdoc-reference-empty-identifier',\r\n 'tsdoc-reference-missing-identifier',\r\n 'tsdoc-reference-unquoted-identifier',\r\n 'tsdoc-reference-missing-label',\r\n 'tsdoc-reference-selector-syntax',\r\n 'tsdoc-html-tag-missing-greater-than',\r\n 'tsdoc-html-tag-missing-equals',\r\n 'tsdoc-html-tag-missing-string',\r\n 'tsdoc-html-string-missing-quote',\r\n 'tsdoc-text-after-html-string',\r\n 'tsdoc-missing-html-end-tag',\r\n 'tsdoc-malformed-html-name',\r\n 'tsdoc-code-fence-opening-indent',\r\n 'tsdoc-code-fence-specifier-syntax',\r\n 'tsdoc-code-fence-closing-indent',\r\n 'tsdoc-code-fence-missing-delimiter',\r\n 'tsdoc-code-fence-closing-syntax',\r\n 'tsdoc-code-span-empty',\r\n 'tsdoc-code-span-missing-delimiter'\r\n];\r\nallTsdocMessageIds.sort();\r\n\r\nexport const allTsdocMessageIdsSet: ReadonlySet<string> = new Set<string>(allTsdocMessageIds);\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocParser.js ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.TSDocParser = void 0;
6
+ const TextRange_1 = require("./TextRange");
7
+ const ParserContext_1 = require("./ParserContext");
8
+ const LineExtractor_1 = require("./LineExtractor");
9
+ const Tokenizer_1 = require("./Tokenizer");
10
+ const NodeParser_1 = require("./NodeParser");
11
+ const TSDocConfiguration_1 = require("../configuration/TSDocConfiguration");
12
+ const ParagraphSplitter_1 = require("./ParagraphSplitter");
13
+ /**
14
+ * The main API for parsing TSDoc comments.
15
+ */
16
+ class TSDocParser {
17
+ constructor(configuration) {
18
+ if (configuration) {
19
+ this.configuration = configuration;
20
+ }
21
+ else {
22
+ this.configuration = new TSDocConfiguration_1.TSDocConfiguration();
23
+ }
24
+ }
25
+ parseString(text) {
26
+ return this.parseRange(TextRange_1.TextRange.fromString(text));
27
+ }
28
+ parseRange(range) {
29
+ const parserContext = new ParserContext_1.ParserContext(this.configuration, range);
30
+ if (LineExtractor_1.LineExtractor.extract(parserContext)) {
31
+ parserContext.tokens = Tokenizer_1.Tokenizer.readTokens(parserContext.lines);
32
+ const nodeParser = new NodeParser_1.NodeParser(parserContext);
33
+ nodeParser.parse();
34
+ ParagraphSplitter_1.ParagraphSplitter.splitParagraphs(parserContext.docComment);
35
+ }
36
+ return parserContext;
37
+ }
38
+ }
39
+ exports.TSDocParser = TSDocParser;
40
+ //# sourceMappingURL=TSDocParser.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TSDocParser.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"TSDocParser.js","sourceRoot":"","sources":["../../src/parser/TSDocParser.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,2CAAwC;AACxC,mDAAgD;AAChD,mDAAgD;AAChD,2CAAwC;AACxC,6CAA0C;AAC1C,4EAAyE;AACzE,2DAAwD;AAExD;;GAEG;AACH,MAAa,WAAW;IAMtB,YAAmB,aAAkC;QACnD,IAAI,aAAa,EAAE,CAAC;YAClB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,aAAa,GAAG,IAAI,uCAAkB,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;IAEM,WAAW,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,qBAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC;IAEM,UAAU,CAAC,KAAgB;QAChC,MAAM,aAAa,GAAkB,IAAI,6BAAa,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QAElF,IAAI,6BAAa,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YACzC,aAAa,CAAC,MAAM,GAAG,qBAAS,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAEjE,MAAM,UAAU,GAAe,IAAI,uBAAU,CAAC,aAAa,CAAC,CAAC;YAC7D,UAAU,CAAC,KAAK,EAAE,CAAC;YAEnB,qCAAiB,CAAC,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAhCD,kCAgCC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { TextRange } from './TextRange';\r\nimport { ParserContext } from './ParserContext';\r\nimport { LineExtractor } from './LineExtractor';\r\nimport { Tokenizer } from './Tokenizer';\r\nimport { NodeParser } from './NodeParser';\r\nimport { TSDocConfiguration } from '../configuration/TSDocConfiguration';\r\nimport { ParagraphSplitter } from './ParagraphSplitter';\r\n\r\n/**\r\n * The main API for parsing TSDoc comments.\r\n */\r\nexport class TSDocParser {\r\n /**\r\n * The configuration that was provided for the TSDocParser.\r\n */\r\n public readonly configuration: TSDocConfiguration;\r\n\r\n public constructor(configuration?: TSDocConfiguration) {\r\n if (configuration) {\r\n this.configuration = configuration;\r\n } else {\r\n this.configuration = new TSDocConfiguration();\r\n }\r\n }\r\n\r\n public parseString(text: string): ParserContext {\r\n return this.parseRange(TextRange.fromString(text));\r\n }\r\n\r\n public parseRange(range: TextRange): ParserContext {\r\n const parserContext: ParserContext = new ParserContext(this.configuration, range);\r\n\r\n if (LineExtractor.extract(parserContext)) {\r\n parserContext.tokens = Tokenizer.readTokens(parserContext.lines);\r\n\r\n const nodeParser: NodeParser = new NodeParser(parserContext);\r\n nodeParser.parse();\r\n\r\n ParagraphSplitter.splitParagraphs(parserContext.docComment);\r\n }\r\n\r\n return parserContext;\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TextRange.js ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.TextRange = void 0;
6
+ /**
7
+ * Efficiently references a range of text from a string buffer.
8
+ */
9
+ class TextRange {
10
+ constructor(buffer, pos, end) {
11
+ this.buffer = buffer;
12
+ this.pos = pos;
13
+ this.end = end;
14
+ this._validateBounds();
15
+ }
16
+ /**
17
+ * Constructs a TextRange that corresponds to an entire string object.
18
+ */
19
+ static fromString(buffer) {
20
+ return new TextRange(buffer, 0, buffer.length);
21
+ }
22
+ /**
23
+ * Constructs a TextRange that corresponds to an entire string object.
24
+ */
25
+ static fromStringRange(buffer, pos, end) {
26
+ return new TextRange(buffer, pos, end);
27
+ }
28
+ /**
29
+ * Returns the length of the text range.
30
+ * @remarks
31
+ * This value is calculated as the `end` property minus the `pos` property.
32
+ */
33
+ get length() {
34
+ return this.end - this.pos;
35
+ }
36
+ /**
37
+ * Constructs a TextRange that corresponds to a different range of an existing buffer.
38
+ */
39
+ getNewRange(pos, end) {
40
+ return new TextRange(this.buffer, pos, end);
41
+ }
42
+ /**
43
+ * Returns true if the length of the range is zero. Note that the object reference may not
44
+ * be equal to `TextRange.empty`, and the buffer may be different.
45
+ */
46
+ isEmpty() {
47
+ return this.pos === this.end;
48
+ }
49
+ /**
50
+ * Returns the range from the associated string buffer.
51
+ */
52
+ toString() {
53
+ return this.buffer.substring(this.pos, this.end);
54
+ }
55
+ /**
56
+ * Returns a debugging dump of the range, indicated via custom delimiters.
57
+ * @remarks
58
+ * For example if the delimiters are "[" and "]", and the range is 3..5 inside "1234567",
59
+ * then the output would be "12[345]67".
60
+ */
61
+ getDebugDump(posDelimiter, endDelimiter) {
62
+ return (this.buffer.substring(0, this.pos) +
63
+ posDelimiter +
64
+ this.buffer.substring(this.pos, this.end) +
65
+ endDelimiter +
66
+ this.buffer.substring(this.end));
67
+ }
68
+ /**
69
+ * Calculates the line and column number for the specified offset into the buffer.
70
+ *
71
+ * @remarks
72
+ * This is a potentially expensive operation.
73
+ *
74
+ * @param index - an integer offset
75
+ * @param buffer - the buffer
76
+ */
77
+ getLocation(index) {
78
+ if (index < 0 || index > this.buffer.length) {
79
+ // No match
80
+ return { line: 0, column: 0 };
81
+ }
82
+ // TODO: Consider caching or optimizing this somehow
83
+ let line = 1;
84
+ let column = 1;
85
+ let currentIndex = 0;
86
+ while (currentIndex < index) {
87
+ const current = this.buffer[currentIndex];
88
+ ++currentIndex;
89
+ if (current === '\r') {
90
+ // CR
91
+ // Ignore '\r' and assume it will always have an accompanying '\n'
92
+ continue;
93
+ }
94
+ if (current === '\n') {
95
+ // LF
96
+ ++line;
97
+ column = 1;
98
+ }
99
+ else {
100
+ // NOTE: For consistency with the TypeScript compiler, a tab character is assumed
101
+ // to advance by one column
102
+ ++column;
103
+ }
104
+ }
105
+ return { line, column };
106
+ }
107
+ _validateBounds() {
108
+ if (this.pos < 0) {
109
+ throw new Error('TextRange.pos cannot be negative');
110
+ }
111
+ if (this.end < 0) {
112
+ throw new Error('TextRange.end cannot be negative');
113
+ }
114
+ if (this.end < this.pos) {
115
+ throw new Error('TextRange.end cannot be smaller than TextRange.pos');
116
+ }
117
+ if (this.pos > this.buffer.length) {
118
+ throw new Error('TextRange.pos cannot exceed the associated text buffer length');
119
+ }
120
+ if (this.end > this.buffer.length) {
121
+ throw new Error('TextRange.end cannot exceed the associated text buffer length');
122
+ }
123
+ }
124
+ }
125
+ exports.TextRange = TextRange;
126
+ /**
127
+ * Used to represent an empty or unknown range.
128
+ */
129
+ TextRange.empty = new TextRange('', 0, 0);
130
+ //# sourceMappingURL=TextRange.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TextRange.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"TextRange.js","sourceRoot":"","sources":["../../src/parser/TextRange.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAe3D;;GAEG;AACH,MAAa,SAAS;IA2BpB,YAAoB,MAAc,EAAE,GAAW,EAAE,GAAW;QAC1D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,UAAU,CAAC,MAAc;QACrC,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,GAAW,EAAE,GAAW;QACpE,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,GAAW,EAAE,GAAW;QACzC,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACI,OAAO;QACZ,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,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AC;QAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;;AA5JH,8BA6JC;AA5JC;;GAEG;AACoB,eAAK,GAAc,IAAI,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * Text coordinates represented as a line number and column number.\r\n *\r\n * @remarks\r\n * The first character in a file is considered to be in column 1 of line 1.\r\n * The location with column 0 and line 0 is used to represent an empty, unspecified,\r\n * or unknown location.\r\n */\r\nexport interface ITextLocation {\r\n line: number;\r\n column: number;\r\n}\r\n\r\n/**\r\n * Efficiently references a range of text from a string buffer.\r\n */\r\nexport class TextRange {\r\n /**\r\n * Used to represent an empty or unknown range.\r\n */\r\n public static readonly empty: TextRange = new TextRange('', 0, 0);\r\n\r\n /**\r\n * The starting index into the associated text buffer.\r\n *\r\n * @remarks\r\n * The text range corresponds to the `range.buffer.substring(range.pos, range.end)`.\r\n */\r\n public readonly pos: number;\r\n\r\n /**\r\n * The (non-inclusive) ending index for the associated text buffer.\r\n *\r\n * @remarks\r\n * The text range corresponds to the `range.buffer.substring(range.pos, range.end)`.\r\n */\r\n public readonly end: number;\r\n\r\n /**\r\n * The string buffer that the `pos` and `end` indexes refer to.\r\n */\r\n public readonly buffer: string;\r\n\r\n private constructor(buffer: string, pos: number, end: number) {\r\n this.buffer = buffer;\r\n this.pos = pos;\r\n this.end = end;\r\n this._validateBounds();\r\n }\r\n\r\n /**\r\n * Constructs a TextRange that corresponds to an entire string object.\r\n */\r\n public static fromString(buffer: string): TextRange {\r\n return new TextRange(buffer, 0, buffer.length);\r\n }\r\n\r\n /**\r\n * Constructs a TextRange that corresponds to an entire string object.\r\n */\r\n public static fromStringRange(buffer: string, pos: number, end: number): TextRange {\r\n return new TextRange(buffer, pos, end);\r\n }\r\n\r\n /**\r\n * Returns the length of the text range.\r\n * @remarks\r\n * This value is calculated as the `end` property minus the `pos` property.\r\n */\r\n public get length(): number {\r\n return this.end - this.pos;\r\n }\r\n\r\n /**\r\n * Constructs a TextRange that corresponds to a different range of an existing buffer.\r\n */\r\n public getNewRange(pos: number, end: number): TextRange {\r\n return new TextRange(this.buffer, pos, end);\r\n }\r\n\r\n /**\r\n * Returns true if the length of the range is zero. Note that the object reference may not\r\n * be equal to `TextRange.empty`, and the buffer may be different.\r\n */\r\n public isEmpty(): boolean {\r\n return this.pos === this.end;\r\n }\r\n\r\n /**\r\n * Returns the range from the associated string buffer.\r\n */\r\n public toString(): string {\r\n return this.buffer.substring(this.pos, this.end);\r\n }\r\n\r\n /**\r\n * Returns a debugging dump of the range, indicated via custom delimiters.\r\n * @remarks\r\n * For example if the delimiters are \"[\" and \"]\", and the range is 3..5 inside \"1234567\",\r\n * then the output would be \"12[345]67\".\r\n */\r\n public getDebugDump(posDelimiter: string, endDelimiter: string): string {\r\n return (\r\n this.buffer.substring(0, this.pos) +\r\n posDelimiter +\r\n this.buffer.substring(this.pos, this.end) +\r\n endDelimiter +\r\n this.buffer.substring(this.end)\r\n );\r\n }\r\n\r\n /**\r\n * Calculates the line and column number for the specified offset into the buffer.\r\n *\r\n * @remarks\r\n * This is a potentially expensive operation.\r\n *\r\n * @param index - an integer offset\r\n * @param buffer - the buffer\r\n */\r\n public getLocation(index: number): ITextLocation {\r\n if (index < 0 || index > this.buffer.length) {\r\n // No match\r\n return { line: 0, column: 0 };\r\n }\r\n\r\n // TODO: Consider caching or optimizing this somehow\r\n let line: number = 1;\r\n let column: number = 1;\r\n\r\n let currentIndex: number = 0;\r\n\r\n while (currentIndex < index) {\r\n const current: string = this.buffer[currentIndex];\r\n ++currentIndex;\r\n\r\n if (current === '\\r') {\r\n // CR\r\n // Ignore '\\r' and assume it will always have an accompanying '\\n'\r\n continue;\r\n }\r\n\r\n if (current === '\\n') {\r\n // LF\r\n ++line;\r\n column = 1;\r\n } else {\r\n // NOTE: For consistency with the TypeScript compiler, a tab character is assumed\r\n // to advance by one column\r\n ++column;\r\n }\r\n }\r\n\r\n return { line, column };\r\n }\r\n\r\n private _validateBounds(): void {\r\n if (this.pos < 0) {\r\n throw new Error('TextRange.pos cannot be negative');\r\n }\r\n if (this.end < 0) {\r\n throw new Error('TextRange.end cannot be negative');\r\n }\r\n if (this.end < this.pos) {\r\n throw new Error('TextRange.end cannot be smaller than TextRange.pos');\r\n }\r\n if (this.pos > this.buffer.length) {\r\n throw new Error('TextRange.pos cannot exceed the associated text buffer length');\r\n }\r\n if (this.end > this.buffer.length) {\r\n throw new Error('TextRange.end cannot exceed the associated text buffer length');\r\n }\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/parser/Token.js ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Token = exports.TokenKind = void 0;
6
+ /**
7
+ * Distinguishes different types of Token objects.
8
+ */
9
+ var TokenKind;
10
+ (function (TokenKind) {
11
+ /**
12
+ * A token representing the end of the input. The Token.range will be an empty range
13
+ * at the end of the provided input.
14
+ */
15
+ TokenKind[TokenKind["EndOfInput"] = 2001] = "EndOfInput";
16
+ /**
17
+ * A token representing a virtual newline.
18
+ * The Token.range will be an empty range, because the actual newline character may
19
+ * be noncontiguous due to the doc comment delimiter trimming.
20
+ */
21
+ TokenKind[TokenKind["Newline"] = 2002] = "Newline";
22
+ /**
23
+ * A token representing one or more spaces and tabs (but not newlines or end of input).
24
+ */
25
+ TokenKind[TokenKind["Spacing"] = 2003] = "Spacing";
26
+ /**
27
+ * A token representing one or more ASCII letters, numbers, and underscores.
28
+ */
29
+ TokenKind[TokenKind["AsciiWord"] = 2004] = "AsciiWord";
30
+ /**
31
+ * A single ASCII character that behaves like punctuation, e.g. doesn't need whitespace
32
+ * around it when adjacent to a letter. The Token.range will always be a string of length 1.
33
+ */
34
+ TokenKind[TokenKind["OtherPunctuation"] = 2005] = "OtherPunctuation";
35
+ /**
36
+ * A token representing a sequence of non-ASCII printable characters that are not punctuation.
37
+ */
38
+ TokenKind[TokenKind["Other"] = 2006] = "Other";
39
+ /**
40
+ * The backslash character `\`.
41
+ * The Token.range will always be a string of length 1.
42
+ */
43
+ TokenKind[TokenKind["Backslash"] = 2007] = "Backslash";
44
+ /**
45
+ * The less-than character `<`.
46
+ * The Token.range will always be a string of length 1.
47
+ */
48
+ TokenKind[TokenKind["LessThan"] = 2008] = "LessThan";
49
+ /**
50
+ * The greater-than character `>`.
51
+ * The Token.range will always be a string of length 1.
52
+ */
53
+ TokenKind[TokenKind["GreaterThan"] = 2009] = "GreaterThan";
54
+ /**
55
+ * The equals character `=`.
56
+ * The Token.range will always be a string of length 1.
57
+ */
58
+ TokenKind[TokenKind["Equals"] = 2010] = "Equals";
59
+ /**
60
+ * The single-quote character `'`.
61
+ * The Token.range will always be a string of length 1.
62
+ */
63
+ TokenKind[TokenKind["SingleQuote"] = 2011] = "SingleQuote";
64
+ /**
65
+ * The double-quote character `"`.
66
+ * The Token.range will always be a string of length 1.
67
+ */
68
+ TokenKind[TokenKind["DoubleQuote"] = 2012] = "DoubleQuote";
69
+ /**
70
+ * The slash character `/`.
71
+ * The Token.range will always be a string of length 1.
72
+ */
73
+ TokenKind[TokenKind["Slash"] = 2013] = "Slash";
74
+ /**
75
+ * The hyphen character `-`.
76
+ * The Token.range will always be a string of length 1.
77
+ */
78
+ TokenKind[TokenKind["Hyphen"] = 2014] = "Hyphen";
79
+ /**
80
+ * The at-sign character `@`.
81
+ * The Token.range will always be a string of length 1.
82
+ */
83
+ TokenKind[TokenKind["AtSign"] = 2015] = "AtSign";
84
+ /**
85
+ * The left curly bracket character `{`.
86
+ * The Token.range will always be a string of length 1.
87
+ */
88
+ TokenKind[TokenKind["LeftCurlyBracket"] = 2016] = "LeftCurlyBracket";
89
+ /**
90
+ * The right curly bracket character `}`.
91
+ * The Token.range will always be a string of length 1.
92
+ */
93
+ TokenKind[TokenKind["RightCurlyBracket"] = 2017] = "RightCurlyBracket";
94
+ /**
95
+ * The backtick character.
96
+ * The Token.range will always be a string of length 1.
97
+ */
98
+ TokenKind[TokenKind["Backtick"] = 2018] = "Backtick";
99
+ /**
100
+ * The period character.
101
+ * The Token.range will always be a string of length 1.
102
+ */
103
+ TokenKind[TokenKind["Period"] = 2019] = "Period";
104
+ /**
105
+ * The colon character.
106
+ * The Token.range will always be a string of length 1.
107
+ */
108
+ TokenKind[TokenKind["Colon"] = 2020] = "Colon";
109
+ /**
110
+ * The comma character.
111
+ * The Token.range will always be a string of length 1.
112
+ */
113
+ TokenKind[TokenKind["Comma"] = 2021] = "Comma";
114
+ /**
115
+ * The left square bracket character.
116
+ * The Token.range will always be a string of length 1.
117
+ */
118
+ TokenKind[TokenKind["LeftSquareBracket"] = 2022] = "LeftSquareBracket";
119
+ /**
120
+ * The right square bracket character.
121
+ * The Token.range will always be a string of length 1.
122
+ */
123
+ TokenKind[TokenKind["RightSquareBracket"] = 2023] = "RightSquareBracket";
124
+ /**
125
+ * The pipe character `|`.
126
+ * The Token.range will always be a string of length 1.
127
+ */
128
+ TokenKind[TokenKind["Pipe"] = 2024] = "Pipe";
129
+ /**
130
+ * The left parenthesis character.
131
+ * The Token.range will always be a string of length 1.
132
+ */
133
+ TokenKind[TokenKind["LeftParenthesis"] = 2025] = "LeftParenthesis";
134
+ /**
135
+ * The right parenthesis character.
136
+ * The Token.range will always be a string of length 1.
137
+ */
138
+ TokenKind[TokenKind["RightParenthesis"] = 2026] = "RightParenthesis";
139
+ /**
140
+ * The pound character ("#").
141
+ * The Token.range will always be a string of length 1.
142
+ */
143
+ TokenKind[TokenKind["PoundSymbol"] = 2027] = "PoundSymbol";
144
+ /**
145
+ * The plus character ("+").
146
+ * The Token.range will always be a string of length 1.
147
+ */
148
+ TokenKind[TokenKind["Plus"] = 2028] = "Plus";
149
+ /**
150
+ * The dollar sign character ("$").
151
+ * The Token.range will always be a string of length 1.
152
+ */
153
+ TokenKind[TokenKind["DollarSign"] = 2029] = "DollarSign";
154
+ })(TokenKind || (exports.TokenKind = TokenKind = {}));
155
+ /**
156
+ * Represents a contiguous range of characters extracted from one of the doc comment lines
157
+ * being processed by the Tokenizer. There is a token representing a newline, but otherwise
158
+ * a single token cannot span multiple lines.
159
+ */
160
+ class Token {
161
+ constructor(kind, range, line) {
162
+ this.kind = kind;
163
+ this.range = range;
164
+ this.line = line;
165
+ }
166
+ toString() {
167
+ if (this.kind === TokenKind.Newline) {
168
+ return '\n';
169
+ }
170
+ return this.range.toString();
171
+ }
172
+ }
173
+ exports.Token = Token;
174
+ //# sourceMappingURL=Token.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/parser/Token.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"Token.js","sourceRoot":"","sources":["../../src/parser/Token.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D;;GAEG;AACH,IAAY,SA4KX;AA5KD,WAAY,SAAS;IACnB;;;OAGG;IACH,wDAAiB,CAAA;IAEjB;;;;OAIG;IACH,kDAAc,CAAA;IAEd;;OAEG;IACH,kDAAc,CAAA;IAEd;;OAEG;IACH,sDAAgB,CAAA;IAEhB;;;OAGG;IACH,oEAAuB,CAAA;IAEvB;;OAEG;IACH,8CAAY,CAAA;IAEZ;;;OAGG;IACH,sDAAgB,CAAA;IAEhB;;;OAGG;IACH,oDAAe,CAAA;IAEf;;;OAGG;IACH,0DAAkB,CAAA;IAElB;;;OAGG;IACH,gDAAa,CAAA;IAEb;;;OAGG;IACH,0DAAkB,CAAA;IAElB;;;OAGG;IACH,0DAAkB,CAAA;IAElB;;;OAGG;IACH,8CAAY,CAAA;IAEZ;;;OAGG;IACH,gDAAa,CAAA;IAEb;;;OAGG;IACH,gDAAa,CAAA;IAEb;;;OAGG;IACH,oEAAuB,CAAA;IAEvB;;;OAGG;IACH,sEAAwB,CAAA;IAExB;;;OAGG;IACH,oDAAe,CAAA;IAEf;;;OAGG;IACH,gDAAa,CAAA;IAEb;;;OAGG;IACH,8CAAY,CAAA;IAEZ;;;OAGG;IACH,8CAAY,CAAA;IAEZ;;;OAGG;IACH,sEAAwB,CAAA;IAExB;;;OAGG;IACH,wEAAyB,CAAA;IAEzB;;;OAGG;IACH,4CAAW,CAAA;IAEX;;;OAGG;IACH,kEAAsB,CAAA;IAEtB;;;OAGG;IACH,oEAAuB,CAAA;IAEvB;;;OAGG;IACH,0DAAkB,CAAA;IAElB;;;OAGG;IACH,4CAAW,CAAA;IAEX;;;OAGG;IACH,wDAAiB,CAAA;AACnB,CAAC,EA5KW,SAAS,yBAAT,SAAS,QA4KpB;AAED;;;;GAIG;AACH,MAAa,KAAK;IAgBhB,YAAmB,IAAe,EAAE,KAAgB,EAAE,IAAe;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,QAAQ;QACb,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;CACF;AA5BD,sBA4BC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport type { TextRange } from './TextRange';\r\n\r\n/**\r\n * Distinguishes different types of Token objects.\r\n */\r\nexport enum TokenKind {\r\n /**\r\n * A token representing the end of the input. The Token.range will be an empty range\r\n * at the end of the provided input.\r\n */\r\n EndOfInput = 2001,\r\n\r\n /**\r\n * A token representing a virtual newline.\r\n * The Token.range will be an empty range, because the actual newline character may\r\n * be noncontiguous due to the doc comment delimiter trimming.\r\n */\r\n Newline = 2002,\r\n\r\n /**\r\n * A token representing one or more spaces and tabs (but not newlines or end of input).\r\n */\r\n Spacing = 2003,\r\n\r\n /**\r\n * A token representing one or more ASCII letters, numbers, and underscores.\r\n */\r\n AsciiWord = 2004,\r\n\r\n /**\r\n * A single ASCII character that behaves like punctuation, e.g. doesn't need whitespace\r\n * around it when adjacent to a letter. The Token.range will always be a string of length 1.\r\n */\r\n OtherPunctuation = 2005,\r\n\r\n /**\r\n * A token representing a sequence of non-ASCII printable characters that are not punctuation.\r\n */\r\n Other = 2006,\r\n\r\n /**\r\n * The backslash character `\\`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Backslash = 2007,\r\n\r\n /**\r\n * The less-than character `<`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n LessThan = 2008,\r\n\r\n /**\r\n * The greater-than character `>`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n GreaterThan = 2009,\r\n\r\n /**\r\n * The equals character `=`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Equals = 2010,\r\n\r\n /**\r\n * The single-quote character `'`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n SingleQuote = 2011,\r\n\r\n /**\r\n * The double-quote character `\"`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n DoubleQuote = 2012,\r\n\r\n /**\r\n * The slash character `/`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Slash = 2013,\r\n\r\n /**\r\n * The hyphen character `-`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Hyphen = 2014,\r\n\r\n /**\r\n * The at-sign character `@`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n AtSign = 2015,\r\n\r\n /**\r\n * The left curly bracket character `{`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n LeftCurlyBracket = 2016,\r\n\r\n /**\r\n * The right curly bracket character `}`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n RightCurlyBracket = 2017,\r\n\r\n /**\r\n * The backtick character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Backtick = 2018,\r\n\r\n /**\r\n * The period character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Period = 2019,\r\n\r\n /**\r\n * The colon character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Colon = 2020,\r\n\r\n /**\r\n * The comma character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Comma = 2021,\r\n\r\n /**\r\n * The left square bracket character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n LeftSquareBracket = 2022,\r\n\r\n /**\r\n * The right square bracket character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n RightSquareBracket = 2023,\r\n\r\n /**\r\n * The pipe character `|`.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Pipe = 2024,\r\n\r\n /**\r\n * The left parenthesis character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n LeftParenthesis = 2025,\r\n\r\n /**\r\n * The right parenthesis character.\r\n * The Token.range will always be a string of length 1.\r\n */\r\n RightParenthesis = 2026,\r\n\r\n /**\r\n * The pound character (\"#\").\r\n * The Token.range will always be a string of length 1.\r\n */\r\n PoundSymbol = 2027,\r\n\r\n /**\r\n * The plus character (\"+\").\r\n * The Token.range will always be a string of length 1.\r\n */\r\n Plus = 2028,\r\n\r\n /**\r\n * The dollar sign character (\"$\").\r\n * The Token.range will always be a string of length 1.\r\n */\r\n DollarSign = 2029\r\n}\r\n\r\n/**\r\n * Represents a contiguous range of characters extracted from one of the doc comment lines\r\n * being processed by the Tokenizer. There is a token representing a newline, but otherwise\r\n * a single token cannot span multiple lines.\r\n */\r\nexport class Token {\r\n /**\r\n * The kind of token\r\n */\r\n public readonly kind: TokenKind;\r\n /**\r\n * The contiguous input range corresponding to the token. This range will never\r\n * contain a newline character.\r\n */\r\n public readonly range: TextRange;\r\n\r\n /**\r\n * The doc comment \"line\" that this Token was extracted from.\r\n */\r\n public readonly line: TextRange;\r\n\r\n public constructor(kind: TokenKind, range: TextRange, line: TextRange) {\r\n this.kind = kind;\r\n this.range = range;\r\n this.line = line;\r\n }\r\n\r\n public toString(): string {\r\n if (this.kind === TokenKind.Newline) {\r\n return '\\n';\r\n }\r\n return this.range.toString();\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenReader.js ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.TokenReader = void 0;
6
+ const Token_1 = require("./Token");
7
+ const TokenSequence_1 = require("./TokenSequence");
8
+ /**
9
+ * Manages a stream of tokens that are read by the parser.
10
+ *
11
+ * @remarks
12
+ * Use TokenReader.readToken() to read a token and advance the stream pointer.
13
+ * Use TokenReader.peekToken() to preview the next token.
14
+ * Use TokenReader.createMarker() and backtrackToMarker() to rewind to an earlier point.
15
+ * Whenever readToken() is called, the token is added to an accumulated TokenSequence
16
+ * that can be extracted by calling extractAccumulatedSequence().
17
+ */
18
+ class TokenReader {
19
+ constructor(parserContext, embeddedTokenSequence) {
20
+ this._parserContext = parserContext;
21
+ this.tokens = parserContext.tokens;
22
+ if (embeddedTokenSequence) {
23
+ if (embeddedTokenSequence.parserContext !== this._parserContext) {
24
+ throw new Error('The embeddedTokenSequence must use the same parser context');
25
+ }
26
+ this._readerStartIndex = embeddedTokenSequence.startIndex;
27
+ this._readerEndIndex = embeddedTokenSequence.endIndex;
28
+ }
29
+ else {
30
+ this._readerStartIndex = 0;
31
+ this._readerEndIndex = this.tokens.length;
32
+ }
33
+ this._currentIndex = this._readerStartIndex;
34
+ this._accumulatedStartIndex = this._readerStartIndex;
35
+ }
36
+ /**
37
+ * Extracts and returns the TokenSequence that was accumulated so far by calls to readToken().
38
+ * The next call to readToken() will start a new accumulated sequence.
39
+ */
40
+ extractAccumulatedSequence() {
41
+ if (this._accumulatedStartIndex === this._currentIndex) {
42
+ // If this happens, it indicates a parser bug:
43
+ throw new Error('Parser assertion failed: The queue should not be empty when' +
44
+ ' extractAccumulatedSequence() is called');
45
+ }
46
+ const sequence = new TokenSequence_1.TokenSequence({
47
+ parserContext: this._parserContext,
48
+ startIndex: this._accumulatedStartIndex,
49
+ endIndex: this._currentIndex
50
+ });
51
+ this._accumulatedStartIndex = this._currentIndex;
52
+ return sequence;
53
+ }
54
+ /**
55
+ * Returns true if the accumulated sequence has any tokens yet. This will be false
56
+ * when the TokenReader starts, and it will be false immediately after a call
57
+ * to extractAccumulatedSequence(). Otherwise, it will become true whenever readToken()
58
+ * is called.
59
+ */
60
+ isAccumulatedSequenceEmpty() {
61
+ return this._accumulatedStartIndex === this._currentIndex;
62
+ }
63
+ /**
64
+ * Like extractAccumulatedSequence(), but returns undefined if nothing has been
65
+ * accumulated yet.
66
+ */
67
+ tryExtractAccumulatedSequence() {
68
+ if (this.isAccumulatedSequenceEmpty()) {
69
+ return undefined;
70
+ }
71
+ return this.extractAccumulatedSequence();
72
+ }
73
+ /**
74
+ * Asserts that isAccumulatedSequenceEmpty() should return false. If not, an exception
75
+ * is throw indicating a parser bug.
76
+ */
77
+ assertAccumulatedSequenceIsEmpty() {
78
+ if (!this.isAccumulatedSequenceEmpty()) {
79
+ // If this happens, it indicates a parser bug:
80
+ const sequence = new TokenSequence_1.TokenSequence({
81
+ parserContext: this._parserContext,
82
+ startIndex: this._accumulatedStartIndex,
83
+ endIndex: this._currentIndex
84
+ });
85
+ const tokenStrings = sequence.tokens.map((x) => x.toString());
86
+ throw new Error('Parser assertion failed: The queue should be empty, but it contains:\n' +
87
+ JSON.stringify(tokenStrings));
88
+ }
89
+ }
90
+ /**
91
+ * Returns the next token that would be returned by _readToken(), without
92
+ * consuming anything.
93
+ */
94
+ peekToken() {
95
+ return this.tokens[this._currentIndex];
96
+ }
97
+ /**
98
+ * Returns the TokenKind for the next token that would be returned by _readToken(), without
99
+ * consuming anything.
100
+ */
101
+ peekTokenKind() {
102
+ if (this._currentIndex >= this._readerEndIndex) {
103
+ return Token_1.TokenKind.EndOfInput;
104
+ }
105
+ return this.tokens[this._currentIndex].kind;
106
+ }
107
+ /**
108
+ * Like peekTokenKind(), but looks ahead two tokens.
109
+ */
110
+ peekTokenAfterKind() {
111
+ if (this._currentIndex + 1 >= this._readerEndIndex) {
112
+ return Token_1.TokenKind.EndOfInput;
113
+ }
114
+ return this.tokens[this._currentIndex + 1].kind;
115
+ }
116
+ /**
117
+ * Like peekTokenKind(), but looks ahead three tokens.
118
+ */
119
+ peekTokenAfterAfterKind() {
120
+ if (this._currentIndex + 2 >= this._readerEndIndex) {
121
+ return Token_1.TokenKind.EndOfInput;
122
+ }
123
+ return this.tokens[this._currentIndex + 2].kind;
124
+ }
125
+ /**
126
+ * Extract the next token from the input stream and return it.
127
+ * The token will also be appended to the accumulated sequence, which can
128
+ * later be accessed via extractAccumulatedSequence().
129
+ */
130
+ readToken() {
131
+ if (this._currentIndex >= this._readerEndIndex) {
132
+ // If this happens, it's a parser bug
133
+ throw new Error('Cannot read past end of stream');
134
+ }
135
+ const token = this.tokens[this._currentIndex];
136
+ if (token.kind === Token_1.TokenKind.EndOfInput) {
137
+ // We don't allow reading the EndOfInput token, because we want _peekToken()
138
+ // to be always guaranteed to return a valid result.
139
+ // If this happens, it's a parser bug
140
+ throw new Error('The EndOfInput token cannot be read');
141
+ }
142
+ this._currentIndex++;
143
+ return token;
144
+ }
145
+ /**
146
+ * Returns the kind of the token immediately before the current token.
147
+ */
148
+ peekPreviousTokenKind() {
149
+ if (this._currentIndex === 0) {
150
+ return Token_1.TokenKind.EndOfInput;
151
+ }
152
+ return this.tokens[this._currentIndex - 1].kind;
153
+ }
154
+ /**
155
+ * Remembers the current position in the stream.
156
+ */
157
+ createMarker() {
158
+ return this._currentIndex;
159
+ }
160
+ /**
161
+ * Rewinds the stream pointer to a previous position in the stream.
162
+ */
163
+ backtrackToMarker(marker) {
164
+ if (marker > this._currentIndex) {
165
+ // If this happens, it's a parser bug
166
+ throw new Error('The marker has expired');
167
+ }
168
+ this._currentIndex = marker;
169
+ if (marker < this._accumulatedStartIndex) {
170
+ this._accumulatedStartIndex = marker;
171
+ }
172
+ }
173
+ }
174
+ exports.TokenReader = TokenReader;
175
+ //# sourceMappingURL=TokenReader.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenReader.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"TokenReader.js","sourceRoot":"","sources":["../../src/parser/TokenReader.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,mCAAgD;AAChD,mDAAgD;AAGhD;;;;;;;;;GASG;AACH,MAAa,WAAW;IAgBtB,YAAmB,aAA4B,EAAE,qBAAqC;QACpF,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;QAEnC,IAAI,qBAAqB,EAAE,CAAC;YAC1B,IAAI,qBAAqB,CAAC,aAAa,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;gBAChE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;YAChF,CAAC;YACD,IAAI,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,UAAU,CAAC;YAC1D,IAAI,CAAC,eAAe,GAAG,qBAAqB,CAAC,QAAQ,CAAC;QACxD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;YAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;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AI,CAAC,aAAa,CAAC,CAAC;QACrD,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAS,CAAC,UAAU,EAAE,CAAC;YACxC,4EAA4E;YAC5E,oDAAoD;YAEpD,qCAAqC;YACrC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QACD,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,qBAAqB;QAC1B,IAAI,IAAI,CAAC,aAAa,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,iBAAS,CAAC,UAAU,CAAC;QAC9B,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAClD,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,MAAc;QACrC,IAAI,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YAChC,qCAAqC;YACrC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC5C,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC5B,IAAI,MAAM,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACzC,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAhMD,kCAgMC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { type Token, TokenKind } from './Token';\r\nimport { TokenSequence } from './TokenSequence';\r\nimport type { ParserContext } from './ParserContext';\r\n\r\n/**\r\n * Manages a stream of tokens that are read by the parser.\r\n *\r\n * @remarks\r\n * Use TokenReader.readToken() to read a token and advance the stream pointer.\r\n * Use TokenReader.peekToken() to preview the next token.\r\n * Use TokenReader.createMarker() and backtrackToMarker() to rewind to an earlier point.\r\n * Whenever readToken() is called, the token is added to an accumulated TokenSequence\r\n * that can be extracted by calling extractAccumulatedSequence().\r\n */\r\nexport class TokenReader {\r\n public readonly tokens: ReadonlyArray<Token>;\r\n\r\n private readonly _parserContext: ParserContext;\r\n\r\n // The subrange of tokens to be processed by the TokenReader. By default this is\r\n // start=0 and end=tokens.length, unless an embeddedTokenSequence is specified.\r\n private _readerStartIndex: number;\r\n private _readerEndIndex: number;\r\n\r\n // The index of the next token to be read\r\n private _currentIndex: number;\r\n\r\n // The start of the range to be returned by extractAccumulatedSequence()\r\n private _accumulatedStartIndex: number;\r\n\r\n public constructor(parserContext: ParserContext, embeddedTokenSequence?: TokenSequence) {\r\n this._parserContext = parserContext;\r\n this.tokens = parserContext.tokens;\r\n\r\n if (embeddedTokenSequence) {\r\n if (embeddedTokenSequence.parserContext !== this._parserContext) {\r\n throw new Error('The embeddedTokenSequence must use the same parser context');\r\n }\r\n this._readerStartIndex = embeddedTokenSequence.startIndex;\r\n this._readerEndIndex = embeddedTokenSequence.endIndex;\r\n } else {\r\n this._readerStartIndex = 0;\r\n this._readerEndIndex = this.tokens.length;\r\n }\r\n\r\n this._currentIndex = this._readerStartIndex;\r\n this._accumulatedStartIndex = this._readerStartIndex;\r\n }\r\n\r\n /**\r\n * Extracts and returns the TokenSequence that was accumulated so far by calls to readToken().\r\n * The next call to readToken() will start a new accumulated sequence.\r\n */\r\n public extractAccumulatedSequence(): TokenSequence {\r\n if (this._accumulatedStartIndex === this._currentIndex) {\r\n // If this happens, it indicates a parser bug:\r\n throw new Error(\r\n 'Parser assertion failed: The queue should not be empty when' +\r\n ' extractAccumulatedSequence() is called'\r\n );\r\n }\r\n\r\n const sequence: TokenSequence = new TokenSequence({\r\n parserContext: this._parserContext,\r\n startIndex: this._accumulatedStartIndex,\r\n endIndex: this._currentIndex\r\n });\r\n\r\n this._accumulatedStartIndex = this._currentIndex;\r\n\r\n return sequence;\r\n }\r\n\r\n /**\r\n * Returns true if the accumulated sequence has any tokens yet. This will be false\r\n * when the TokenReader starts, and it will be false immediately after a call\r\n * to extractAccumulatedSequence(). Otherwise, it will become true whenever readToken()\r\n * is called.\r\n */\r\n public isAccumulatedSequenceEmpty(): boolean {\r\n return this._accumulatedStartIndex === this._currentIndex;\r\n }\r\n\r\n /**\r\n * Like extractAccumulatedSequence(), but returns undefined if nothing has been\r\n * accumulated yet.\r\n */\r\n public tryExtractAccumulatedSequence(): TokenSequence | undefined {\r\n if (this.isAccumulatedSequenceEmpty()) {\r\n return undefined;\r\n }\r\n return this.extractAccumulatedSequence();\r\n }\r\n\r\n /**\r\n * Asserts that isAccumulatedSequenceEmpty() should return false. If not, an exception\r\n * is throw indicating a parser bug.\r\n */\r\n public assertAccumulatedSequenceIsEmpty(): void {\r\n if (!this.isAccumulatedSequenceEmpty()) {\r\n // If this happens, it indicates a parser bug:\r\n const sequence: TokenSequence = new TokenSequence({\r\n parserContext: this._parserContext,\r\n startIndex: this._accumulatedStartIndex,\r\n endIndex: this._currentIndex\r\n });\r\n const tokenStrings: string[] = sequence.tokens.map((x) => x.toString());\r\n throw new Error(\r\n 'Parser assertion failed: The queue should be empty, but it contains:\\n' +\r\n JSON.stringify(tokenStrings)\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Returns the next token that would be returned by _readToken(), without\r\n * consuming anything.\r\n */\r\n public peekToken(): Token {\r\n return this.tokens[this._currentIndex];\r\n }\r\n\r\n /**\r\n * Returns the TokenKind for the next token that would be returned by _readToken(), without\r\n * consuming anything.\r\n */\r\n public peekTokenKind(): TokenKind {\r\n if (this._currentIndex >= this._readerEndIndex) {\r\n return TokenKind.EndOfInput;\r\n }\r\n return this.tokens[this._currentIndex].kind;\r\n }\r\n\r\n /**\r\n * Like peekTokenKind(), but looks ahead two tokens.\r\n */\r\n public peekTokenAfterKind(): TokenKind {\r\n if (this._currentIndex + 1 >= this._readerEndIndex) {\r\n return TokenKind.EndOfInput;\r\n }\r\n return this.tokens[this._currentIndex + 1].kind;\r\n }\r\n\r\n /**\r\n * Like peekTokenKind(), but looks ahead three tokens.\r\n */\r\n public peekTokenAfterAfterKind(): TokenKind {\r\n if (this._currentIndex + 2 >= this._readerEndIndex) {\r\n return TokenKind.EndOfInput;\r\n }\r\n return this.tokens[this._currentIndex + 2].kind;\r\n }\r\n\r\n /**\r\n * Extract the next token from the input stream and return it.\r\n * The token will also be appended to the accumulated sequence, which can\r\n * later be accessed via extractAccumulatedSequence().\r\n */\r\n public readToken(): Token {\r\n if (this._currentIndex >= this._readerEndIndex) {\r\n // If this happens, it's a parser bug\r\n throw new Error('Cannot read past end of stream');\r\n }\r\n const token: Token = this.tokens[this._currentIndex];\r\n if (token.kind === TokenKind.EndOfInput) {\r\n // We don't allow reading the EndOfInput token, because we want _peekToken()\r\n // to be always guaranteed to return a valid result.\r\n\r\n // If this happens, it's a parser bug\r\n throw new Error('The EndOfInput token cannot be read');\r\n }\r\n this._currentIndex++;\r\n return token;\r\n }\r\n\r\n /**\r\n * Returns the kind of the token immediately before the current token.\r\n */\r\n public peekPreviousTokenKind(): TokenKind {\r\n if (this._currentIndex === 0) {\r\n return TokenKind.EndOfInput;\r\n }\r\n return this.tokens[this._currentIndex - 1].kind;\r\n }\r\n\r\n /**\r\n * Remembers the current position in the stream.\r\n */\r\n public createMarker(): number {\r\n return this._currentIndex;\r\n }\r\n\r\n /**\r\n * Rewinds the stream pointer to a previous position in the stream.\r\n */\r\n public backtrackToMarker(marker: number): void {\r\n if (marker > this._currentIndex) {\r\n // If this happens, it's a parser bug\r\n throw new Error('The marker has expired');\r\n }\r\n\r\n this._currentIndex = marker;\r\n if (marker < this._accumulatedStartIndex) {\r\n this._accumulatedStartIndex = marker;\r\n }\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenSequence.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.TokenSequence = void 0;
6
+ const TextRange_1 = require("./TextRange");
7
+ /**
8
+ * Represents a sequence of tokens extracted from `ParserContext.tokens`.
9
+ * This sequence is defined by a starting index and ending index into that array.
10
+ */
11
+ class TokenSequence {
12
+ constructor(parameters) {
13
+ this.parserContext = parameters.parserContext;
14
+ this._startIndex = parameters.startIndex;
15
+ this._endIndex = parameters.endIndex;
16
+ this._validateBounds();
17
+ }
18
+ /**
19
+ * Constructs a TokenSequence object with no tokens.
20
+ */
21
+ static createEmpty(parserContext) {
22
+ return new TokenSequence({ parserContext, startIndex: 0, endIndex: 0 });
23
+ }
24
+ /**
25
+ * The starting index into the associated `ParserContext.tokens` list.
26
+ */
27
+ get startIndex() {
28
+ return this._startIndex;
29
+ }
30
+ /**
31
+ * The (non-inclusive) ending index into the associated `ParserContext.tokens` list.
32
+ */
33
+ get endIndex() {
34
+ return this._endIndex;
35
+ }
36
+ get tokens() {
37
+ return this.parserContext.tokens.slice(this._startIndex, this._endIndex);
38
+ }
39
+ /**
40
+ * Constructs a TokenSequence that corresponds to a different range of tokens,
41
+ * e.g. a subrange.
42
+ */
43
+ getNewSequence(startIndex, endIndex) {
44
+ return new TokenSequence({
45
+ parserContext: this.parserContext,
46
+ startIndex: startIndex,
47
+ endIndex: endIndex
48
+ });
49
+ }
50
+ /**
51
+ * Returns a TextRange that includes all tokens in the sequence (including any additional
52
+ * characters between doc comment lines).
53
+ */
54
+ getContainingTextRange() {
55
+ if (this.isEmpty()) {
56
+ return TextRange_1.TextRange.empty;
57
+ }
58
+ return this.parserContext.sourceRange.getNewRange(this.parserContext.tokens[this._startIndex].range.pos, this.parserContext.tokens[this._endIndex - 1].range.end);
59
+ }
60
+ isEmpty() {
61
+ return this._startIndex === this._endIndex;
62
+ }
63
+ /**
64
+ * Returns the concatenated text of all the tokens.
65
+ */
66
+ toString() {
67
+ return this.tokens.map((x) => x.toString()).join('');
68
+ }
69
+ _validateBounds() {
70
+ if (this.startIndex < 0) {
71
+ throw new Error('TokenSequence.startIndex cannot be negative');
72
+ }
73
+ if (this.endIndex < 0) {
74
+ throw new Error('TokenSequence.endIndex cannot be negative');
75
+ }
76
+ if (this.endIndex < this.startIndex) {
77
+ throw new Error('TokenSequence.endIndex cannot be smaller than TokenSequence.startIndex');
78
+ }
79
+ if (this.startIndex > this.parserContext.tokens.length) {
80
+ throw new Error('TokenSequence.startIndex cannot exceed the associated token array');
81
+ }
82
+ if (this.endIndex > this.parserContext.tokens.length) {
83
+ throw new Error('TokenSequence.endIndex cannot exceed the associated token array');
84
+ }
85
+ }
86
+ }
87
+ exports.TokenSequence = TokenSequence;
88
+ //# sourceMappingURL=TokenSequence.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenSequence.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"TokenSequence.js","sourceRoot":"","sources":["../../src/parser/TokenSequence.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D,2CAAwC;AAWxC;;;GAGG;AACH,MAAa,aAAa;IASxB,YAAmB,UAAoC;QACrD,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,WAAW,CAAC,aAA4B;QACpD,OAAO,IAAI,aAAa,CAAC,EA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AC;IACvD,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC5F,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACvF,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;CACF;AAhGD,sCAgGC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport type { ParserContext } from './ParserContext';\r\nimport type { Token } from './Token';\r\nimport { TextRange } from './TextRange';\r\n\r\n/**\r\n * Constructor parameters for {@link TokenSequence}\r\n */\r\nexport interface ITokenSequenceParameters {\r\n parserContext: ParserContext;\r\n startIndex: number;\r\n endIndex: number;\r\n}\r\n\r\n/**\r\n * Represents a sequence of tokens extracted from `ParserContext.tokens`.\r\n * This sequence is defined by a starting index and ending index into that array.\r\n */\r\nexport class TokenSequence {\r\n /**\r\n * The associated parser context that the tokens come from.\r\n */\r\n public readonly parserContext: ParserContext;\r\n\r\n private _startIndex: number;\r\n private _endIndex: number;\r\n\r\n public constructor(parameters: ITokenSequenceParameters) {\r\n this.parserContext = parameters.parserContext;\r\n this._startIndex = parameters.startIndex;\r\n this._endIndex = parameters.endIndex;\r\n this._validateBounds();\r\n }\r\n\r\n /**\r\n * Constructs a TokenSequence object with no tokens.\r\n */\r\n public static createEmpty(parserContext: ParserContext): TokenSequence {\r\n return new TokenSequence({ parserContext, startIndex: 0, endIndex: 0 });\r\n }\r\n\r\n /**\r\n * The starting index into the associated `ParserContext.tokens` list.\r\n */\r\n public get startIndex(): number {\r\n return this._startIndex;\r\n }\r\n\r\n /**\r\n * The (non-inclusive) ending index into the associated `ParserContext.tokens` list.\r\n */\r\n public get endIndex(): number {\r\n return this._endIndex;\r\n }\r\n\r\n public get tokens(): ReadonlyArray<Token> {\r\n return this.parserContext.tokens.slice(this._startIndex, this._endIndex);\r\n }\r\n\r\n /**\r\n * Constructs a TokenSequence that corresponds to a different range of tokens,\r\n * e.g. a subrange.\r\n */\r\n public getNewSequence(startIndex: number, endIndex: number): TokenSequence {\r\n return new TokenSequence({\r\n parserContext: this.parserContext,\r\n startIndex: startIndex,\r\n endIndex: endIndex\r\n });\r\n }\r\n\r\n /**\r\n * Returns a TextRange that includes all tokens in the sequence (including any additional\r\n * characters between doc comment lines).\r\n */\r\n public getContainingTextRange(): TextRange {\r\n if (this.isEmpty()) {\r\n return TextRange.empty;\r\n }\r\n\r\n return this.parserContext.sourceRange.getNewRange(\r\n this.parserContext.tokens[this._startIndex].range.pos,\r\n this.parserContext.tokens[this._endIndex - 1].range.end\r\n );\r\n }\r\n\r\n public isEmpty(): boolean {\r\n return this._startIndex === this._endIndex;\r\n }\r\n\r\n /**\r\n * Returns the concatenated text of all the tokens.\r\n */\r\n public toString(): string {\r\n return this.tokens.map((x) => x.toString()).join('');\r\n }\r\n\r\n private _validateBounds(): void {\r\n if (this.startIndex < 0) {\r\n throw new Error('TokenSequence.startIndex cannot be negative');\r\n }\r\n if (this.endIndex < 0) {\r\n throw new Error('TokenSequence.endIndex cannot be negative');\r\n }\r\n if (this.endIndex < this.startIndex) {\r\n throw new Error('TokenSequence.endIndex cannot be smaller than TokenSequence.startIndex');\r\n }\r\n if (this.startIndex > this.parserContext.tokens.length) {\r\n throw new Error('TokenSequence.startIndex cannot exceed the associated token array');\r\n }\r\n if (this.endIndex > this.parserContext.tokens.length) {\r\n throw new Error('TokenSequence.endIndex cannot exceed the associated token array');\r\n }\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/parser/Tokenizer.js ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Tokenizer = void 0;
6
+ const TextRange_1 = require("./TextRange");
7
+ const Token_1 = require("./Token");
8
+ class Tokenizer {
9
+ /**
10
+ * Given a list of input lines, this returns an array of extracted tokens.
11
+ * The last token will always be TokenKind.EndOfInput.
12
+ */
13
+ static readTokens(lines) {
14
+ Tokenizer._ensureInitialized();
15
+ const tokens = [];
16
+ let lastLine = undefined;
17
+ for (const line of lines) {
18
+ Tokenizer._pushTokensForLine(tokens, line);
19
+ lastLine = line;
20
+ }
21
+ if (lastLine) {
22
+ tokens.push(new Token_1.Token(Token_1.TokenKind.EndOfInput, lastLine.getNewRange(lastLine.end, lastLine.end), lastLine));
23
+ }
24
+ else {
25
+ tokens.push(new Token_1.Token(Token_1.TokenKind.EndOfInput, TextRange_1.TextRange.empty, TextRange_1.TextRange.empty));
26
+ }
27
+ return tokens;
28
+ }
29
+ /**
30
+ * Returns true if the token is a CommonMark punctuation character.
31
+ * These are basically all the ASCII punctuation characters.
32
+ */
33
+ static isPunctuation(tokenKind) {
34
+ Tokenizer._ensureInitialized();
35
+ return Tokenizer._punctuationTokens[tokenKind] || false;
36
+ }
37
+ static _pushTokensForLine(tokens, line) {
38
+ const buffer = line.buffer;
39
+ const end = line.end;
40
+ let bufferIndex = line.pos;
41
+ let tokenKind = undefined;
42
+ let tokenPos = bufferIndex;
43
+ while (bufferIndex < end) {
44
+ // Read a character and determine its kind
45
+ const charCode = buffer.charCodeAt(bufferIndex);
46
+ let characterKind = Tokenizer._charCodeMap[charCode];
47
+ if (characterKind === undefined) {
48
+ characterKind = Token_1.TokenKind.Other;
49
+ }
50
+ // Can we append to an existing token? Yes if:
51
+ // 1. There is an existing token, AND
52
+ // 2. It is the same kind of token, AND
53
+ // 3. It's not punctuation (which is always one character)
54
+ if (tokenKind !== undefined &&
55
+ characterKind === tokenKind &&
56
+ Tokenizer._isMultiCharacterToken(tokenKind)) {
57
+ // yes, append
58
+ }
59
+ else {
60
+ // Is there a previous completed token to push?
61
+ if (tokenKind !== undefined) {
62
+ tokens.push(new Token_1.Token(tokenKind, line.getNewRange(tokenPos, bufferIndex), line));
63
+ }
64
+ tokenPos = bufferIndex;
65
+ tokenKind = characterKind;
66
+ }
67
+ ++bufferIndex;
68
+ }
69
+ // Is there a previous completed token to push?
70
+ if (tokenKind !== undefined) {
71
+ tokens.push(new Token_1.Token(tokenKind, line.getNewRange(tokenPos, bufferIndex), line));
72
+ }
73
+ tokens.push(new Token_1.Token(Token_1.TokenKind.Newline, line.getNewRange(line.end, line.end), line));
74
+ }
75
+ /**
76
+ * Returns true if the token can be comprised of multiple characters
77
+ */
78
+ static _isMultiCharacterToken(kind) {
79
+ switch (kind) {
80
+ case Token_1.TokenKind.Spacing:
81
+ case Token_1.TokenKind.AsciiWord:
82
+ case Token_1.TokenKind.Other:
83
+ return true;
84
+ }
85
+ return false;
86
+ }
87
+ static _ensureInitialized() {
88
+ if (Tokenizer._charCodeMap) {
89
+ return;
90
+ }
91
+ Tokenizer._charCodeMap = {};
92
+ Tokenizer._punctuationTokens = {};
93
+ // All Markdown punctuation characters
94
+ const punctuation = Tokenizer._commonMarkPunctuationCharacters;
95
+ for (let i = 0; i < punctuation.length; ++i) {
96
+ const charCode = punctuation.charCodeAt(i);
97
+ Tokenizer._charCodeMap[charCode] = Token_1.TokenKind.OtherPunctuation;
98
+ }
99
+ // Special symbols
100
+ // !"#$%&\'()*+,\-.\/:;<=>?@[\\]^_`{|}~
101
+ const specialMap = {
102
+ '\\': Token_1.TokenKind.Backslash,
103
+ '<': Token_1.TokenKind.LessThan,
104
+ '>': Token_1.TokenKind.GreaterThan,
105
+ '=': Token_1.TokenKind.Equals,
106
+ "'": Token_1.TokenKind.SingleQuote,
107
+ '"': Token_1.TokenKind.DoubleQuote,
108
+ '/': Token_1.TokenKind.Slash,
109
+ '-': Token_1.TokenKind.Hyphen,
110
+ '@': Token_1.TokenKind.AtSign,
111
+ '{': Token_1.TokenKind.LeftCurlyBracket,
112
+ '}': Token_1.TokenKind.RightCurlyBracket,
113
+ '`': Token_1.TokenKind.Backtick,
114
+ '.': Token_1.TokenKind.Period,
115
+ ':': Token_1.TokenKind.Colon,
116
+ ',': Token_1.TokenKind.Comma,
117
+ '[': Token_1.TokenKind.LeftSquareBracket,
118
+ ']': Token_1.TokenKind.RightSquareBracket,
119
+ '|': Token_1.TokenKind.Pipe,
120
+ '(': Token_1.TokenKind.LeftParenthesis,
121
+ ')': Token_1.TokenKind.RightParenthesis,
122
+ '#': Token_1.TokenKind.PoundSymbol,
123
+ '+': Token_1.TokenKind.Plus,
124
+ $: Token_1.TokenKind.DollarSign
125
+ };
126
+ for (const key of Object.getOwnPropertyNames(specialMap)) {
127
+ Tokenizer._charCodeMap[key.charCodeAt(0)] = specialMap[key];
128
+ Tokenizer._punctuationTokens[specialMap[key]] = true;
129
+ }
130
+ Tokenizer._punctuationTokens[Token_1.TokenKind.OtherPunctuation] = true;
131
+ const word = Tokenizer._wordCharacters;
132
+ for (let i = 0; i < word.length; ++i) {
133
+ const charCode = word.charCodeAt(i);
134
+ Tokenizer._charCodeMap[charCode] = Token_1.TokenKind.AsciiWord;
135
+ }
136
+ Tokenizer._charCodeMap[' '.charCodeAt(0)] = Token_1.TokenKind.Spacing;
137
+ Tokenizer._charCodeMap['\t'.charCodeAt(0)] = Token_1.TokenKind.Spacing;
138
+ }
139
+ }
140
+ exports.Tokenizer = Tokenizer;
141
+ Tokenizer._commonMarkPunctuationCharacters = '!"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~';
142
+ Tokenizer._wordCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_';
143
+ //# sourceMappingURL=Tokenizer.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/parser/Tokenizer.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"Tokenizer.js","sourceRoot":"","sources":["../../src/parser/Tokenizer.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,2CAAwC;AACxC,mCAA2C;AAE3C,MAAa,SAAS;IAQpB;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,KAAkB;QACzC,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAE/B,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,IAAI,QAAQ,GAA0B,SAAS,CAAC;QAEhD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC3C,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;QAED,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CACT,IAAI,aAAK,CAAC,iBAAS,CAAC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CAAC;QACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;YACzD,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;YAC5D,SAAS,CAAC,kBAAkB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;QACvD,CAAC;QAED,SAAS,CAAC,kBAAkB,CAAC,iBAAS,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;QAEhE,MAAM,IAAI,GAAW,SAAS,CAAC,eAAe,CAAC;QAC/C,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YAC7C,MAAM,QAAQ,GAAW,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC5C,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,iBAAS,CAAC,SAAS,CAAC;QACzD,CAAC;QACD,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAS,CAAC,OAAO,CAAC;QAC9D,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,iBAAS,CAAC,OAAO,CAAC;IACjE,CAAC;;AAjKH,8BAkKC;AAjKyB,0CAAgC,GAAW,mCAAmC,CAAC;AAC/E,yBAAe,GACrC,iEAAiE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { TextRange } from './TextRange';\r\nimport { Token, TokenKind } from './Token';\r\n\r\nexport class Tokenizer {\r\n private static readonly _commonMarkPunctuationCharacters: string = '!\"#$%&\\'()*+,-./:;<=>?@[\\\\]^`{|}~';\r\n private static readonly _wordCharacters: string =\r\n 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_';\r\n\r\n private static _charCodeMap: { [charCode: number]: TokenKind | undefined };\r\n private static _punctuationTokens: { [tokenKind: number]: boolean };\r\n\r\n /**\r\n * Given a list of input lines, this returns an array of extracted tokens.\r\n * The last token will always be TokenKind.EndOfInput.\r\n */\r\n public static readTokens(lines: TextRange[]): Token[] {\r\n Tokenizer._ensureInitialized();\r\n\r\n const tokens: Token[] = [];\r\n\r\n let lastLine: TextRange | undefined = undefined;\r\n\r\n for (const line of lines) {\r\n Tokenizer._pushTokensForLine(tokens, line);\r\n lastLine = line;\r\n }\r\n\r\n if (lastLine) {\r\n tokens.push(\r\n new Token(TokenKind.EndOfInput, lastLine.getNewRange(lastLine.end, lastLine.end), lastLine)\r\n );\r\n } else {\r\n tokens.push(new Token(TokenKind.EndOfInput, TextRange.empty, TextRange.empty));\r\n }\r\n\r\n return tokens;\r\n }\r\n\r\n /**\r\n * Returns true if the token is a CommonMark punctuation character.\r\n * These are basically all the ASCII punctuation characters.\r\n */\r\n public static isPunctuation(tokenKind: TokenKind): boolean {\r\n Tokenizer._ensureInitialized();\r\n return Tokenizer._punctuationTokens[tokenKind] || false;\r\n }\r\n\r\n private static _pushTokensForLine(tokens: Token[], line: TextRange): void {\r\n const buffer: string = line.buffer;\r\n const end: number = line.end;\r\n\r\n let bufferIndex: number = line.pos;\r\n let tokenKind: TokenKind | undefined = undefined;\r\n let tokenPos: number = bufferIndex;\r\n\r\n while (bufferIndex < end) {\r\n // Read a character and determine its kind\r\n const charCode: number = buffer.charCodeAt(bufferIndex);\r\n let characterKind: TokenKind | undefined = Tokenizer._charCodeMap[charCode];\r\n if (characterKind === undefined) {\r\n characterKind = TokenKind.Other;\r\n }\r\n\r\n // Can we append to an existing token? Yes if:\r\n // 1. There is an existing token, AND\r\n // 2. It is the same kind of token, AND\r\n // 3. It's not punctuation (which is always one character)\r\n if (\r\n tokenKind !== undefined &&\r\n characterKind === tokenKind &&\r\n Tokenizer._isMultiCharacterToken(tokenKind)\r\n ) {\r\n // yes, append\r\n } else {\r\n // Is there a previous completed token to push?\r\n if (tokenKind !== undefined) {\r\n tokens.push(new Token(tokenKind, line.getNewRange(tokenPos, bufferIndex), line));\r\n }\r\n\r\n tokenPos = bufferIndex;\r\n tokenKind = characterKind;\r\n }\r\n\r\n ++bufferIndex;\r\n }\r\n\r\n // Is there a previous completed token to push?\r\n if (tokenKind !== undefined) {\r\n tokens.push(new Token(tokenKind, line.getNewRange(tokenPos, bufferIndex), line));\r\n }\r\n\r\n tokens.push(new Token(TokenKind.Newline, line.getNewRange(line.end, line.end), line));\r\n }\r\n\r\n /**\r\n * Returns true if the token can be comprised of multiple characters\r\n */\r\n private static _isMultiCharacterToken(kind: TokenKind): boolean {\r\n switch (kind) {\r\n case TokenKind.Spacing:\r\n case TokenKind.AsciiWord:\r\n case TokenKind.Other:\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private static _ensureInitialized(): void {\r\n if (Tokenizer._charCodeMap) {\r\n return;\r\n }\r\n\r\n Tokenizer._charCodeMap = {};\r\n Tokenizer._punctuationTokens = {};\r\n\r\n // All Markdown punctuation characters\r\n const punctuation: string = Tokenizer._commonMarkPunctuationCharacters;\r\n for (let i: number = 0; i < punctuation.length; ++i) {\r\n const charCode: number = punctuation.charCodeAt(i);\r\n Tokenizer._charCodeMap[charCode] = TokenKind.OtherPunctuation;\r\n }\r\n\r\n // Special symbols\r\n\r\n // !\"#$%&\\'()*+,\\-.\\/:;<=>?@[\\\\]^_`{|}~\r\n const specialMap: { [character: string]: TokenKind } = {\r\n '\\\\': TokenKind.Backslash,\r\n '<': TokenKind.LessThan,\r\n '>': TokenKind.GreaterThan,\r\n '=': TokenKind.Equals,\r\n \"'\": TokenKind.SingleQuote,\r\n '\"': TokenKind.DoubleQuote,\r\n '/': TokenKind.Slash,\r\n '-': TokenKind.Hyphen,\r\n '@': TokenKind.AtSign,\r\n '{': TokenKind.LeftCurlyBracket,\r\n '}': TokenKind.RightCurlyBracket,\r\n '`': TokenKind.Backtick,\r\n '.': TokenKind.Period,\r\n ':': TokenKind.Colon,\r\n ',': TokenKind.Comma,\r\n '[': TokenKind.LeftSquareBracket,\r\n ']': TokenKind.RightSquareBracket,\r\n '|': TokenKind.Pipe,\r\n '(': TokenKind.LeftParenthesis,\r\n ')': TokenKind.RightParenthesis,\r\n '#': TokenKind.PoundSymbol,\r\n '+': TokenKind.Plus,\r\n $: TokenKind.DollarSign\r\n };\r\n for (const key of Object.getOwnPropertyNames(specialMap)) {\r\n Tokenizer._charCodeMap[key.charCodeAt(0)] = specialMap[key];\r\n Tokenizer._punctuationTokens[specialMap[key]] = true;\r\n }\r\n\r\n Tokenizer._punctuationTokens[TokenKind.OtherPunctuation] = true;\r\n\r\n const word: string = Tokenizer._wordCharacters;\r\n for (let i: number = 0; i < word.length; ++i) {\r\n const charCode: number = word.charCodeAt(i);\r\n Tokenizer._charCodeMap[charCode] = TokenKind.AsciiWord;\r\n }\r\n Tokenizer._charCodeMap[' '.charCodeAt(0)] = TokenKind.Spacing;\r\n Tokenizer._charCodeMap['\\t'.charCodeAt(0)] = TokenKind.Spacing;\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/transforms/DocNodeTransforms.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DocNodeTransforms = void 0;
6
+ const TrimSpacesTransform_1 = require("./TrimSpacesTransform");
7
+ /**
8
+ * Helper functions that transform DocNode trees.
9
+ */
10
+ class DocNodeTransforms {
11
+ /**
12
+ * trimSpacesInParagraphNodes() collapses extra spacing characters from plain text nodes.
13
+ *
14
+ * @remarks
15
+ * This is useful when emitting HTML, where any number of spaces are equivalent
16
+ * to a single space. It's also useful when emitting Markdown, where spaces
17
+ * can be misinterpreted as an indented code block.
18
+ *
19
+ * For example, we might transform this:
20
+ *
21
+ * ```
22
+ * nodes: [
23
+ * { kind: PlainText, text: " Here are some " },
24
+ * { kind: SoftBreak }
25
+ * { kind: PlainText, text: " words" },
26
+ * { kind: SoftBreak }
27
+ * { kind: InlineTag, text: "{\@inheritDoc}" },
28
+ * { kind: PlainText, text: "to process." },
29
+ * { kind: PlainText, text: " " },
30
+ * { kind: PlainText, text: " " }
31
+ * ]
32
+ * ```
33
+ *
34
+ * ...to this:
35
+ *
36
+ * ```
37
+ * nodes: [
38
+ * { kind: PlainText, text: "Here are some " },
39
+ * { kind: PlainText, text: "words " },
40
+ * { kind: InlineTag, text: "{\@inheritDoc}" },
41
+ * { kind: PlainText, text: "to process." }
42
+ * ]
43
+ * ```
44
+ *
45
+ * Note that in this example, `"words "` is not merged with the preceding node because
46
+ * its DocPlainText.excerpt cannot span multiple lines.
47
+ *
48
+ * @param docParagraph - a DocParagraph containing nodes to be transformed
49
+ * @returns The transformed child nodes.
50
+ */
51
+ static trimSpacesInParagraph(docParagraph) {
52
+ return TrimSpacesTransform_1.TrimSpacesTransform.transform(docParagraph);
53
+ }
54
+ }
55
+ exports.DocNodeTransforms = DocNodeTransforms;
56
+ //# sourceMappingURL=DocNodeTransforms.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/transforms/DocNodeTransforms.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"DocNodeTransforms.js","sourceRoot":"","sources":["../../src/transforms/DocNodeTransforms.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,+DAA4D;AAG5D;;GAEG;AACH,MAAa,iBAAiB;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACI,MAAM,CAAC,qBAAqB,CAAC,YAA0B;QAC5D,OAAO,yCAAmB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;CACF;AA5CD,8CA4CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { TrimSpacesTransform } from './TrimSpacesTransform';\r\nimport type { DocParagraph } from '../nodes';\r\n\r\n/**\r\n * Helper functions that transform DocNode trees.\r\n */\r\nexport class DocNodeTransforms {\r\n /**\r\n * trimSpacesInParagraphNodes() collapses extra spacing characters from plain text nodes.\r\n *\r\n * @remarks\r\n * This is useful when emitting HTML, where any number of spaces are equivalent\r\n * to a single space. It's also useful when emitting Markdown, where spaces\r\n * can be misinterpreted as an indented code block.\r\n *\r\n * For example, we might transform this:\r\n *\r\n * ```\r\n * nodes: [\r\n * { kind: PlainText, text: \" Here are some \" },\r\n * { kind: SoftBreak }\r\n * { kind: PlainText, text: \" words\" },\r\n * { kind: SoftBreak }\r\n * { kind: InlineTag, text: \"{\\@inheritDoc}\" },\r\n * { kind: PlainText, text: \"to process.\" },\r\n * { kind: PlainText, text: \" \" },\r\n * { kind: PlainText, text: \" \" }\r\n * ]\r\n * ```\r\n *\r\n * ...to this:\r\n *\r\n * ```\r\n * nodes: [\r\n * { kind: PlainText, text: \"Here are some \" },\r\n * { kind: PlainText, text: \"words \" },\r\n * { kind: InlineTag, text: \"{\\@inheritDoc}\" },\r\n * { kind: PlainText, text: \"to process.\" }\r\n * ]\r\n * ```\r\n *\r\n * Note that in this example, `\"words \"` is not merged with the preceding node because\r\n * its DocPlainText.excerpt cannot span multiple lines.\r\n *\r\n * @param docParagraph - a DocParagraph containing nodes to be transformed\r\n * @returns The transformed child nodes.\r\n */\r\n public static trimSpacesInParagraph(docParagraph: DocParagraph): DocParagraph {\r\n return TrimSpacesTransform.transform(docParagraph);\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/lib-commonjs/transforms/TrimSpacesTransform.js ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
+ // See LICENSE in the project root for license information.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.TrimSpacesTransform = void 0;
6
+ const nodes_1 = require("../nodes");
7
+ /**
8
+ * Implementation of DocNodeTransforms.trimSpacesInParagraphNodes()
9
+ */
10
+ class TrimSpacesTransform {
11
+ static transform(docParagraph) {
12
+ const transformedNodes = [];
13
+ // Whether the next nonempty node to be added needs a space before it
14
+ let pendingSpace = false;
15
+ // The DocPlainText node that we're currently accumulating
16
+ const accumulatedTextChunks = [];
17
+ const accumulatedNodes = [];
18
+ // We always trim leading whitespace for a paragraph. This flag gets set to true
19
+ // as soon as nonempty content is encountered.
20
+ let finishedSkippingLeadingSpaces = false;
21
+ for (const node of docParagraph.nodes) {
22
+ switch (node.kind) {
23
+ case nodes_1.DocNodeKind.PlainText:
24
+ const docPlainText = node;
25
+ const text = docPlainText.text;
26
+ const startedWithSpace = /^\s/.test(text);
27
+ const endedWithSpace = /\s$/.test(text);
28
+ const collapsedText = text.replace(/\s+/g, ' ').trim();
29
+ if (startedWithSpace && finishedSkippingLeadingSpaces) {
30
+ pendingSpace = true;
31
+ }
32
+ if (collapsedText.length > 0) {
33
+ if (pendingSpace) {
34
+ accumulatedTextChunks.push(' ');
35
+ pendingSpace = false;
36
+ }
37
+ accumulatedTextChunks.push(collapsedText);
38
+ accumulatedNodes.push(node);
39
+ finishedSkippingLeadingSpaces = true;
40
+ }
41
+ if (endedWithSpace && finishedSkippingLeadingSpaces) {
42
+ pendingSpace = true;
43
+ }
44
+ break;
45
+ case nodes_1.DocNodeKind.SoftBreak:
46
+ if (finishedSkippingLeadingSpaces) {
47
+ pendingSpace = true;
48
+ }
49
+ accumulatedNodes.push(node);
50
+ break;
51
+ default:
52
+ if (pendingSpace) {
53
+ accumulatedTextChunks.push(' ');
54
+ pendingSpace = false;
55
+ }
56
+ // Push the accumulated text
57
+ if (accumulatedTextChunks.length > 0) {
58
+ // TODO: We should probably track the accumulatedNodes somehow, e.g. so we can map them back to the
59
+ // original excerpts. But we need a developer scenario before we can design this API.
60
+ transformedNodes.push(new nodes_1.DocPlainText({
61
+ configuration: docParagraph.configuration,
62
+ text: accumulatedTextChunks.join('')
63
+ }));
64
+ accumulatedTextChunks.length = 0;
65
+ accumulatedNodes.length = 0;
66
+ }
67
+ transformedNodes.push(node);
68
+ finishedSkippingLeadingSpaces = true;
69
+ }
70
+ }
71
+ // Push the accumulated text
72
+ if (accumulatedTextChunks.length > 0) {
73
+ transformedNodes.push(new nodes_1.DocPlainText({
74
+ configuration: docParagraph.configuration,
75
+ text: accumulatedTextChunks.join('')
76
+ }));
77
+ accumulatedTextChunks.length = 0;
78
+ accumulatedNodes.length = 0;
79
+ }
80
+ const transformedParagraph = new nodes_1.DocParagraph({
81
+ configuration: docParagraph.configuration
82
+ });
83
+ transformedParagraph.appendNodes(transformedNodes);
84
+ return transformedParagraph;
85
+ }
86
+ }
87
+ exports.TrimSpacesTransform = TrimSpacesTransform;
88
+ //# sourceMappingURL=TrimSpacesTransform.js.map
node_modules/@microsoft/tsdoc/lib-commonjs/transforms/TrimSpacesTransform.js.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"TrimSpacesTransform.js","sourceRoot":"","sources":["../../src/transforms/TrimSpacesTransform.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,oCAAiF;AAEjF;;GAEG;AACH,MAAa,mBAAmB;IACvB,MAAM,CAAC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E,YAAY,CAAC,aAAa;SAC1C,CAAC,CAAC;QACH,oBAAoB,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACnD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;CACF;AA/FD,kDA+FC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { DocParagraph, type DocNode, DocNodeKind, DocPlainText } from '../nodes';\r\n\r\n/**\r\n * Implementation of DocNodeTransforms.trimSpacesInParagraphNodes()\r\n */\r\nexport class TrimSpacesTransform {\r\n public static transform(docParagraph: DocParagraph): DocParagraph {\r\n const transformedNodes: DocNode[] = [];\r\n\r\n // Whether the next nonempty node to be added needs a space before it\r\n let pendingSpace: boolean = false;\r\n\r\n // The DocPlainText node that we're currently accumulating\r\n const accumulatedTextChunks: string[] = [];\r\n const accumulatedNodes: DocNode[] = [];\r\n\r\n // We always trim leading whitespace for a paragraph. This flag gets set to true\r\n // as soon as nonempty content is encountered.\r\n let finishedSkippingLeadingSpaces: boolean = false;\r\n\r\n for (const node of docParagraph.nodes) {\r\n switch (node.kind) {\r\n case DocNodeKind.PlainText:\r\n const docPlainText: DocPlainText = node as DocPlainText;\r\n\r\n const text: string = docPlainText.text;\r\n\r\n const startedWithSpace: boolean = /^\\s/.test(text);\r\n const endedWithSpace: boolean = /\\s$/.test(text);\r\n const collapsedText: string = text.replace(/\\s+/g, ' ').trim();\r\n\r\n if (startedWithSpace && finishedSkippingLeadingSpaces) {\r\n pendingSpace = true;\r\n }\r\n\r\n if (collapsedText.length > 0) {\r\n if (pendingSpace) {\r\n accumulatedTextChunks.push(' ');\r\n pendingSpace = false;\r\n }\r\n\r\n accumulatedTextChunks.push(collapsedText);\r\n accumulatedNodes.push(node);\r\n\r\n finishedSkippingLeadingSpaces = true;\r\n }\r\n\r\n if (endedWithSpace && finishedSkippingLeadingSpaces) {\r\n pendingSpace = true;\r\n }\r\n break;\r\n case DocNodeKind.SoftBreak:\r\n if (finishedSkippingLeadingSpaces) {\r\n pendingSpace = true;\r\n }\r\n accumulatedNodes.push(node);\r\n break;\r\n default:\r\n if (pendingSpace) {\r\n accumulatedTextChunks.push(' ');\r\n pendingSpace = false;\r\n }\r\n\r\n // Push the accumulated text\r\n if (accumulatedTextChunks.length > 0) {\r\n // TODO: We should probably track the accumulatedNodes somehow, e.g. so we can map them back to the\r\n // original excerpts. But we need a developer scenario before we can design this API.\r\n transformedNodes.push(\r\n new DocPlainText({\r\n configuration: docParagraph.configuration,\r\n text: accumulatedTextChunks.join('')\r\n })\r\n );\r\n accumulatedTextChunks.length = 0;\r\n accumulatedNodes.length = 0;\r\n }\r\n\r\n transformedNodes.push(node);\r\n finishedSkippingLeadingSpaces = true;\r\n }\r\n }\r\n\r\n // Push the accumulated text\r\n if (accumulatedTextChunks.length > 0) {\r\n transformedNodes.push(\r\n new DocPlainText({\r\n configuration: docParagraph.configuration,\r\n text: accumulatedTextChunks.join('')\r\n })\r\n );\r\n accumulatedTextChunks.length = 0;\r\n accumulatedNodes.length = 0;\r\n }\r\n\r\n const transformedParagraph: DocParagraph = new DocParagraph({\r\n configuration: docParagraph.configuration\r\n });\r\n transformedParagraph.appendNodes(transformedNodes);\r\n return transformedParagraph;\r\n }\r\n}\r\n"]}
node_modules/@microsoft/tsdoc/package.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@microsoft/tsdoc",
3
+ "version": "0.16.0",
4
+ "description": "A parser for the TypeScript doc comment syntax",
5
+ "keywords": [
6
+ "TypeScript",
7
+ "documentation",
8
+ "doc",
9
+ "comments",
10
+ "JSDoc",
11
+ "parser",
12
+ "standard"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/microsoft/tsdoc",
17
+ "directory": "tsdoc"
18
+ },
19
+ "homepage": "https://tsdoc.org/",
20
+ "main": "lib-commonjs/index.js",
21
+ "module": "lib/index.js",
22
+ "typings": "lib/index.d.ts",
23
+ "license": "MIT",
24
+ "devDependencies": {
25
+ "@rushstack/heft": "1.1.1",
26
+ "eslint": "~9.25.1",
27
+ "tsdoc-build-rig": "1.0.0"
28
+ },
29
+ "scripts": {
30
+ "build": "heft test --clean",
31
+ "watch": "heft test --clean --watch",
32
+ "_phase:build": "heft run --only build -- --clean",
33
+ "_phase:test": "heft run --only test -- --clean"
34
+ }
35
+ }
node_modules/@microsoft/tsdoc/schemas/tsdoc.schema.json ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "TSDoc Configuration",
3
+ "description": "Describes the TSDoc configuration for a TypeScript project",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.",
8
+ "type": "string"
9
+ },
10
+
11
+ "extends": {
12
+ "description": "Optionally specifies one or more JSON config files that will be combined with this file. This provides a way for standard settings to be shared across multiple projects. Important: The \"extends\" paths are resolved using NodeJS module resolution, so a path to a local file MUST be prefixed with \"./\".",
13
+ "type": "array",
14
+ "items": {
15
+ "type": "string"
16
+ }
17
+ },
18
+
19
+ "noStandardTags": {
20
+ "description": "By default, the config file loader will predefine all of the standardized TSDoc tags. To disable this and start with a completely empty configuration, set \"noStandardTags\"=true.",
21
+ "type": "boolean"
22
+ },
23
+
24
+ "tagDefinitions": {
25
+ "description": "Additional tags to support when parsing documentation comments with TSDoc.",
26
+ "type": "array",
27
+ "items": {
28
+ "$ref": "#/definitions/tsdocTagDefinition"
29
+ }
30
+ },
31
+
32
+ "supportedHtmlElements": {
33
+ "description": "The HTML element names that are supported in this configuration. Used in conjunction with the \"reportUnsupportedHtmlElements\" setting.",
34
+ "type": "array",
35
+ "items": {
36
+ "type": "string",
37
+ "pattern": "^[a-zA-Z0-9-]+$"
38
+ }
39
+ },
40
+
41
+ "reportUnsupportedHtmlElements": {
42
+ "description": "Whether an error should be reported when an unsupported HTML element is encountered in a doc comment. Defaults to \"true\" if the \"supportedHtmlElements\" field is present in this file, \"false\" if not.",
43
+ "type": "boolean"
44
+ },
45
+
46
+ "supportForTags": {
47
+ "description": "A collection of key/value pairs. The key is a TSDoc tag name (e.g. \"@myTag\") that must be defined in this configuration. The value is a boolean indicating whether the tag is supported. The TSDoc parser may report warnings when unsupported tags are encountered. If \"supportForTags\" is specified for at least one tag, then the \"reportUnsupportedTags\" validation check is enabled by default.",
48
+ "type": "object",
49
+ "patternProperties": {
50
+ "@[a-zA-Z][a-zA-Z0-9]*$": {
51
+ "type": "boolean"
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "required": ["$schema"],
57
+ "additionalProperties": false,
58
+
59
+ "definitions": {
60
+ "tsdocTagDefinition": {
61
+ "description": "Configuration for a custom supported TSDoc tag.",
62
+ "type": "object",
63
+ "properties": {
64
+ "tagName": {
65
+ "description": "Name of the custom tag. TSDoc tag names start with an at-sign (@) followed by ASCII letters using camelCase capitalization.",
66
+ "type": "string"
67
+ },
68
+ "syntaxKind": {
69
+ "description": "Syntax kind of the custom tag. \"inline\" means that this tag can appear inside other documentation sections (example: {@link}). \"block\" means that this tag starts a new documentation section (example: @remarks). \"modifier\" means that this tag's presence indicates an aspect of the associated API item (example: @internal).",
70
+ "type": "string",
71
+ "enum": ["inline", "block", "modifier"]
72
+ },
73
+ "allowMultiple": {
74
+ "description": "If true, then this tag may appear multiple times in a doc comment. By default, a tag may only appear once.",
75
+ "type": "boolean"
76
+ }
77
+ },
78
+ "required": ["tagName", "syntaxKind"],
79
+ "additionalProperties": false
80
+ }
81
+ }
82
+ }