farvex 0.1.0 → 0.2.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/CHANGELOG.md +22 -0
- package/README.md +136 -50
- package/dist/core/index.cjs +2912 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +1416 -2
- package/dist/core/index.d.ts +1416 -2
- package/dist/core/index.js +2899 -3
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +2900 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2893 -3
- package/dist/index.js.map +1 -1
- package/dist/livekit/index.cjs +105 -0
- package/dist/livekit/index.cjs.map +1 -0
- package/dist/livekit/index.d.cts +2 -0
- package/dist/livekit/index.d.ts +2 -0
- package/dist/livekit/index.js +4 -0
- package/dist/livekit/index.js.map +1 -0
- package/dist/mock/index.cjs +3267 -0
- package/dist/mock/index.cjs.map +1 -0
- package/dist/mock/index.d.cts +31 -0
- package/dist/mock/index.d.ts +31 -0
- package/dist/mock/index.js +3263 -0
- package/dist/mock/index.js.map +1 -0
- package/dist/react/index.cjs +3315 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +87 -2
- package/dist/react/index.d.ts +87 -2
- package/dist/react/index.js +3297 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +32 -3
package/dist/react/index.d.cts
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CallpadConfig, CallpadClient, ClientStatus, ClientEventMap, Nullable, Session, SessionEventMap, Invite, Recording, Participant, SessionParticipantCapability, Dispatch, PresenceRef, PresenceSnapshot, PresenceMode } from '../core/index.cjs';
|
|
3
|
+
import 'livekit-client';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
interface CallpadProviderProps {
|
|
6
|
+
config: CallpadConfig;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
audioRenderer?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function CallpadProvider({ config, children, audioRenderer, }: CallpadProviderProps): ReactNode;
|
|
11
|
+
|
|
12
|
+
declare function useCallpadClient(): {
|
|
13
|
+
client: CallpadClient;
|
|
14
|
+
status: ClientStatus;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare function useClientEvent<K extends keyof ClientEventMap>(event: K, handler: (payload: ClientEventMap[K]) => void): void;
|
|
18
|
+
|
|
19
|
+
declare function useSessions(): readonly Session[];
|
|
20
|
+
declare function useSession(sessionId?: string): Nullable<Session>;
|
|
21
|
+
|
|
22
|
+
declare function useSessionEvent<K extends keyof SessionEventMap>(event: K, handler: (payload: SessionEventMap[K]) => void, sessionId?: string): void;
|
|
23
|
+
|
|
24
|
+
declare function useIncomingInvites(): readonly Invite[];
|
|
25
|
+
declare function useIncomingInvite(): Nullable<Invite>;
|
|
26
|
+
|
|
27
|
+
interface CallDuration {
|
|
28
|
+
formatted: string;
|
|
29
|
+
elapsedSeconds: number;
|
|
30
|
+
}
|
|
31
|
+
declare function useCallDuration(sessionId?: string): CallDuration;
|
|
32
|
+
|
|
33
|
+
declare function useIsHeld(sessionId?: string): boolean;
|
|
34
|
+
|
|
35
|
+
declare function useActiveRecording(sessionId?: string): Nullable<Recording>;
|
|
36
|
+
|
|
37
|
+
declare function useSessionParticipants(sessionId?: string): readonly Participant[];
|
|
38
|
+
declare function useSessionParticipant(participantId: string, sessionId?: string): Nullable<Participant>;
|
|
39
|
+
declare function useSelfParticipant(sessionId?: string): Nullable<Participant>;
|
|
40
|
+
|
|
41
|
+
declare function useSessionCapabilities(sessionId?: string): ReadonlySet<SessionParticipantCapability>;
|
|
42
|
+
|
|
43
|
+
declare function useSessionDispatches(sessionId?: string): readonly Dispatch[];
|
|
44
|
+
|
|
45
|
+
interface CallControls {
|
|
46
|
+
mic: {
|
|
47
|
+
muted: boolean;
|
|
48
|
+
toggle: () => Promise<void>;
|
|
49
|
+
setMuted: (v: boolean) => Promise<void>;
|
|
50
|
+
};
|
|
51
|
+
camera: {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
toggle: () => Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
screenShare: {
|
|
56
|
+
active: boolean;
|
|
57
|
+
toggle: () => Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
hold: {
|
|
60
|
+
active: boolean;
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
toggle: () => Promise<void>;
|
|
63
|
+
};
|
|
64
|
+
recording: {
|
|
65
|
+
active: boolean;
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
toggle: () => Promise<void>;
|
|
68
|
+
};
|
|
69
|
+
leave: {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
run: () => Promise<void>;
|
|
72
|
+
};
|
|
73
|
+
end: {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
run: () => Promise<void>;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
declare function useCallControls(sessionId?: string): CallControls;
|
|
79
|
+
|
|
80
|
+
declare function usePresence(refs: readonly PresenceRef[]): ReadonlyMap<string, PresenceSnapshot>;
|
|
81
|
+
interface MyPresenceHandle {
|
|
82
|
+
snapshot: Nullable<PresenceSnapshot>;
|
|
83
|
+
setStatus: (mode: PresenceMode, note?: Nullable<string>) => Promise<void>;
|
|
84
|
+
clearStatus: () => Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
declare function useMyPresence(): MyPresenceHandle;
|
|
87
|
+
|
|
88
|
+
export { type CallControls, type CallDuration, CallpadProvider, type CallpadProviderProps, type MyPresenceHandle, useActiveRecording, useCallControls, useCallDuration, useCallpadClient, useClientEvent, useIncomingInvite, useIncomingInvites, useIsHeld, useMyPresence, usePresence, useSelfParticipant, useSession, useSessionCapabilities, useSessionDispatches, useSessionEvent, useSessionParticipant, useSessionParticipants, useSessions };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CallpadConfig, CallpadClient, ClientStatus, ClientEventMap, Nullable, Session, SessionEventMap, Invite, Recording, Participant, SessionParticipantCapability, Dispatch, PresenceRef, PresenceSnapshot, PresenceMode } from '../core/index.js';
|
|
3
|
+
import 'livekit-client';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
interface CallpadProviderProps {
|
|
6
|
+
config: CallpadConfig;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
audioRenderer?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function CallpadProvider({ config, children, audioRenderer, }: CallpadProviderProps): ReactNode;
|
|
11
|
+
|
|
12
|
+
declare function useCallpadClient(): {
|
|
13
|
+
client: CallpadClient;
|
|
14
|
+
status: ClientStatus;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
declare function useClientEvent<K extends keyof ClientEventMap>(event: K, handler: (payload: ClientEventMap[K]) => void): void;
|
|
18
|
+
|
|
19
|
+
declare function useSessions(): readonly Session[];
|
|
20
|
+
declare function useSession(sessionId?: string): Nullable<Session>;
|
|
21
|
+
|
|
22
|
+
declare function useSessionEvent<K extends keyof SessionEventMap>(event: K, handler: (payload: SessionEventMap[K]) => void, sessionId?: string): void;
|
|
23
|
+
|
|
24
|
+
declare function useIncomingInvites(): readonly Invite[];
|
|
25
|
+
declare function useIncomingInvite(): Nullable<Invite>;
|
|
26
|
+
|
|
27
|
+
interface CallDuration {
|
|
28
|
+
formatted: string;
|
|
29
|
+
elapsedSeconds: number;
|
|
30
|
+
}
|
|
31
|
+
declare function useCallDuration(sessionId?: string): CallDuration;
|
|
32
|
+
|
|
33
|
+
declare function useIsHeld(sessionId?: string): boolean;
|
|
34
|
+
|
|
35
|
+
declare function useActiveRecording(sessionId?: string): Nullable<Recording>;
|
|
36
|
+
|
|
37
|
+
declare function useSessionParticipants(sessionId?: string): readonly Participant[];
|
|
38
|
+
declare function useSessionParticipant(participantId: string, sessionId?: string): Nullable<Participant>;
|
|
39
|
+
declare function useSelfParticipant(sessionId?: string): Nullable<Participant>;
|
|
40
|
+
|
|
41
|
+
declare function useSessionCapabilities(sessionId?: string): ReadonlySet<SessionParticipantCapability>;
|
|
42
|
+
|
|
43
|
+
declare function useSessionDispatches(sessionId?: string): readonly Dispatch[];
|
|
44
|
+
|
|
45
|
+
interface CallControls {
|
|
46
|
+
mic: {
|
|
47
|
+
muted: boolean;
|
|
48
|
+
toggle: () => Promise<void>;
|
|
49
|
+
setMuted: (v: boolean) => Promise<void>;
|
|
50
|
+
};
|
|
51
|
+
camera: {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
toggle: () => Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
screenShare: {
|
|
56
|
+
active: boolean;
|
|
57
|
+
toggle: () => Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
hold: {
|
|
60
|
+
active: boolean;
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
toggle: () => Promise<void>;
|
|
63
|
+
};
|
|
64
|
+
recording: {
|
|
65
|
+
active: boolean;
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
toggle: () => Promise<void>;
|
|
68
|
+
};
|
|
69
|
+
leave: {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
run: () => Promise<void>;
|
|
72
|
+
};
|
|
73
|
+
end: {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
run: () => Promise<void>;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
declare function useCallControls(sessionId?: string): CallControls;
|
|
79
|
+
|
|
80
|
+
declare function usePresence(refs: readonly PresenceRef[]): ReadonlyMap<string, PresenceSnapshot>;
|
|
81
|
+
interface MyPresenceHandle {
|
|
82
|
+
snapshot: Nullable<PresenceSnapshot>;
|
|
83
|
+
setStatus: (mode: PresenceMode, note?: Nullable<string>) => Promise<void>;
|
|
84
|
+
clearStatus: () => Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
declare function useMyPresence(): MyPresenceHandle;
|
|
87
|
+
|
|
88
|
+
export { type CallControls, type CallDuration, CallpadProvider, type CallpadProviderProps, type MyPresenceHandle, useActiveRecording, useCallControls, useCallDuration, useCallpadClient, useClientEvent, useIncomingInvite, useIncomingInvites, useIsHeld, useMyPresence, usePresence, useSelfParticipant, useSession, useSessionCapabilities, useSessionDispatches, useSessionEvent, useSessionParticipant, useSessionParticipants, useSessions };
|