Skip to content

Allow referencing type-only exports as namespace members in ImportTypes and TypeQueries #49056

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 4 commits into from
May 11, 2022

Conversation

andrewbranch
Copy link
Member

Fixes #45946

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels May 10, 2022
};
//// [button.d.ts]
export declare const c: {
directive: typeof import("./lit.js").ClassMapDirective;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is what declaration emit has always done, but was an error until now.

@andrewbranch andrewbranch requested a review from weswigham May 10, 2022 22:29
Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

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

Seems reasonable. I'm surprised it was that that easy to plumb through.

@@ -28997,7 +28999,7 @@ namespace ts {
}
return isErrorType(apparentType) ? errorType : apparentType;;
}
prop = getPropertyOfType(apparentType, right.escapedText);
prop = getPropertyOfType(apparentType, right.escapedText, /*skipObjectFunctionPropertyAugment*/ false, /*includeTypeOnlyMembers*/ node.kind === SyntaxKind.QualifiedName);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: is there a reason why here you used /*skipObjectFunctionPropertyAugment*/ false but above you use undefined?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to see if you were paying attention

@@ -28997,7 +28999,7 @@ namespace ts {
}
return isErrorType(apparentType) ? errorType : apparentType;;
Copy link
Member

Choose a reason for hiding this comment

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

;; :(

Copy link
Member

Choose a reason for hiding this comment

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

I sent a quick fix for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don’t recall seeing this or touching this line. Weird.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it’s because you did

@andrewbranch andrewbranch merged commit 5c2febf into microsoft:main May 11, 2022
@andrewbranch andrewbranch deleted the bug/45946-2 branch May 11, 2022 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type-only export causes no exported member error in generated .d.ts file
4 participants