File tree 3 files changed +63
-1
lines changed
tests/baselines/reference/api
3 files changed +63
-1
lines changed Original file line number Diff line number Diff line change @@ -4198,7 +4198,29 @@ export function canHaveJSDoc(node: Node): node is HasJSDoc {
4198
4198
}
4199
4199
}
4200
4200
4201
- /** @internal */
4201
+ /**
4202
+ * This function checks multiple locations for JSDoc comments that apply to a host node.
4203
+ * At each location, the whole comment may apply to the node, or only a specific tag in
4204
+ * the comment. In the first case, location adds the entire {@link JSDoc} object. In the
4205
+ * second case, it adds the applicable {@link JSDocTag}.
4206
+ *
4207
+ * For example, a JSDoc comment before a parameter adds the entire {@link JSDoc}. But a
4208
+ * `@param` tag on the parent function only adds the {@link JSDocTag} for the `@param`.
4209
+ *
4210
+ * ```ts
4211
+ * /** JSDoc will be returned for `a` *\/
4212
+ * const a = 0
4213
+ * /**
4214
+ * * Entire JSDoc will be returned for `b`
4215
+ * * @param c JSDocTag will be returned for `c`
4216
+ * *\/
4217
+ * function b(/** JSDoc will be returned for `c` *\/ c) {}
4218
+ * ```
4219
+ */
4220
+ export function getJSDocCommentsAndTags ( hostNode : Node ) : readonly ( JSDoc | JSDocTag ) [ ] ;
4221
+ /** @internal separate signature so that stripInternal can remove noCache from the public API */
4222
+ // eslint-disable-next-line @typescript-eslint/unified-signatures
4223
+ export function getJSDocCommentsAndTags ( hostNode : Node , noCache ?: boolean ) : readonly ( JSDoc | JSDocTag ) [ ] ;
4202
4224
export function getJSDocCommentsAndTags ( hostNode : Node , noCache ?: boolean ) : readonly ( JSDoc | JSDocTag ) [ ] {
4203
4225
let result : ( JSDoc | JSDocTag ) [ ] | undefined ;
4204
4226
// Pull parameter comments from declaring function as well
Original file line number Diff line number Diff line change @@ -8817,6 +8817,26 @@ declare namespace ts {
8817
8817
parent: ConstructorDeclaration;
8818
8818
name: Identifier;
8819
8819
};
8820
+ /**
8821
+ * This function checks multiple locations for JSDoc comments that apply to a host node.
8822
+ * At each location, the whole comment may apply to the node, or only a specific tag in
8823
+ * the comment. In the first case, location adds the entire {@link JSDoc} object. In the
8824
+ * second case, it adds the applicable {@link JSDocTag}.
8825
+ *
8826
+ * For example, a JSDoc comment before a parameter adds the entire {@link JSDoc}. But a
8827
+ * `@param` tag on the parent function only adds the {@link JSDocTag} for the `@param`.
8828
+ *
8829
+ * ```ts
8830
+ * /** JSDoc will be returned for `a` *\/
8831
+ * const a = 0
8832
+ * /**
8833
+ * * Entire JSDoc will be returned for `b`
8834
+ * * @param c JSDocTag will be returned for `c`
8835
+ * *\/
8836
+ * function b(/** JSDoc will be returned for `c` *\/ c) {}
8837
+ * ```
8838
+ */
8839
+ function getJSDocCommentsAndTags(hostNode: Node): readonly (JSDoc | JSDocTag)[];
8820
8840
/** @deprecated */
8821
8841
function createUnparsedSourceFile(text: string): UnparsedSource;
8822
8842
/** @deprecated */
Original file line number Diff line number Diff line change @@ -4771,6 +4771,26 @@ declare namespace ts {
4771
4771
parent : ConstructorDeclaration ;
4772
4772
name : Identifier ;
4773
4773
} ;
4774
+ /**
4775
+ * This function checks multiple locations for JSDoc comments that apply to a host node.
4776
+ * At each location, the whole comment may apply to the node, or only a specific tag in
4777
+ * the comment. In the first case, location adds the entire {@link JSDoc} object. In the
4778
+ * second case, it adds the applicable {@link JSDocTag}.
4779
+ *
4780
+ * For example, a JSDoc comment before a parameter adds the entire {@link JSDoc}. But a
4781
+ * `@param` tag on the parent function only adds the {@link JSDocTag} for the `@param`.
4782
+ *
4783
+ * ```ts
4784
+ * /** JSDoc will be returned for `a` *\/
4785
+ * const a = 0
4786
+ * /**
4787
+ * * Entire JSDoc will be returned for `b`
4788
+ * * @param c JSDocTag will be returned for `c`
4789
+ * *\/
4790
+ * function b(/** JSDoc will be returned for `c` *\/ c) {}
4791
+ * ```
4792
+ */
4793
+ function getJSDocCommentsAndTags ( hostNode : Node ) : readonly ( JSDoc | JSDocTag ) [ ] ;
4774
4794
/** @deprecated */
4775
4795
function createUnparsedSourceFile ( text : string ) : UnparsedSource ;
4776
4796
/** @deprecated */
You can’t perform that action at this time.
0 commit comments