-
Notifications
You must be signed in to change notification settings - Fork 441
feat: Use declare class
where possible
#858
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
ea1e436
to
e55795c
Compare
@@ -120,6 +120,16 @@ function isEventHandler(p: Browser.Property) { | |||
return typeof p["event-handler"] === "string"; | |||
} | |||
|
|||
const newToConstructorRegExp = /^new(?:<.+?>)?(\(.+?\))(?:: ?[^)]+)?$/u; | |||
function convertNewToConstructor(signature: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems only for manual JSON data, in that case I think those should be fixed instead.
This is a possibly gigantic breaking change. I created a PR on Typescript, microsoft/TypeScript#39044, so we can run DT and other tests on it. |
We discussed this in the design meeting and decided not to take this change.
|
Added a comment: microsoft/TypeScript#39054 (comment) |
This changes emit for interfaces:
From:
To:
Which has the added benefit of supporting declaration merging for static methods and properties.
It also prevents static properties from breaking
// $ExpectType
on constructors, since it just becomes// $ExpecType typeof Foo
.This shouldn’t be a breaking change as existing consumers will keep working just fine, this just opens up new ways to extends these definitions.