Skip to content

Enums not exported #1111

@mwiest

Description

@mwiest

With the added types in 2.29.4, I would expect to be able to do something like this, instead of using strings like "play".

player.on(PlayerEvent.Play, (e) => updateProgress(e));
player.on(PlayerEvent.TimeUpdate, (e) => updateProgress(e));
player.on(PlayerEvent.Ended, (e) => updateProgress(e));

But, unfortunately, while player.d.ts exports this enum via export * from ./events.ts, this doesn't work, because the enum cannot be imported as a "thing" in JS for runtime. player.es.js doesn't export it. I'm not very good at TS, so, I may be missing something, but I thought I'd mention it. For now, I'm still using strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions