You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the events we dispatch are only described at the jsdoc level, not in any actual Closure types. For example:
/** * @event shaka.Player.ErrorEvent * @description Fired when a playback error occurs. * @property {string} type * 'error' * @property {!shaka.util.Error} detail * An object which contains details on the error. The error's 'category' and * 'code' properties will identify the specific error that occurred. In an * uncompiled build, you can also use the 'message' and 'stack' properties * to debug. * @exportDoc */
It would be ideal to make these part of the generated externs, so that projects building with Closure (and some day TypeScript (#1273)) could use these event types.
To do that, I'm not sure of the best approach. Probably, the event types should be promoted to proper types in Closure. Then the existing extern generator could pick them up and describe them.
The text was updated successfully, but these errors were encountered:
A pattern that should work is to have an actual class for each event. For example, shaka.Player.ErrorEvent = class { ... }
The constructor takes all the necessary parameters, like the error object (shaka.util.Error), but the constructor would hard-code the type constant (like "error"). These would all inherit from shaka.util.FakeEvent.
So instead of the player calling this very generic utility for constructing FakeEvent instances:
Right now, the events we dispatch are only described at the jsdoc level, not in any actual Closure types. For example:
It would be ideal to make these part of the generated externs, so that projects building with Closure (and some day TypeScript (#1273)) could use these event types.
To do that, I'm not sure of the best approach. Probably, the event types should be promoted to proper types in Closure. Then the existing extern generator could pick them up and describe them.
The text was updated successfully, but these errors were encountered: