PageSourceSearch

https://tsdoc.org/assets/js/0bac5db1.e7b4b800.js

js tsdoc.org collected 2026-10-02 03:51:53 UTC 7,661 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunktsdoc_org=self.webpackChunktsdoc_org||[]).push([[2217],{5552(e,t,n){n.d(t,{xA:()=>g,yg:()=>m});var a=n(829);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=a.createContext({}),p=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},g=function(e){var t=p(e.components);return a.createElement(l.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef(function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,g=s(e,["components","mdxType","originalType","parentName"]),d=p(n),m=r,u=d["".concat(l,".").concat(m)]||d[m]||c[m]||i;return n?a.createElement(u,o(o({ref:t},g),{},{components:n})):a.createElement(u,o({ref:t},g))});function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=d;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:r,o[1]=s;for(var p=2;p<i;p++)o[p]=n[p];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},2397(e,t,n){n.r(t),n.d(t,{assets:()=>g,contentTitle:()=>l,default:()=>m,frontMatter:()=>s,metadata:()=>p,toc:()=>c});var a=n(6443),r=n(8338),i=(n(829),n(5552)),o=["components"],s={title:"Tag kinds"},l=void 0,p={unversionedId:"pages/spec/tag_kinds",id:"pages/spec/tag_kinds",title:"Tag kinds",description:"TSDoc distinguishes three kinds of tags: Block tags, modifier tags, and inline tags.",source:"@site/docs/pages/spec/tag_kinds.md",sourceDirName:"pages/spec",slug:"/pages/spec/tag_kinds",permalink:"/pages/spec/tag_kinds",draft:!1,editUrl:"https://github.com/microsoft/rushstack-websites/tree/main/websites/tsdoc.org/docs/pages/spec/tag_kinds.md",tags:[],version:"current",frontMatter:{title:"Tag kinds"},sidebar:"docsSidebar",previous:{title:"TSDoc spec",permalink:"/pages/spec/overview"},next:{title:"Standardization groups",permalink:"/pages/spec/standardization_groups"}},g={},c=[{value:"Block tags",id:"block-tags",level:2},{value:"Modifier tags",id:"modifier-tags",level:2},{value:"Inline tags",id:"inline-tags",level:2},{value:"See also",id:"see-also",level:2}],d={toc:c};function m(e){var t=e.components,n=(0,r.A)(e,o);return(0,i.yg)("wrapper",(0,a.A)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("head",null,(0,i.yg)("link",{rel:"canonical",href:"https://tsdoc.org/pages/pages/spec/tag_kinds/"})),(0,i.yg)("p",null,"TSDoc distinguishes three kinds of tags: Block tags, modifier tags, and inline tags."),(0,i.yg)("p",null,"Tag names start with an at-sign (",(0,i.yg)("inlineCode",{parentName:"p"},"@"),') followed by ASCII letters using "camelCase" capitalization.'),(0,i.yg)("p",null,"A tag is defined to have exactly one of these three forms. For example, the ",(0,i.yg)("inlineCode",{parentName:"p"},"@link")," tag must\nnot be written as a block tag because it is defined to be an inline tag."),(0,i.yg)("h2",{id:"block-tags"},"Block tags"),(0,i.yg)("p",null,"Block tags should always appear as the first element on a line. In normalized form, a block tag\nshould be the only element on its line, except for certain tags that assign special meaning to\nthe first line of text. For example, the ",(0,i.yg)("a",{parentName:"p",href:"/pages/tags/example"},"@example")," and\n",(0,i.yg)("a",{parentName:"p",href:"/pages/tags/throws"},"@throws")," tags interpret their first line as a section title."),(0,i.yg)("p",null,"All text following a block tag, up until the start of the next block tag or modifier tag, is\nconsidered to be the block tag's ",(0,i.yg)("strong",{parentName:"p"},"tag content"),'. The content may include Markdown elements and\ninline tags. Any content appearing prior to the first block tag is interpreted as the special\n"summary" section.'),
1(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Examples of block tags:")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-ts"},"/**\n * This is the special summary section.\n *\n * @remarks\n * This is a standalone block.\n *\n * @example Logging a warning\n * ```ts\n * logger.warn('Something happened');\n * ```\n *\n * @example Logging an error\n * ```ts\n * logger.error('Something happened');\n * ```\n */\n")),(0,i.yg)("h2",{id:"modifier-tags"},"Modifier tags"),(0,i.yg)("p",null,"Modifier tags indicate a special quality of an API. Modifier tags are generally parsed the same as block tags,\nwith the expectation that their tag content is empty. If tag content is found after a modifier tag, a parser\nmay choose to discard it, or (in situations where it improves compatibility) to associate it with the previous\nblock tag."),(0,i.yg)("p",null,"In normalized form, the modifier tags appear on a single line at the bottom of the doc comment."),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Examples of modifier tags:")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-ts"},"/**\n * This is the special summary section.\n *\n * @remarks\n * This is a standalone block.\n *\n * @public @sealed\n */\n")),(0,i.yg)("p",null,"In the above example, ",(0,i.yg)("inlineCode",{parentName:"p"},"@public")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"@sealed")," are modifier tags."),(0,i.yg)("h2",{id:"inline-tags"},"Inline tags"),(0,i.yg)("p",null,"Inline tags appear as content elements along with Markdown expressions. Inline tags are always surrounded\nby ",(0,i.yg)("inlineCode",{parentName:"p"},"{")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"}")," characters. The ",(0,i.yg)("inlineCode",{parentName:"p"},"@link")," and ",(0,i.yg)("inlineCode",{parentName:"p"},"@inheritDoc")," tags are examples of inline tags."),(0,i.yg)("p",null,(0,i.yg)("strong",{parentName:"p"},"Examples of inline tags:")),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-ts"},"class Book {\n  /**\n   * Writes the book information into a JSON file.\n   *\n   * @remarks\n   * This method saves the book information to a JSON file conforming to the standardized\n   * {@link http://example.com/ | Example Book Interchange Format}.\n   */\n  public writeFile(options?: IWriteFileOptions): void {\n    . . .\n  }\n\n  /**\n   * {@inheritDoc Book.writeFile}\n   * @deprecated Use {@link Book.writeFile} instead.\n   */\n  public save(): void {\n    . . .\n  }\n}\n")),(0,i.yg)("h2",{id:"see-also"},"See also"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("a",{parentName:"li",href:"https://github.com/microsoft/tsdoc/issues/21"},"RFC #21"),": Support for custom TSDoc tags")))}m.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.