mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-15 21:33:23 +00:00
feat: update client to use service-based signaling endpoints
BREAKING CHANGE: Client API now uses service UUIDs for WebRTC signaling - Replace answerOffer() with answerService() - Replace getAnswer() with getServiceAnswer() - Replace addIceCandidates() with addServiceIceCandidates() - Replace getIceCandidates() with getServiceIceCandidates() - Update RondevuSignaler to use service UUID instead of offer ID for signaling - Automatically track offerId returned from service endpoints - Bump version to 0.12.0 Matches server v0.4.0 service-based API refactor.
This commit is contained in:
10
src/types.ts
10
src/types.ts
@@ -15,14 +15,16 @@ export interface ConnectionEvents {
|
||||
message: Message
|
||||
}
|
||||
|
||||
export const ConnectionStates = ['connected', 'disconnected', 'connecting'] as const
|
||||
export const ConnectionStates = [
|
||||
'connected',
|
||||
'disconnected',
|
||||
'connecting'
|
||||
] as const
|
||||
|
||||
export const isConnectionState = (state: string): state is (typeof ConnectionStates)[number] =>
|
||||
ConnectionStates.includes(state as any)
|
||||
|
||||
export interface ConnectionInterface {
|
||||
id: string
|
||||
service: string
|
||||
state: (typeof ConnectionStates)[number]
|
||||
lastActive: number
|
||||
expiresAt?: number
|
||||
@@ -33,7 +35,7 @@ export interface ConnectionInterface {
|
||||
}
|
||||
|
||||
export interface Signaler {
|
||||
addIceCandidate(candidate: RTCIceCandidate): Promise<void> | void
|
||||
addIceCandidate(candidate: RTCIceCandidate): Promise<void>
|
||||
addListener(callback: (candidate: RTCIceCandidate) => void): Binnable
|
||||
addOfferListener(callback: (offer: RTCSessionDescriptionInit) => void): Binnable
|
||||
addAnswerListener(callback: (answer: RTCSessionDescriptionInit) => void): Binnable
|
||||
|
||||
Reference in New Issue
Block a user