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AAuB,GAAjC;QACE,WAAW;QACX,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACnC,CAAC;IACH,mBAAC;AAAD,CAAC,AAnDD,CAAkC,gBAAgB,GAmDjD","sourcesContent":["import { DocNodeKind, DocNode } from './DocNode';\r\nimport { TokenSequence } from '../parser/TokenSequence';\r\nimport { DocExcerpt, ExcerptKind } from './DocExcerpt';\r\nimport {\r\n IDocInlineTagBaseParameters,\r\n IDocInlineTagBaseParsedParameters,\r\n DocInlineTagBase\r\n} from './DocInlineTagBase';\r\n\r\n/**\r\n * Constructor parameters for {@link DocInlineTag}.\r\n */\r\nexport interface IDocInlineTagParameters extends IDocInlineTagBaseParameters {\r\n tagContent: string;\r\n}\r\n\r\n/**\r\n * Constructor parameters for {@link DocInlineTag}.\r\n */\r\nexport interface IDocInlineTagParsedParameters extends IDocInlineTagBaseParsedParameters {\r\n tagContentExcerpt?: TokenSequence;\r\n}\r\n\r\n/**\r\n * Represents a generic TSDoc inline tag, including custom tags.\r\n *\r\n * @remarks\r\n * NOTE: Certain tags such as `{@link}` and `{@inheritDoc}` have specialized structures and parser rules,\r\n * and thus are represented using {@link DocLinkTag} or {@link DocInheritDocTag} instead. However, if the\r\n * specialized parser rule encounters a syntax error, but the outer framing is correct, then the parser constructs\r\n * a generic `DocInlineTag` instead of `DocErrorText`. This means, for example, that it is possible sometimes for\r\n * `DocInlineTag.tagName` to be `\"@link\"`.\r\n */\r\nexport class DocInlineTag extends DocInlineTagBase {\r\n private _tagContent: string | undefined;\r\n private readonly _tagContentExcerpt: DocExcerpt | undefined;\r\n\r\n /**\r\n * Don't call this directly. Instead use {@link TSDocParser}\r\n * @internal\r\n */\r\n public constructor(parameters: IDocInlineTagParameters | IDocInlineTagParsedParameters) {\r\n super(parameters);\r\n\r\n if (DocNode.isParsedParameters(parameters)) {\r\n if (parameters.tagContentExcerpt) {\r\n this._tagContentExcerpt = new DocExcerpt({\r\n configuration: this.configuration,\r\n excerptKind: ExcerptKind.InlineTag_TagContent,\r\n content: parameters.tagContentExcerpt\r\n });\r\n }\r\n } else {\r\n this._tagContent = parameters.tagContent;\r\n }\r\n }\r\n\r\n /** @override */\r\n public get kind(): DocNodeKind | string {\r\n return DocNodeKind.InlineTag;\r\n }\r\n\r\n /**\r\n * The tag content.\r\n * @remarks\r\n * For example, if the tag is `{@myTag x=12.34 y=56.78 }` then the tag content\r\n * would be `x=12.34 y=56.78 `, including the trailing space but not the leading space.\r\n */\r\n public get tagContent(): string {\r\n if (this._tagContent === undefined) {\r\n if (this._tagContentExcerpt) {\r\n this._tagContent = this._tagContentExcerpt.content.toString();\r\n } else {\r\n return '';\r\n }\r\n }\r\n return this._tagContent;\r\n }\r\n\r\n /** @override */\r\n protected getChildNodesForContent(): ReadonlyArray<DocNode | undefined> {\r\n // abstract\r\n return [this._tagContentExcerpt];\r\n }\r\n}\r\n"]}
\No newline at end of file