UNPKG

5.15 kBTypeScriptView Raw
1import { DocNode, DocNodeKind, IDocNodeParameters } from './DocNode';
2import { DocSection } from './DocSection';
3import { StandardModifierTagSet } from '../details/StandardModifierTagSet';
4import { DocBlock } from './DocBlock';
5import { DocInheritDocTag } from './DocInheritDocTag';
6import { DocParamCollection } from './DocParamCollection';
7/**
8 * Constructor parameters for {@link DocComment}.
9 */
10export interface IDocCommentParameters extends IDocNodeParameters {
11}
12/**
13 * Represents an entire documentation comment conforming to the TSDoc structure.
14 * This is the root of the DocNode tree.
15 */
16export declare class DocComment extends DocNode {
17 /**
18 * The main documentation for an API item is separated into a brief "summary" section,
19 * optionally followed by an `@remarks` block containing additional details.
20 *
21 * @remarks
22 * The summary section should be brief. On a documentation web site, it will be shown
23 * on a page that lists summaries for many different API items. On a detail page for
24 * a single item, the summary will be shown followed by the remarks section (if any).
25 */
26 summarySection: DocSection;
27 /**
28 * The main documentation for an API item is separated into a brief "summary" section
29 * optionally followed by an `@remarks` block containing additional details.
30 *
31 * @remarks
32 * Unlike the summary, the remarks block may contain lengthy documentation content.
33 * The remarks should not restate information from the summary, since the summary section
34 * will always be displayed wherever the remarks section appears. Other sections
35 * (e.g. an `@example` block) will be shown after the remarks section.
36 */
37 remarksBlock: DocBlock | undefined;
38 /**
39 * The `@privateRemarks` tag starts a block of additional commentary that is not meant
40 * for an external audience. A documentation tool must omit this content from an
41 * API reference web site. It should also be omitted when generating a normalized
42 * *.d.ts file intended for third-party developers.
43 *
44 * @remarks
45 * A similar effect could be accomplished by enclosing content inside CommonMark
46 * `<!-- -->` comments, or by moving the content into a separate `//` TypeScript comment.
47 * However, the `@privateRemarks` tag is a more formal convention.
48 */
49 privateRemarks: DocBlock | undefined;
50 /**
51 * If present, this block indicates that an API item is no loner supported and may be
52 * removed in a future release. The `@deprecated` tag must be followed by a sentence
53 * describing the recommended alternative. Deprecation recursively applies to members
54 * of a container. For example, if a class is deprecated, then so are all of its members.
55 */
56 deprecatedBlock: DocBlock | undefined;
57 /**
58 * The collection of parsed `@param` blocks for this doc comment.
59 */
60 readonly params: DocParamCollection;
61 /**
62 * The collection of parsed `@typeParam` blocks for this doc comment.
63 */
64 readonly typeParams: DocParamCollection;
65 /**
66 * The `@returns` block for this doc comment, or undefined if there is not one.
67 */
68 returnsBlock: DocBlock | undefined;
69 /**
70 * If this doc comment contains an `@inheritDoc` tag, it will be extracted and associated
71 * with the DocComment.
72 */
73 inheritDocTag: DocInheritDocTag | undefined;
74 /**
75 * The modifier tags for this DocComment.
76 */
77 readonly modifierTagSet: StandardModifierTagSet;
78 private _seeBlocks;
79 private _customBlocks;
80 /**
81 * Don't call this directly. Instead use {@link TSDocParser}
82 * @internal
83 */
84 constructor(parameters: IDocCommentParameters);
85 /** @override */
86 get kind(): DocNodeKind | string;
87 /**
88 * The collection of all `@see` DockBlockTag nodes belonging to this doc comment.
89 */
90 get seeBlocks(): ReadonlyArray<DocBlock>;
91 /**
92 * The collection of all DocBlock nodes belonging to this doc comment.
93 */
94 get customBlocks(): ReadonlyArray<DocBlock>;
95 /**
96 * Append an item to the seeBlocks collection.
97 * @internal
98 */
99 _appendSeeBlock(block: DocBlock): void;
100 /**
101 * Append an item to the customBlocks collection.
102 */
103 appendCustomBlock(block: DocBlock): void;
104 /** @override */
105 protected onGetChildNodes(): ReadonlyArray<DocNode | undefined>;
106 /**
107 * Generates a doc comment corresponding to the `DocComment` tree. The output is in a normalized form,
108 * and may ignore formatting/spacing from the original input.
109 *
110 * @remarks
111 * After parsing a string, and possibly modifying the result, `emitAsTsdoc()` can be used to render the result
112 * as a doc comment in a normalized format. It can also be used to emit a `DocComment` tree that was constructed
113 * manually.
114 *
115 * This method is provided as convenience for simple use cases. To customize the output, or if you need
116 * to render into a `StringBuilder`, use the {@link TSDocEmitter} class instead.
117 */
118 emitAsTsdoc(): string;
119}
120//# sourceMappingURL=DocComment.d.ts.map
\No newline at end of file