-
Notifications
You must be signed in to change notification settings - Fork 439
Parameterizes CustomEvent and CustomEventInit #304
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
Parameterizes CustomEvent and CustomEventInit #304
Conversation
…ventInit interfaces refactor: adds readonly to CustomEventInit detail property refactor: adds default argument to CustomEventInit
Thank you for finishing it! |
No problem! Do you know why the tests are failing? I followed the instructions in the readme.. |
You have to add the type information to inputfiles/addedTypes.json or inputfiles/overridingTypes.json I'm not sure which for this pull request, that's why I didn't submit it :D You need to add the typing information to the JSON and then change the file in baselines/dom.generated.d.ts When you run the build.cmd it creates the file in generated/dom.generated.d.ts using the info in the json files, then it compares it to what you manually created in the baselines folder. That test needs to pass in order for the change to be successful. Here's an example of one of my pull requests https://github.com/Microsoft/TSJS-lib-generator/pull/282/files |
Thanks for the explaination. I manged to figure out how to override the properties and methods, however, I'm having difficulties figuring out how to override optional properties and interfaces. Optional PropertiesChanges to interface CustomEventInit extends EventInit {
readonly detail?: T;
} Changes to {
"kind": "property",
"interface": "CustomEventInit",
"readonly": true,
"name": "detail",
"type": "T"
} I suspect that it doesn't work because of the optional InterfacesChanges to interface CustomEventInit<T = any> extends EventInit {
readonly detail?: T;
} Changes to {
"kind": "interface",
"interface": "CustomEventInit",
"name": "CustomEventInit<T = any>"
} For this have no idea to what could be wrong? I have looked through some of the merged pull-requests, however, there are no examples of this. |
I wanted this same change, so started doing some research and trying to read the f sharp code. It appears that there is no way to accomplish this in the compiler. I am able to add new interfaces, but the code to modify or remove interfaces does not exist. Is there another route that should be taken or is a PR needed to update the TS.fsx file? @mhegazy |
For adding the generic type parameter, we will need a new property in |
I will make a PR to allow for overridingTypes with |
The format of the input files has changed a bit since this PR was opened. closing for now, please reopen after merging with master. |
In relation to the open issue, microsoft/TypeScript#14785.
This guy @arjunyel creates a commit, but this never makes it to a PR. So here it is!
NOTE that I was not able to run the tests sucessfully when I ran
build.cmd
.