Implement RondevuAPI and RondevuSignaler classes

Added comprehensive API client and signaling implementation:

**RondevuAPI** - Single class for all Rondevu endpoints:
- Authentication: register()
- Offers: createOffers(), getOffer(), answerOffer(), getAnswer(), searchOffers()
- ICE Candidates: addIceCandidates(), getIceCandidates()
- Services: publishService(), getService(), searchServices()
- Usernames: checkUsername(), claimUsername()

**RondevuSignaler** - ICE candidate exchange:
- addIceCandidate() - Send local candidates to server
- addListener() - Poll for remote candidates (1 second intervals)
- Returns cleanup function (Binnable) to stop polling
- Handles offer expiration gracefully

**WebRTCRondevuConnection** - WebRTC connection wrapper:
- Handles offer/answer creation
- Manages ICE candidate exchange via Signaler
- Type-safe event bus for state changes and messages
- Queue and send message interfaces

**Utilities**:
- createBin() - Cleanup function collector
- Binnable type - Cleanup function signature

All classes use the shared RondevuAPI client for consistent
error handling and authentication.

🤖 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-07 17:40:17 +01:00
parent 5e673ac993
commit 58cd610694
8 changed files with 590 additions and 151 deletions

View File

@@ -5,12 +5,27 @@
export { ConnectionManager } from './connection-manager.js';
export { EventBus } from './event-bus.js';
export { RondevuAPI } from './api.js';
export { RondevuSignaler } from './signaler.js';
export { WebRTCRondevuConnection } from './connection.js';
export { createBin } from './bin.js';
// Export types
export type {
ConnectionIdentity,
ConnectionState,
ConnectionInterface,
Connection,
QueueMessageOptions
QueueMessageOptions,
Message,
ConnectionEvents,
Signaler
} from './types.js';
export type {
Credentials,
OfferRequest,
Offer,
ServiceRequest,
Service,
IceCandidate
} from './api.js';
export type { Binnable } from './bin.js';