Shaka Typescript definition overriding Google Cast Sender with incomplete defs
See original GitHub issueHave you read the FAQ and checked for duplicate open issues? Yes, this does probably relate to #1030, but I assume it is cleaner to report it as a separate bug.
What version of Shaka Player are you using? 3.0.8
Can you reproduce the issue with our latest release version? NA
Can you reproduce the issue with the latest code from master
?
Not tested
Are you using the demo app or your own custom app? Own
If custom app, can you reproduce the issue using our demo app? NA
What browser and OS are you using? Any
For embedded devices (smart TVs, etc.), what model and firmware version are you using? NA
What are the manifest and license server URIs? NA
What did you do? In code unrelated to the Shaka based player Typescript gives errors, example:
const sessionObj = session.getSessionObj();
sessionObj.addMediaListener(media => {
onMediaSession(media);
});
What did you expect to happen?
Type from node_modules/@types/chrome/chrome-cast/index.d.ts
to be resolved. (That is included when using the @types/chromecast-caf-sender
package.)
What actually happened?
Type from node_modules/shaka-player/dist/shaka-player.compiled.d.ts
seems to override, in this case:
// Generated from /usr/local/google/home/joeyparrish/hacking/shaka/clean/externs/chromecast.js
declare namespace chrome.cast {
class Session {
...
Which does not contain the addMediaListener
method.
I see there are similar issues reported for IMA types in #1030, maybe Shaka should not export these definitions for ‘externs’? or maybe not in the global scope at least?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top GitHub Comments
@PabloMoragaMeli
We apologize for the generated Typescript definitions. This is not a Typescript-native project, and the tools we are using to generate the definitions are clearly not able to do everything we need. I will increase the priority of this issue.
In the meantime, you may wish to work around the issue with hand-written definitions to import Shaka Player into your Typescript project. We apologize for the inconvenience.