@streamyy/client 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/client.d.ts +6 -6
- package/dist/client.js +3 -3
- package/dist/components/CallControls.d.ts +9 -1
- package/dist/components/CallControls.d.ts.map +1 -1
- package/dist/components/CallControls.js +13 -8
- package/dist/components/CallControls.js.map +1 -1
- package/dist/components/IncomingCallCard.d.ts +7 -3
- package/dist/components/IncomingCallCard.d.ts.map +1 -1
- package/dist/components/IncomingCallCard.js +18 -25
- package/dist/components/IncomingCallCard.js.map +1 -1
- package/dist/components/StreammyCallWidget.d.ts +17 -2
- package/dist/components/StreammyCallWidget.d.ts.map +1 -1
- package/dist/components/StreammyCallWidget.js +220 -119
- package/dist/components/StreammyCallWidget.js.map +1 -1
- package/dist/components/StreamyyCallWidget.d.ts +27 -0
- package/dist/components/StreamyyCallWidget.d.ts.map +1 -0
- package/dist/components/StreamyyCallWidget.js +347 -0
- package/dist/components/StreamyyCallWidget.js.map +1 -0
- package/dist/components/VideoStage.d.ts.map +1 -1
- package/dist/components/VideoStage.js +12 -48
- package/dist/components/VideoStage.js.map +1 -1
- package/dist/components/VideoTile.d.ts +1 -1
- package/dist/components/VideoTile.d.ts.map +1 -1
- package/dist/components/VideoTile.js +18 -14
- package/dist/components/VideoTile.js.map +1 -1
- package/dist/hooks/useRingtone.d.ts +2 -2
- package/dist/hooks/useRingtone.d.ts.map +1 -1
- package/dist/hooks/useRingtone.js +11 -7
- package/dist/hooks/useRingtone.js.map +1 -1
- package/dist/hooks/useStreamyy.d.ts +28 -0
- package/dist/hooks/useStreamyy.d.ts.map +1 -0
- package/dist/hooks/useStreamyy.js +462 -0
- package/dist/hooks/useStreamyy.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/types.d.ts +30 -30
- package/dist/webrtc/peer-session.d.ts +3 -3
- package/dist/webrtc/peer-session.js +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CallSessionRecord, CallType, PresenceRecord } from "@streamyy/core";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
-
export interface
|
|
3
|
+
export interface StreamyyClientOptions {
|
|
4
4
|
url: string;
|
|
5
5
|
token?: string;
|
|
6
6
|
userId: string;
|
|
@@ -14,7 +14,7 @@ export interface StreammyClientOptions {
|
|
|
14
14
|
reconnectionDelayMaxMs?: number;
|
|
15
15
|
connectionTimeoutMs?: number;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface StreamyyIncomingCall {
|
|
18
18
|
callId: string;
|
|
19
19
|
callerId: string;
|
|
20
20
|
receiverId: string;
|
|
@@ -22,14 +22,14 @@ export interface StreammyIncomingCall {
|
|
|
22
22
|
status: CallSessionRecord["status"];
|
|
23
23
|
metadata?: Record<string, unknown>;
|
|
24
24
|
}
|
|
25
|
-
export interface
|
|
25
|
+
export interface StreamyyCallAccepted {
|
|
26
26
|
callId: string;
|
|
27
27
|
acceptedBy: string;
|
|
28
28
|
deviceId?: string;
|
|
29
29
|
startedAt?: Date | string;
|
|
30
30
|
status: CallSessionRecord["status"];
|
|
31
31
|
}
|
|
32
|
-
export interface
|
|
32
|
+
export interface StreamyyCallEnded {
|
|
33
33
|
callId: string;
|
|
34
34
|
endedBy: string;
|
|
35
35
|
deviceId?: string;
|
|
@@ -38,47 +38,47 @@ export interface StreammyCallEnded {
|
|
|
38
38
|
duration?: number;
|
|
39
39
|
reason?: string;
|
|
40
40
|
}
|
|
41
|
-
export interface
|
|
41
|
+
export interface StreamyySimpleCallEvent {
|
|
42
42
|
callId: string;
|
|
43
43
|
deviceId?: string;
|
|
44
44
|
status: CallSessionRecord["status"];
|
|
45
45
|
reason?: string;
|
|
46
46
|
}
|
|
47
|
-
export interface
|
|
47
|
+
export interface StreamyySignalEvent {
|
|
48
48
|
callId: string;
|
|
49
49
|
fromUserId: string;
|
|
50
50
|
payload: Record<string, unknown>;
|
|
51
51
|
}
|
|
52
|
-
export interface
|
|
52
|
+
export interface StreamyyClientEvents {
|
|
53
53
|
connected: void;
|
|
54
54
|
disconnected: void;
|
|
55
55
|
reconnecting: {
|
|
56
56
|
attempt: number;
|
|
57
57
|
};
|
|
58
58
|
reconnected: void;
|
|
59
|
-
incomingCall:
|
|
59
|
+
incomingCall: StreamyyIncomingCall;
|
|
60
60
|
callInitiated: CallSessionRecord;
|
|
61
|
-
callAccepted:
|
|
62
|
-
callDeclined:
|
|
63
|
-
callCancelled:
|
|
64
|
-
callEnded:
|
|
65
|
-
offer:
|
|
66
|
-
answer:
|
|
67
|
-
iceCandidate:
|
|
61
|
+
callAccepted: StreamyyCallAccepted;
|
|
62
|
+
callDeclined: StreamyySimpleCallEvent;
|
|
63
|
+
callCancelled: StreamyySimpleCallEvent;
|
|
64
|
+
callEnded: StreamyyCallEnded;
|
|
65
|
+
offer: StreamyySignalEvent;
|
|
66
|
+
answer: StreamyySignalEvent;
|
|
67
|
+
iceCandidate: StreamyySignalEvent;
|
|
68
68
|
presenceUpdated: PresenceRecord;
|
|
69
69
|
}
|
|
70
70
|
export interface CallControlsState {
|
|
71
71
|
muted: boolean;
|
|
72
72
|
videoEnabled: boolean;
|
|
73
73
|
}
|
|
74
|
-
export type
|
|
75
|
-
export interface
|
|
74
|
+
export type StreamyyCallDirection = "incoming" | "outgoing";
|
|
75
|
+
export interface StreamyyActiveCall {
|
|
76
76
|
callId: string;
|
|
77
77
|
callerId: string;
|
|
78
78
|
receiverId: string;
|
|
79
79
|
callType: CallType;
|
|
80
80
|
status: CallSessionRecord["status"];
|
|
81
|
-
direction:
|
|
81
|
+
direction: StreamyyCallDirection;
|
|
82
82
|
metadata?: Record<string, unknown>;
|
|
83
83
|
}
|
|
84
84
|
export interface TonePatternStep {
|
|
@@ -90,7 +90,7 @@ export interface TonePattern {
|
|
|
90
90
|
steps: TonePatternStep[];
|
|
91
91
|
pauseMs?: number;
|
|
92
92
|
}
|
|
93
|
-
export type
|
|
93
|
+
export type StreamyyRingtoneSource = {
|
|
94
94
|
kind: "url";
|
|
95
95
|
src: string;
|
|
96
96
|
volume?: number;
|
|
@@ -99,11 +99,11 @@ export type StreammyRingtoneSource = {
|
|
|
99
99
|
pattern: TonePattern;
|
|
100
100
|
volume?: number;
|
|
101
101
|
};
|
|
102
|
-
export interface
|
|
103
|
-
incoming?:
|
|
104
|
-
outgoing?:
|
|
102
|
+
export interface StreamyyRingtoneSet {
|
|
103
|
+
incoming?: StreamyyRingtoneSource;
|
|
104
|
+
outgoing?: StreamyyRingtoneSource;
|
|
105
105
|
}
|
|
106
|
-
export interface
|
|
106
|
+
export interface StreamyyCallMediaState {
|
|
107
107
|
localStream: MediaStream | null;
|
|
108
108
|
remoteStream: MediaStream | null;
|
|
109
109
|
muted: boolean;
|
|
@@ -112,25 +112,25 @@ export interface StreammyCallMediaState {
|
|
|
112
112
|
hasLocalVideo: boolean;
|
|
113
113
|
hasRemoteVideo: boolean;
|
|
114
114
|
}
|
|
115
|
-
export interface
|
|
116
|
-
call:
|
|
115
|
+
export interface StreamyyIncomingCallRenderProps {
|
|
116
|
+
call: StreamyyActiveCall;
|
|
117
117
|
connected: boolean;
|
|
118
118
|
reconnecting: boolean;
|
|
119
119
|
accept(): Promise<void>;
|
|
120
120
|
decline(reason?: string): Promise<void>;
|
|
121
121
|
}
|
|
122
|
-
export interface
|
|
123
|
-
activeCall:
|
|
122
|
+
export interface StreamyyCallInterfaceRenderProps {
|
|
123
|
+
activeCall: StreamyyActiveCall;
|
|
124
124
|
callStatus: CallSessionRecord["status"] | "idle";
|
|
125
125
|
connected: boolean;
|
|
126
126
|
reconnecting: boolean;
|
|
127
|
-
media:
|
|
127
|
+
media: StreamyyCallMediaState;
|
|
128
128
|
clear(): void;
|
|
129
129
|
cancel(): Promise<void>;
|
|
130
130
|
end(): Promise<void>;
|
|
131
131
|
toggleMute(nextMuted?: boolean): void;
|
|
132
132
|
toggleVideo(nextEnabled?: boolean): void;
|
|
133
133
|
}
|
|
134
|
-
export type
|
|
135
|
-
export type
|
|
134
|
+
export type StreamyyIncomingCallRenderer = (props: StreamyyIncomingCallRenderProps) => ReactNode;
|
|
135
|
+
export type StreamyyCallInterfaceRenderer = (props: StreamyyCallInterfaceRenderProps) => ReactNode;
|
|
136
136
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StreamyyClient } from "../client.js";
|
|
2
2
|
export interface PeerSessionOptions {
|
|
3
|
-
client:
|
|
3
|
+
client: StreamyyClient;
|
|
4
4
|
callId: string;
|
|
5
5
|
remoteUserId: string;
|
|
6
6
|
rtcConfig?: RTCConfiguration;
|
|
7
7
|
}
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class StreamyyPeerSession {
|
|
9
9
|
private readonly options;
|
|
10
10
|
readonly connection: RTCPeerConnection;
|
|
11
11
|
constructor(options: PeerSessionOptions);
|