Skip to content

Conversation

vatson
Copy link

@vatson vatson commented Oct 13, 2025

Refactor TypeScript types to use official OpenTok SDK types where possible, removing outdated custom types. This improves compatibility with the latest OpenTok SDK and reduces maintenance overhead.

Current example of conflict with opentok 2.29.2
Screenshot 2025-10-13 at 23 54 09

Details

  • Removed most of the custom OpenTok types from src/NetworkTest/types/opentok/*.

  • Kept only minimal custom types that could not be safely replaced with official types:

    • PublisherStats — differs from OT.PublisherStats.
    • InitSessionOptions — for explicit session initialization safety.
    • SessionCredentials — combines parameters from initSession and connect.
    • RTCIceCandidateStats — WebRTC native types lack timestamp and protocol.
  • Updated tsconfig.json to include "dom.iterable" in lib to allow usage of RTCStatsReport.values().

  • Removed @types/webrtc and @types/opentok from package.json as they are no longer necessary and conflicted with official @opentok/client types.

This change simplifies type management and makes the project compatible with the latest OpenTok SDK versions.

… types, update tsconfig

- Removed most of the custom OpenTok types in favor of official @opentok/client types
- Kept minimal custom types: PublisherStats, InitSessionOptions, SessionCredentials, RTCIceCandidateStats
- Updated tsconfig.json to include "dom.iterable" to allow RTCStatsReport.values()
- Removed @types/webrtc and @types/opentok
@vatson
Copy link
Author

vatson commented Oct 14, 2025

@LukaszPilarski Sorry, I found a bug in the code; I forgot to rename it in two places. I tested this package in the project even without the latest changes, and it still worked because OT is globally accessible anyway. But now it's safer. Could you check it again and approve it?

@LukaszPilarski
Copy link

@vatson I resolved the conflicts. Please check if everything still works fine, after that I will reapprove.

@vatson
Copy link
Author

vatson commented Oct 16, 2025

@LukaszPilarski thanks for notification. I checked and added proper changes. Now everything looks good

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