UNPKG

14 kBTypeScriptView Raw
1import { TSDocTagDefinition } from '../configuration/TSDocTagDefinition';
2/**
3 * Tags whose meaning is defined by the TSDoc standard.
4 */
5export declare class StandardTags {
6 /**
7 * (Discretionary)
8 *
9 * Suggested meaning: Designates that an API item's release stage is "alpha".
10 * It is intended to be used by third-party developers eventually, but has not
11 * yet been released. The tooling may trim the declaration from a public release.
12 *
13 * @remarks
14 * Example implementations: API Extractor
15 */
16 static readonly alpha: TSDocTagDefinition;
17 /**
18 * (Discretionary)
19 *
20 * Suggested meaning: Designates that an API item's release stage is "beta".
21 * It has been released to third-party developers experimentally for the purpose of
22 * collecting feedback. The API should not be used in production, because its contract may
23 * change without notice. The tooling may trim the declaration from a public release,
24 * but may include it in a developer preview release.
25 *
26 * @remarks
27 * Example implementations: API Extractor
28 *
29 * Synonyms: `@experimental`
30 */
31 static readonly beta: TSDocTagDefinition;
32 /**
33 * (Extended)
34 *
35 * ECMAScript decorators are sometimes an important part of an API contract.
36 * However, today the TypeScript compiler does not represent decorators in the
37 * .d.ts output files used by API consumers. The `@decorator` tag provides a workaround,
38 * enabling a decorator expressions to be quoted in a doc comment.
39 *
40 * @example
41 * ```ts
42 * class Book {
43 * /**
44 * * The title of the book.
45 * * @decorator `@jsonSerialized`
46 * * @decorator `@jsonFormat(JsonFormats.Url)`
47 * *
48 *+/
49 * @jsonSerialized
50 * @jsonFormat(JsonFormats.Url)
51 * public website: string;
52 * }
53 * ```
54 */
55 static readonly decorator: TSDocTagDefinition;
56 /**
57 * (Extended)
58 *
59 * This block tag is used to document the default value for a field or property,
60 * if a value is not assigned explicitly.
61 *
62 * @remarks
63 * This tag should only be used with fields or properties that are members of a class or interface.
64 */
65 static readonly defaultValue: TSDocTagDefinition;
66 /**
67 * (Core)
68 *
69 * This block tag communicates that an API item is no longer supported and may be removed
70 * in a future release. The `@deprecated` tag is followed by a sentence describing
71 * the recommended alternative. It recursively applies to members of the container.
72 * For example, if a class is deprecated, then so are all of its members.
73 */
74 static readonly deprecated: TSDocTagDefinition;
75 /**
76 * (Extended)
77 *
78 * When applied to a class or interface property, this indicates that the property
79 * returns an event object that event handlers can be attached to. The event-handling
80 * API is implementation-defined, but typically the property return type would be a class
81 * with members such as `addHandler()` and `removeHandler()`. A documentation tool can
82 * display such properties under an "Events" heading instead of the usual "Properties" heading.
83 */
84 static readonly eventProperty: TSDocTagDefinition;
85 /**
86 * (Extended)
87 *
88 * Indicates a documentation section that should be presented as an example
89 * illustrating how to use the API. It may include a code sample.
90 */
91 static readonly example: TSDocTagDefinition;
92 /**
93 * (Discretionary)
94 *
95 * Suggested meaning: Same semantics as `@beta`, but used by tools that don't support
96 * an `@alpha` release stage.
97 *
98 * @remarks
99 * Example implementations: Angular API documenter
100 *
101 * Synonyms: `@beta`
102 */
103 static readonly experimental: TSDocTagDefinition;
104 /**
105 * (Extended)
106 *
107 * This inline tag is used to automatically generate an API item's documentation by
108 * copying it from another API item. The inline tag parameter contains a reference
109 * to the other item, which may be an unrelated class, or even an import from a
110 * separate NPM package.
111 *
112 * @remarks
113 * What gets copied
114 *
115 * The `@inheritDoc` tag does not copy the entire comment body. Only the following
116 * components are copied:
117 * - summary section
118 * - `@remarks` block
119 * - `@params` blocks
120 * - `@typeParam` blocks
121 * - `@returns` block
122 * Other tags such as `@defaultValue` or `@example` are not copied, and need to be
123 * explicitly included after the `@inheritDoc` tag.
124 *
125 * TODO: The notation for API item references is still being standardized. See this issue:
126 * https://github.com/microsoft/tsdoc/issues/9
127 */
128 static readonly inheritDoc: TSDocTagDefinition;
129 /**
130 * (Discretionary)
131 *
132 * Suggested meaning: Designates that an API item is not planned to be used by
133 * third-party developers. The tooling may trim the declaration from a public release.
134 * In some implementations, certain designated packages may be allowed to consume
135 * internal API items, e.g. because the packages are components of the same product.
136 *
137 * @remarks
138 * Example implementations: API Extractor
139 */
140 static readonly internal: TSDocTagDefinition;
141 /**
142 * (Core)
143 *
144 * The `{@label}` inline tag is used to label a declaration, so that it can be referenced
145 * using a selector in the TSDoc declaration reference notation.
146 *
147 * @remarks
148 * TODO: The `{@label}` notation is still being standardized. See this issue:
149 * https://github.com/microsoft/tsdoc/issues/9
150 */
151 static readonly label: TSDocTagDefinition;
152 /**
153 * (Core)
154 *
155 * The `{@link}` inline tag is used to create hyperlinks to other pages in a
156 * documentation system or general internet URLs. In particular, it supports
157 * expressions for referencing API items.
158 *
159 * @remarks
160 * TODO: The `{@link}` notation is still being standardized. See this issue:
161 * https://github.com/microsoft/tsdoc/issues/9
162 */
163 static readonly link: TSDocTagDefinition;
164 /**
165 * (Extended)
166 *
167 * This modifier has similar semantics to the `override` keyword in C# or Java.
168 * For a member function or property, explicitly indicates that this definition
169 * is overriding (i.e. redefining) the definition inherited from the base class.
170 * The base class definition would normally be marked as `virtual`.
171 *
172 * @remarks
173 * A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`
174 * modifiers are consistently applied, but this is not required by the TSDoc standard.
175 */
176 static readonly override: TSDocTagDefinition;
177 /**
178 * (Core)
179 *
180 * Used to indicate a doc comment that describes an entire NPM package (as opposed
181 * to an individual API item belonging to that package). The `@packageDocumentation` comment
182 * is found in the *.d.ts file that acts as the entry point for the package, and it
183 * should be the first `/**` comment encountered in that file. A comment containing a
184 * `@packageDocumentation` tag should never be used to describe an individual API item.
185 */
186 static readonly packageDocumentation: TSDocTagDefinition;
187 /**
188 * (Core)
189 *
190 * Used to document a function parameter. The `@param` tag is followed by a parameter
191 * name, followed by a hyphen, followed by a description. The TSDoc parser recognizes
192 * this syntax and will extract it into a DocParamBlock node.
193 */
194 static readonly param: TSDocTagDefinition;
195 /**
196 * (Core)
197 *
198 * Starts a section of additional documentation content that is not intended for a
199 * public audience. A tool must omit this entire section from the API reference web site,
200 * generated *.d.ts file, and any other outputs incorporating the content.
201 */
202 static readonly privateRemarks: TSDocTagDefinition;
203 /**
204 * (Discretionary)
205 *
206 * Suggested meaning: Designates that an API item's release stage is "public".
207 * It has been officially released to third-party developers, and its signature is
208 * guaranteed to be stable (e.g. following Semantic Versioning rules).
209 *
210 * @remarks
211 * Example implementations: API Extractor
212 */
213 static readonly public: TSDocTagDefinition;
214 /**
215 * (Extended)
216 *
217 * This modifier tag indicates that an API item should be documented as being read-only,
218 * even if the TypeScript type system may indicate otherwise. For example, suppose a
219 * class property has a setter function that always throws an exception explaining that
220 * the property cannot be assigned; in this situation, the `@readonly` modifier can be
221 * added so that the property is shown as read-only in the documentation.
222 *
223 * @remarks
224 * Example implementations: API Extractor
225 */
226 static readonly readonly: TSDocTagDefinition;
227 /**
228 * (Core)
229 *
230 * The main documentation for an API item is separated into a brief "summary" section,
231 * optionally followed by a more detailed "remarks" section. On a documentation web site,
232 * index pages (e.g. showing members of a class) will show only the brief summaries,
233 * whereas a detail pages (e.g. describing a single member) will show the summary followed
234 * by the remarks. The `@remarks` block tag ends the summary section, and begins the
235 * remarks section for a doc comment.
236 */
237 static readonly remarks: TSDocTagDefinition;
238 /**
239 * (Core)
240 *
241 * Used to document the return value for a function.
242 */
243 static readonly returns: TSDocTagDefinition;
244 /**
245 * (Extended)
246 *
247 * This modifier has similar semantics to the `sealed` keyword in C# or Java.
248 * For a class, indicates that subclasses must not inherit from the class.
249 * For a member function or property, indicates that subclasses must not override
250 * (i.e. redefine) the member.
251 *
252 * @remarks
253 * A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`
254 * modifiers are consistently applied, but this is not required by the TSDoc standard.
255 */
256 static readonly sealed: TSDocTagDefinition;
257 /**
258 * (Extended)
259 *
260 * Used to build a list of references to an API item or other resource that may be related to the
261 * current item.
262 *
263 * @remarks
264 *
265 * For example:
266 *
267 * ```ts
268 * /**
269 * * Parses a string containing a Uniform Resource Locator (URL).
270 * * @see {@link ParsedUrl} for the returned data structure
271 * * @see {@link https://tools.ietf.org/html/rfc1738|RFC 1738}
272 * * for syntax
273 * * @see your developer SDK for code samples
274 * * @param url - the string to be parsed
275 * * @returns the parsed result
276 * */
277 * function parseURL(url: string): ParsedUrl;
278 * ```
279 *
280 * `@see` is a block tag. Each block becomes an item in the list of references. For example, a documentation
281 * system might render the above blocks as follows:
282 *
283 * ```markdown
284 * `function parseURL(url: string): ParsedUrl;`
285 *
286 * Parses a string containing a Uniform Resource Locator (URL).
287 *
288 * ## See Also
289 * - ParsedUrl for the returned data structure
290 * - RFC 1738 for syntax
291 * - your developer SDK for code samples
292 * ```
293 *
294 * NOTE: JSDoc attempts to automatically hyperlink the text immediately after `@see`. Because this is ambiguous
295 * with plain text, TSDoc instead requires an explicit `{@link}` tag to make hyperlinks.
296 */
297 static readonly see: TSDocTagDefinition;
298 /**
299 * (Extended)
300 *
301 * Used to document an exception type that may be thrown by a function or property.
302 *
303 * @remarks
304 *
305 * A separate `@throws` block should be used to document each exception type. This tag is for informational
306 * purposes only, and does not restrict other types from being thrown. It is suggested, but not required,
307 * for the `@throws` block to start with a line containing only the name of the exception.
308 *
309 * For example:
310 *
311 * ```ts
312 * /**
313 * * Retrieves metadata about a book from the catalog.
314 * *
315 * * @param isbnCode - the ISBN number for the book
316 * * @returns the retrieved book object
317 * *
318 * * @throws {@link IsbnSyntaxError}
319 * * This exception is thrown if the input is not a valid ISBN number.
320 * *
321 * * @throws {@link book-lib#BookNotFoundError}
322 * * Thrown if the ISBN number is valid, but no such book exists in the catalog.
323 * *
324 * * @public
325 * */
326 * function fetchBookByIsbn(isbnCode: string): Book;
327 * ```
328 */
329 static readonly throws: TSDocTagDefinition;
330 /**
331 * (Core)
332 *
333 * Used to document a generic parameter. The `@typeParam` tag is followed by a parameter
334 * name, followed by a hyphen, followed by a description. The TSDoc parser recognizes
335 * this syntax and will extract it into a DocParamBlock node.
336 */
337 static readonly typeParam: TSDocTagDefinition;
338 /**
339 * (Extended)
340 *
341 * This modifier has similar semantics to the `virtual` keyword in C# or Java.
342 * For a member function or property, explicitly indicates that subclasses may override
343 * (i.e. redefine) the member.
344 *
345 * @remarks
346 * A documentation tool may enforce that the `@virtual`, `@override`, and/or `@sealed`
347 * modifiers are consistently applied, but this is not required by the TSDoc standard.
348 */
349 static readonly virtual: TSDocTagDefinition;
350 /**
351 * Returns the full list of all core tags.
352 */
353 static allDefinitions: ReadonlyArray<TSDocTagDefinition>;
354 private static _defineTag;
355}
356//# sourceMappingURL=StandardTags.d.ts.map
\No newline at end of file