From 2ce3e98df04b861b4a3e45d805cdc78e85bf704f Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Fri, 12 Dec 2025 23:10:57 +0100 Subject: [PATCH] Improve type safety: Replace any with proper types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace `candidate: any` with `candidate: RTCIceCandidateInit | null`: Changes: - api.ts poll() return type (line 366) - rondevu.ts pollOffers() return type (line 827) - IceCandidate interface (line 41) Benefits: - Better type safety and IntelliSense support - Matches WebRTC spec (candidates can be null) - Catches potential type errors at compile time - Clearer API contracts for consumers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/api.ts | 4 ++-- src/rondevu.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api.ts b/src/api.ts index 8b73cc6..a589287 100644 --- a/src/api.ts +++ b/src/api.ts @@ -38,7 +38,7 @@ export interface Service { } export interface IceCandidate { - candidate: RTCIceCandidateInit + candidate: RTCIceCandidateInit | null createdAt: number } @@ -363,7 +363,7 @@ export class RondevuAPI { iceCandidates: Record< string, Array<{ - candidate: any + candidate: RTCIceCandidateInit | null role: 'offerer' | 'answerer' peerId: string createdAt: number diff --git a/src/rondevu.ts b/src/rondevu.ts index 8a00043..9e781e7 100644 --- a/src/rondevu.ts +++ b/src/rondevu.ts @@ -824,7 +824,7 @@ export class Rondevu { answeredAt: number }> iceCandidates: Record