TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
Add UserActivation interface to Navigator interface in lib.dom.d.ts
I'm using tsc 4.8.4 and there is no support for navigator.userActivation. This is now part of the HTML Living Standard and implemented by Chrome, Edge, and Opera browsers.
Spec: https://html.spec.whatwg.org/multipage/interaction.html#the-useractivation-interface MDN: https://developer.mozilla.org/en-US/docs/Web/API/UserActivation
This is useful when writing JavaScript that interacts with Web API's that are gated behind user interaction, such as the Web Speech API.
Chrome, Edge and Opera are all chromium based so only 1 implementation but 2 are required for a feature to be added.
Ok, so the requirements for implementation of a spec sound like it must not be an experimental technology as defined by MDN.
For the record, that seems a little conservative, and makes it harder to adopt TypeScript when leveraging new technologies that have real world implementations (by the world's most popular browser).
@morganney You can fork this and change here https://github.com/microsoft/TypeScript-DOM-lib-generator/blob/main/src/build/bcd.ts#L17 that chrome count as 2 if you need that. And build it for your use.
There are so many experimantal api out there you won't want to include all of them...
There are so many experimantal api out there you won't want to include all of them...
@mathe42 I can understand that stance. Like I alluded to, you are making it harder to use TypeScript while leveraging new tech that does have real world implementations when you make that choice, however.
Thanks for the suggested help.
Fixed by #1514.
@github-actions close
Closing because @saschanaz is one of the code-owners of this repository.