1"use strict";(self.webpackChunktsdoc_org=self.webpackChunktsdoc_org||[]).push([[6036],{5552(e,t,n){n.d(t,{xA:()=>s,yg:()=>m});var r=n(829);function a(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 r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}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){a(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 l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),c=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=c(e.components);return r.createElement(p.Provider,{value:t},e.children)},g={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef(function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=c(n),m=a,u=d["".concat(p,".").concat(m)]||d[m]||g[m]||i;return n?r.createElement(u,o(o({ref:t},s),{},{components:n})):r.createElement(u,o({ref:t},s))});function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=d;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l.mdxType="string"==typeof e?e:a,o[1]=l;for(var c=2;c<i;c++)o[c]=n[c];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},1404(e,t,n){n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>p,default:()=>m,frontMatter:()=>l,metadata:()=>c,toc:()=>g});var r=n(6443),a=n(8338),i=(n(829),n(5552)),o=["components"],l={title:"@inheritDoc"},p=void 0,c={unversionedId:"pages/tags/inheritdoc",id:"pages/tags/inheritdoc",title:"@inheritDoc",description:"| | |",source:"@site/docs/pages/tags/inheritdoc.md",sourceDirName:"pages/tags",slug:"/pages/tags/inheritdoc",permalink:"/pages/tags/inheritdoc",draft:!1,editUrl:"https://github.com/microsoft/rushstack-websites/tree/main/websites/tsdoc.org/docs/pages/tags/inheritdoc.md",tags:[],version:"current",frontMatter:{title:"@inheritDoc"},sidebar:"docsSidebar",previous:{title:"@experimental",permalink:"/pages/tags/experimental"},next:{title:"@internal",permalink:"/pages/tags/internal"}},s={},g=[{value:"Usage",id:"usage",level:2},{value:"What gets copied",id:"what-gets-copied",level:3},{value:"Example",id:"example",level:2}],d={toc:g};function m(e){var t=e.components,n=(0,a.A)(e,o);return(0,i.yg)("wrapper",(0,r.A)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,i.yg)("head",null,(0,i.yg)("link",{rel:"canonical",href:"https://tsdoc.org/pages/pages/tags/inheritdoc/"})),(0,i.yg)("table",null,(0,i.yg)("tbody",{parentName:"table"},(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"Standardization:"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("a",{parentName:"td",href:"/pages/spec/standardization_groups"},"Extended"))),(0,i.yg)("tr",{parentName:"tbody"},(0,i.yg)("td",{parentName:"tr",align:null},"Syntax kind:"),(0,i.yg)("td",{parentName:"tr",align:null},(0,i.yg)("a",{parentName:"td",href:"/pages/spec/tag_kinds"},"Inline tag"))))),(0,i.yg)("h2",{id:"usage"},"Usage"),(0,i.yg)("p",null,"This inline tag is used to automatically generate an API item's documentation by copying it from another\nAPI item. The inline tag parameter contains a reference to the other item, which may be an unrelated class,\nor even an import from a separate NPM package."),(0,i.yg)("blockquote",null,(0,i.yg)("p",{parentName:"blockquote"},"Note: The notation for declaration references has not been finalized. See GitHub\n",(0,i.yg)("a",{parentName:"p",href:"https://github.com/microsoft/tsdoc/issues/9"},"issue #9"))),(0,i.yg)("h3",{id:"what-gets-copied"},"What gets copied"),(0,i.yg)("p",null,"The ",(0,i.yg)("inlineCode",{parentName:"p"},"@inheritDoc")," tag does not copy the entire comment body. Only the following components are copied:"),(0,i.yg)("ul",null,(0,i.yg)("li",{parentName:"ul"},"summary section"),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("inlineCode",{parentName:"li"},"@remarks")," block"),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("inlineCode",{parentName:"li"},"@params")," blocks"),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("inlineCode",{parentName:"li"},"@typeParam")," blocks"),(0,i.yg)("li",{parentName:"ul"},(0,i.yg)("inlineCode",{parentName:"li"},"@returns")," block")),(0,i.yg)("p",null,"Other tags such as ",(0,i.yg)("inlineCode",{parentName:"p"},"@defaultValue")," or ",(0,i.yg)("inlineCode",{parentName:"p"},"@example")," are not copied, and need to be explicitly included after\nthe ",(0,i.yg)("inlineCode",{parentName:"p"},"@inheritDoc")," tag. When the ",(0,i.yg)("inlineCode",{parentName:"p"},"@inheritDoc")," tag is specified, neither the summary section nor the ",(0,i.yg)("inlineCode",{parentName:"p"},"@remarks"),"\nsection may be specified in the comment."),(0,i.yg)("h2",{id:"example"},"Example"),(0,i.yg)("pre",null,(0,i.yg)("code",{parentName:"pre",className:"language-ts"},"import { Serializer } from 'example-library';\n\n/**\n * An interface describing a widget.\n * @public\n */\nexport interface IWidget {\n /**\n * Draws the widget on the display surface.\n * @param x - the X position of the widget\n * @param y - the Y position of the widget\n */\n public draw(x: number, y: number): void;\n}\n\n/** @public */\nexport class Button implements IWidget {\n /** {@inheritDoc IWidget.draw} */\n public draw(x: number, y: number): void {\n . . .\n }\n\n /**\n * {@inheritDoc example-library#Serializer.writeFile}\n * @deprecated Use {@link example-library#Serializer.writeFile} instead.\n */\n public save(): void {\n . . .\n }\n}\n")))}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.