PageSourceSearch

https://api-extractor.com/assets/js/5a7afa1a.2c9efe52.js

js api-extractor.com collected 2026-10-02 04:22:26 UTC 5,865 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapi_extractor_com=self.webpackChunkapi_extractor_com||[]).push([[5380],{2645:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>m,frontMatter:()=>i,metadata:()=>u,toc:()=>p});var a=n(6443),r=n(8338),l=(n(829),n(5552)),o=["components"],i={title:"@defaultValue"},s=void 0,u={unversionedId:"pages/tsdoc/tag_defaultvalue",id:"pages/tsdoc/tag_defaultvalue",title:"@defaultValue",description:"Tag type: block tag",source:"@site/docs/pages/tsdoc/tag_defaultvalue.md",sourceDirName:"pages/tsdoc",slug:"/pages/tsdoc/tag_defaultvalue",permalink:"/pages/tsdoc/tag_defaultvalue",draft:!1,editUrl:"https://github.com/microsoft/rushstack-websites/tree/main/websites/api-extractor.com/docs/pages/tsdoc/tag_defaultvalue.md",tags:[],version:"current",frontMatter:{title:"@defaultValue"},sidebar:"docsSidebar",previous:{title:"@beta",permalink:"/pages/tsdoc/tag_beta"},next:{title:"@deprecated",permalink:"/pages/tsdoc/tag_deprecated"}},c={},p=[{value:"See also",id:"see-also",level:2}],g={toc:p},d="wrapper";function m(e){var t=e.components,n=(0,r.A)(e,o);return(0,l.yg)(d,(0,a.A)({},g,n,{components:t,mdxType:"MDXLayout"}),(0,l.yg)("head",null,(0,l.yg)("link",{rel:"canonical",href:"https://api-extractor.com/pages/pages/tsdoc/tag_defaultvalue/"})),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Tag type:")," block tag"),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"TSDoc standardization:")," ",(0,l.yg)("a",{parentName:"p",href:"https://github.com/microsoft/tsdoc/blob/master/tsdoc/src/details/Standardization.ts"},"extended")),(0,l.yg)("p",null,"This tag is used to document the default value for a field or property, if a value is not assigned explicitly.\nThis tag should only be used with fields or properties that are members of a class or interface."),(0,l.yg)("p",null,"Being a block tag, ",(0,l.yg)("inlineCode",{parentName:"p"},"@defaultValue"),' introduces a TSDoc section that contains all comment text up until the\nnext block tag. This content is called the "',(0,l.yg)("strong",{parentName:"p"},"value text"),'". The value text can have various forms, for example:'),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},"A literal value, for example: ",(0,l.yg)("inlineCode",{parentName:"li"},"@defaultValue 3")),(0,l.yg)("li",{parentName:"ul"},"A code span, for example: ",(0,l.yg)("code",null,"@defaultValue ",(0,l.yg)("inlineCode",{parentName:"li"},"true"))),(0,l.yg)("li",{parentName:"ul"},"Arbitrary rich text potentially spanning multiple lines,\nfor example: ",(0,l.yg)("br",null)," ",(0,l.yg)("inlineCode",{parentName:"li"},"@defaultValue An instance of the {@link Widget} object"))),(0,l.yg)("p",null,"Thus, documentation templates should not assume that the value text will consist entirely of code."),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Usage example:")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-ts"},"export enum WarningStyle {\n  DialogBox,\n  StatusMessage,\n  LogOnly\n}\n\nexport interface IWarningOptions {\n  /**\n   * Determines how the warning will be displayed.\n   *\n   * @remarks\n   * See {@link WarningStyle| the WarningStyle enum} for more details.\n   *\n   * @defaultValue `WarningStyle.DialogBox`\n   */\n  warningStyle: WarningStyle;\n\n  /**\n   * Whether the warning can interrupt a user's current activity.\n   *\n   * @defaultValue\n   * The default is `true` unless {@link WarningStyle.StatusMessage}\n   * was requested.\n   */\n  cancellable?: boolean;\n\n  message: string;\n}\n")),(0,l.yg)("h2",{id:"see-also"},"See also"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/microsoft/tsdoc/issues/27"},"TSDoc RFC #27"))))}m.isMDXComponent=!0}
1,5552:(e,t,n)=>{n.d(t,{xA:()=>c,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 l(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?l(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},c=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},p="mdxType",g={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,l=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=u(n),d=r,m=p["".concat(s,".").concat(d)]||p[d]||g[d]||l;return n?a.createElement(m,o(o({ref:t},c),{},{components:n})):a.createElement(m,o({ref:t},c))});function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,o=new Array(l);o[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[p]="string"==typeof e?e:r,o[1]=i;for(var u=2;u<l;u++)o[u]=n[u];return a.createElement.apply(null,o)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);

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.