Improve type safety: Replace any with proper types

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 <noreply@anthropic.com>
This commit is contained in:
2025-12-12 23:10:57 +01:00
parent 800f6eaa94
commit 2ce3e98df0
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -824,7 +824,7 @@ export class Rondevu {
answeredAt: number
}>
iceCandidates: Record<string, Array<{
candidate: any
candidate: RTCIceCandidateInit | null
role: 'offerer' | 'answerer'
peerId: string
createdAt: number