Skip to content

feat(types): add event, videojs handle, and default export typings - #1066

Merged
tsi merged 2 commits into
masterfrom
feat/extend-type-declarations
Jul 22, 2026
Merged

feat(types): add event, videojs handle, and default export typings#1066
tsi merged 2 commits into
masterfrom
feat/extend-type-declarations

Conversation

@kdzialdowski-cloudinary

Copy link
Copy Markdown
Contributor

The shipped VideoPlayer typings omit several members that exist at runtime, forcing consumers to augment the module locally. This adds them to types/cld-video-player.d.ts: the on/one/off/trigger event methods (wired up by setupEventMethods), the underlying videojs player handle (e.g. .videojs.el()), and the Player reference plus eventData payload attached to forwarded extended events. It also adds the missing export default for the cloudinary global, which exists at runtime (src/index.js) but was absent from the declarations.

Extended events get per-event overloads so their payloads are typed precisely: percentsplayedeventData.percent, timeplayedeventData.time, seekeventData.{seekStart,seekEnd}. A trailing string overload covers all other video.js/cloudinary events.

These gaps surfaced when bumping the package in a consuming project (gallery-widget), where the fix was a local declare module augment — contributing the typings upstream removes the need for that. The type surface stays self-contained (no video.js type dependency), and types/cld-video-player-tests.ts is extended to validate the new members. Verified that gallery-widget typechecks clean with its local augment removed.

@kdzialdowski-cloudinary
kdzialdowski-cloudinary requested a review from a team as a code owner July 16, 2026 12:38
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for cld-vp-esm-pages ready!

Name Link
🔨 Latest commit 42a291a
🔍 Latest deploy log https://app.netlify.com/projects/cld-vp-esm-pages/deploys/6a59f60239411b000791b893
😎 Deploy Preview https://deploy-preview-1066--cld-vp-esm-pages.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for cld-video-player ready!

Name Link
🔨 Latest commit 42a291a
🔍 Latest deploy log https://app.netlify.com/projects/cld-video-player/deploys/6a59f6025687dc000847c2b5
😎 Deploy Preview https://deploy-preview-1066--cld-video-player.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@tsi tsi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks!!

@tsi
tsi merged commit c46375e into master Jul 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants