Skip to content

Fix some JSDoc factory function return types #38425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/compiler/factoryPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2592,23 +2592,23 @@ namespace ts {
}

export function createJSDocAuthorTag(comment?: string) {
return createJSDocTag(SyntaxKind.JSDocAuthorTag, "author", comment);
return createJSDocTag<JSDocAuthorTag>(SyntaxKind.JSDocAuthorTag, "author", comment);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm copying what's done elsewhere. This type argument is naughty, but your secret is safe with me (I won't tell Ryan).

}

export function createJSDocPublicTag() {
return createJSDocTag(SyntaxKind.JSDocPublicTag, "public");
return createJSDocTag<JSDocPublicTag>(SyntaxKind.JSDocPublicTag, "public");
}

export function createJSDocPrivateTag() {
return createJSDocTag(SyntaxKind.JSDocPrivateTag, "private");
return createJSDocTag<JSDocPrivateTag>(SyntaxKind.JSDocPrivateTag, "private");
}

export function createJSDocProtectedTag() {
return createJSDocTag(SyntaxKind.JSDocProtectedTag, "protected");
return createJSDocTag<JSDocProtectedTag>(SyntaxKind.JSDocProtectedTag, "protected");
}

export function createJSDocReadonlyTag() {
return createJSDocTag(SyntaxKind.JSDocReadonlyTag, "readonly");
return createJSDocTag<JSDocReadonlyTag>(SyntaxKind.JSDocReadonlyTag, "readonly");
}

export function appendJSDocToContainer(node: JSDocContainer, jsdoc: JSDoc) {
Expand Down
10 changes: 5 additions & 5 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4268,11 +4268,11 @@ declare namespace ts {
function createJSDocParameterTag(typeExpression: JSDocTypeExpression | undefined, name: EntityName, isNameFirst: boolean, isBracketed: boolean, comment?: string): JSDocParameterTag;
function createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral;
function createJSDocImplementsTag(classExpression: JSDocImplementsTag["class"], comment?: string): JSDocImplementsTag;
function createJSDocAuthorTag(comment?: string): JSDocTag;
function createJSDocPublicTag(): JSDocTag;
function createJSDocPrivateTag(): JSDocTag;
function createJSDocProtectedTag(): JSDocTag;
function createJSDocReadonlyTag(): JSDocTag;
function createJSDocAuthorTag(comment?: string): JSDocAuthorTag;
function createJSDocPublicTag(): JSDocPublicTag;
function createJSDocPrivateTag(): JSDocPrivateTag;
function createJSDocProtectedTag(): JSDocProtectedTag;
function createJSDocReadonlyTag(): JSDocReadonlyTag;
function appendJSDocToContainer(node: JSDocContainer, jsdoc: JSDoc): JSDocContainer;
function createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
Expand Down
10 changes: 5 additions & 5 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4268,11 +4268,11 @@ declare namespace ts {
function createJSDocParameterTag(typeExpression: JSDocTypeExpression | undefined, name: EntityName, isNameFirst: boolean, isBracketed: boolean, comment?: string): JSDocParameterTag;
function createJSDocTypeLiteral(jsDocPropertyTags?: readonly JSDocPropertyLikeTag[], isArrayType?: boolean): JSDocTypeLiteral;
function createJSDocImplementsTag(classExpression: JSDocImplementsTag["class"], comment?: string): JSDocImplementsTag;
function createJSDocAuthorTag(comment?: string): JSDocTag;
function createJSDocPublicTag(): JSDocTag;
function createJSDocPrivateTag(): JSDocTag;
function createJSDocProtectedTag(): JSDocTag;
function createJSDocReadonlyTag(): JSDocTag;
function createJSDocAuthorTag(comment?: string): JSDocAuthorTag;
function createJSDocPublicTag(): JSDocPublicTag;
function createJSDocPrivateTag(): JSDocPrivateTag;
function createJSDocProtectedTag(): JSDocProtectedTag;
function createJSDocReadonlyTag(): JSDocReadonlyTag;
function appendJSDocToContainer(node: JSDocContainer, jsdoc: JSDoc): JSDocContainer;
function createJsxElement(openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
function updateJsxElement(node: JsxElement, openingElement: JsxOpeningElement, children: readonly JsxChild[], closingElement: JsxClosingElement): JsxElement;
Expand Down