@100mslive/react-native-hms 1.9.8 → 1.9.10
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 +5 -4
- package/android/local.properties +8 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +2 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +98 -4
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +14 -7
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityDecoder.kt +328 -0
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityHelper.kt +352 -0
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSRNInteractivityCenter.kt +184 -0
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSDecoder.swift +3 -1
- package/ios/HMSInteractivityDecoder.swift +223 -0
- package/ios/HMSInteractivityHelper.swift +169 -0
- package/ios/HMSManager.m +17 -0
- package/ios/HMSManager.swift +30 -1
- package/ios/HMSRNInteractivityCenter.swift +89 -0
- package/ios/HMSRNSDK.swift +10 -4
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/classes/HMSInteractivityCenter.js +93 -0
- package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -0
- package/lib/commonjs/classes/HMSInteractivityEncoder.js +33 -0
- package/lib/commonjs/classes/HMSInteractivityEncoder.js.map +1 -0
- package/lib/commonjs/classes/HMSPermissions.js +4 -0
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/HMSPollsListenerActions.js +11 -0
- package/lib/commonjs/classes/HMSPollsListenerActions.js.map +1 -0
- package/lib/commonjs/classes/HMSSDK.js +8 -0
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/polls/HMSPoll.js +6 -0
- package/lib/commonjs/classes/polls/HMSPoll.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollCategory.js +12 -0
- package/lib/commonjs/classes/polls/HMSPollCategory.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestion.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestion.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionAnswer.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionAnswer.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOption.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOption.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOptionCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOptionCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionQuizOptionCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionQuizOptionCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponse.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponse.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseResult.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseResult.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResult.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResult.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionType.js +14 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionType.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollResponsePeerInfo.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollResponsePeerInfo.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollResult.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollResult.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollState.js +13 -0
- package/lib/commonjs/classes/polls/HMSPollState.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollType.js +12 -0
- package/lib/commonjs/classes/polls/HMSPollType.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollUpdateType.js +13 -0
- package/lib/commonjs/classes/polls/HMSPollUpdateType.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollUserTrackingMode.js +13 -0
- package/lib/commonjs/classes/polls/HMSPollUserTrackingMode.js.map +1 -0
- package/lib/commonjs/hooks/polls.js +17 -0
- package/lib/commonjs/hooks/polls.js.map +1 -0
- package/lib/commonjs/index.js +68 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hms-interactivity-store.js +21 -0
- package/lib/commonjs/stores/hms-interactivity-store.js.map +1 -0
- package/lib/commonjs/stores/hms-polls-slice.js +19 -0
- package/lib/commonjs/stores/hms-polls-slice.js.map +1 -0
- package/lib/commonjs/stores/types.js.map +1 -1
- package/lib/commonjs/utils/emitter/EventEmitter.js +19 -0
- package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -1
- package/lib/commonjs/utils/windowController.js +30 -0
- package/lib/commonjs/utils/windowController.js.map +1 -0
- package/lib/module/classes/HMSInteractivityCenter.js +85 -0
- package/lib/module/classes/HMSInteractivityCenter.js.map +1 -0
- package/lib/module/classes/HMSInteractivityEncoder.js +26 -0
- package/lib/module/classes/HMSInteractivityEncoder.js.map +1 -0
- package/lib/module/classes/HMSPermissions.js +4 -0
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/HMSPollsListenerActions.js +5 -0
- package/lib/module/classes/HMSPollsListenerActions.js.map +1 -0
- package/lib/module/classes/HMSSDK.js +8 -0
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/polls/HMSPoll.js +2 -0
- package/lib/module/classes/polls/HMSPoll.js.map +1 -0
- package/lib/module/classes/polls/HMSPollCategory.js +6 -0
- package/lib/module/classes/polls/HMSPollCategory.js.map +1 -0
- package/lib/module/classes/polls/HMSPollCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestion.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestion.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionAnswer.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionAnswer.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionOption.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionOption.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionOptionCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionOptionCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionQuizOptionCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionQuizOptionCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResponse.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResponse.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseResult.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseResult.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResult.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResult.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionType.js +8 -0
- package/lib/module/classes/polls/HMSPollQuestionType.js.map +1 -0
- package/lib/module/classes/polls/HMSPollResponsePeerInfo.js +2 -0
- package/lib/module/classes/polls/HMSPollResponsePeerInfo.js.map +1 -0
- package/lib/module/classes/polls/HMSPollResult.js +2 -0
- package/lib/module/classes/polls/HMSPollResult.js.map +1 -0
- package/lib/module/classes/polls/HMSPollState.js +7 -0
- package/lib/module/classes/polls/HMSPollState.js.map +1 -0
- package/lib/module/classes/polls/HMSPollType.js +6 -0
- package/lib/module/classes/polls/HMSPollType.js.map +1 -0
- package/lib/module/classes/polls/HMSPollUpdateType.js +7 -0
- package/lib/module/classes/polls/HMSPollUpdateType.js.map +1 -0
- package/lib/module/classes/polls/HMSPollUserTrackingMode.js +7 -0
- package/lib/module/classes/polls/HMSPollUserTrackingMode.js.map +1 -0
- package/lib/module/hooks/polls.js +12 -0
- package/lib/module/hooks/polls.js.map +1 -0
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/hms-interactivity-store.js +15 -0
- package/lib/module/stores/hms-interactivity-store.js.map +1 -0
- package/lib/module/stores/hms-polls-slice.js +12 -0
- package/lib/module/stores/hms-polls-slice.js.map +1 -0
- package/lib/module/stores/types.js.map +1 -1
- package/lib/module/utils/emitter/EventEmitter.js +19 -0
- package/lib/module/utils/emitter/EventEmitter.js.map +1 -1
- package/lib/module/utils/windowController.js +22 -0
- package/lib/module/utils/windowController.js.map +1 -0
- package/lib/typescript/classes/HMSInteractivityCenter.d.ts +35 -0
- package/lib/typescript/classes/HMSInteractivityEncoder.d.ts +4 -0
- package/lib/typescript/classes/HMSPermissions.d.ts +4 -0
- package/lib/typescript/classes/HMSPollsListenerActions.d.ts +3 -0
- package/lib/typescript/classes/HMSSDK.d.ts +3 -0
- package/lib/typescript/classes/polls/HMSPoll.d.ts +81 -0
- package/lib/typescript/classes/polls/HMSPollCategory.d.ts +10 -0
- package/lib/typescript/classes/polls/HMSPollCreateParams.d.ts +6 -0
- package/lib/typescript/classes/polls/HMSPollQuestion.d.ts +61 -0
- package/lib/typescript/classes/polls/HMSPollQuestionAnswer.d.ts +17 -0
- package/lib/typescript/classes/polls/HMSPollQuestionCreateParams.d.ts +25 -0
- package/lib/typescript/classes/polls/HMSPollQuestionOption.d.ts +21 -0
- package/lib/typescript/classes/polls/HMSPollQuestionOptionCreateParams.d.ts +3 -0
- package/lib/typescript/classes/polls/HMSPollQuestionQuizOptionCreateParams.d.ts +4 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResponse.d.ts +47 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResponseCreateParams.d.ts +2 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResponseResult.d.ts +17 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResult.d.ts +29 -0
- package/lib/typescript/classes/polls/HMSPollQuestionType.d.ts +18 -0
- package/lib/typescript/classes/polls/HMSPollResponsePeerInfo.d.ts +21 -0
- package/lib/typescript/classes/polls/HMSPollResult.d.ts +22 -0
- package/lib/typescript/classes/polls/HMSPollState.d.ts +14 -0
- package/lib/typescript/classes/polls/HMSPollType.d.ts +4 -0
- package/lib/typescript/classes/polls/HMSPollUpdateType.d.ts +5 -0
- package/lib/typescript/classes/polls/HMSPollUserTrackingMode.d.ts +14 -0
- package/lib/typescript/hooks/polls.d.ts +3 -0
- package/lib/typescript/index.d.ts +9 -0
- package/lib/typescript/stores/hms-interactivity-store.d.ts +9 -0
- package/lib/typescript/stores/hms-polls-slice.d.ts +5 -0
- package/lib/typescript/stores/types.d.ts +6 -0
- package/lib/typescript/utils/emitter/EventEmitter.d.ts +7 -0
- package/lib/typescript/utils/windowController.d.ts +10 -0
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSInteractivityCenter.ts +126 -0
- package/src/classes/HMSInteractivityEncoder.ts +29 -0
- package/src/classes/HMSPermissions.ts +6 -0
- package/src/classes/HMSPollsListenerActions.ts +3 -0
- package/src/classes/HMSSDK.tsx +10 -0
- package/src/classes/polls/HMSPoll.ts +108 -0
- package/src/classes/polls/HMSPollCategory.ts +11 -0
- package/src/classes/polls/HMSPollCreateParams.ts +19 -0
- package/src/classes/polls/HMSPollQuestion.ts +92 -0
- package/src/classes/polls/HMSPollQuestionAnswer.ts +29 -0
- package/src/classes/polls/HMSPollQuestionCreateParams.ts +36 -0
- package/src/classes/polls/HMSPollQuestionOption.ts +24 -0
- package/src/classes/polls/HMSPollQuestionOptionCreateParams.ts +8 -0
- package/src/classes/polls/HMSPollQuestionQuizOptionCreateParams.ts +6 -0
- package/src/classes/polls/HMSPollQuestionResponse.ts +72 -0
- package/src/classes/polls/HMSPollQuestionResponseCreateParams.ts +6 -0
- package/src/classes/polls/HMSPollQuestionResponseResult.ts +19 -0
- package/src/classes/polls/HMSPollQuestionResult.ts +41 -0
- package/src/classes/polls/HMSPollQuestionType.ts +21 -0
- package/src/classes/polls/HMSPollResponsePeerInfo.ts +24 -0
- package/src/classes/polls/HMSPollResult.ts +26 -0
- package/src/classes/polls/HMSPollState.ts +16 -0
- package/src/classes/polls/HMSPollType.ts +4 -0
- package/src/classes/polls/HMSPollUpdateType.ts +5 -0
- package/src/classes/polls/HMSPollUserTrackingMode.ts +16 -0
- package/src/hooks/polls.ts +14 -0
- package/src/index.ts +10 -0
- package/src/stores/hms-interactivity-store.ts +18 -0
- package/src/stores/hms-polls-slice.ts +20 -0
- package/src/stores/types.ts +20 -3
- package/src/utils/emitter/EventEmitter.ts +26 -0
- package/src/utils/windowController.ts +23 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { HMSPollState } from './HMSPollState';
|
|
2
|
+
import type { HMSPollQuestion } from './HMSPollQuestion';
|
|
3
|
+
import type { HMSPollResult } from './HMSPollResult';
|
|
4
|
+
import type { HMSRole } from '../HMSRole';
|
|
5
|
+
import type { HMSPollUserTrackingMode } from './HMSPollUserTrackingMode';
|
|
6
|
+
import type { HMSPollType } from './HMSPollType';
|
|
7
|
+
import type { HMSPeer } from '../HMSPeer';
|
|
8
|
+
type HMSPeerSubset = {
|
|
9
|
+
peerID: HMSPeer['peerID'];
|
|
10
|
+
name: HMSPeer['name'];
|
|
11
|
+
};
|
|
12
|
+
type HMSRoleSubset = {
|
|
13
|
+
name: HMSRole['name'];
|
|
14
|
+
};
|
|
15
|
+
export interface HMSPoll {
|
|
16
|
+
/**
|
|
17
|
+
The unique identifier of the poll.
|
|
18
|
+
*/
|
|
19
|
+
pollId: string;
|
|
20
|
+
/**
|
|
21
|
+
The title of the poll.
|
|
22
|
+
*/
|
|
23
|
+
title: string;
|
|
24
|
+
/**
|
|
25
|
+
The duration of the poll in seconds.
|
|
26
|
+
*/
|
|
27
|
+
duration?: number;
|
|
28
|
+
/**
|
|
29
|
+
A flag indicating whether the poll is anonymous or not.
|
|
30
|
+
*/
|
|
31
|
+
anonymous?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
The tracking mode for user participation in the poll.
|
|
34
|
+
*/
|
|
35
|
+
mode?: HMSPollUserTrackingMode;
|
|
36
|
+
/**
|
|
37
|
+
The roles that can vote in the poll.
|
|
38
|
+
*/
|
|
39
|
+
rolesThatCanVote?: HMSRoleSubset[];
|
|
40
|
+
/**
|
|
41
|
+
The roles that can view the poll responses.
|
|
42
|
+
*/
|
|
43
|
+
rolesThatCanViewResponses?: HMSRoleSubset[];
|
|
44
|
+
/**
|
|
45
|
+
The peer who started the poll.
|
|
46
|
+
*/
|
|
47
|
+
startedBy?: HMSPeerSubset;
|
|
48
|
+
/**
|
|
49
|
+
The peer who stopped the poll.
|
|
50
|
+
*/
|
|
51
|
+
stoppedBy?: HMSPeerSubset;
|
|
52
|
+
/**
|
|
53
|
+
The peer who created the poll.
|
|
54
|
+
*/
|
|
55
|
+
createdBy?: HMSPeerSubset;
|
|
56
|
+
/**
|
|
57
|
+
The date and time when the poll was started.
|
|
58
|
+
*/
|
|
59
|
+
startedAt?: Date;
|
|
60
|
+
/**
|
|
61
|
+
The date and time when the poll was stopped.
|
|
62
|
+
*/
|
|
63
|
+
stoppedAt?: Date;
|
|
64
|
+
/**
|
|
65
|
+
The type of the poll.
|
|
66
|
+
*/
|
|
67
|
+
type: HMSPollType;
|
|
68
|
+
/**
|
|
69
|
+
The current state of the poll.
|
|
70
|
+
*/
|
|
71
|
+
state?: HMSPollState;
|
|
72
|
+
/**
|
|
73
|
+
The list of questions in the poll.
|
|
74
|
+
*/
|
|
75
|
+
questions?: HMSPollQuestion[];
|
|
76
|
+
/**
|
|
77
|
+
The result of the poll.
|
|
78
|
+
*/
|
|
79
|
+
result?: HMSPollResult;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HMSPoll } from './HMSPoll';
|
|
2
|
+
import type { HMSPollQuestionCreateParams } from './HMSPollQuestionCreateParams';
|
|
3
|
+
export interface HMSPollCreateParams extends Pick<HMSPoll, 'title' | 'type' | 'duration' | 'anonymous' | 'mode' | 'rolesThatCanVote' | 'rolesThatCanViewResponses'> {
|
|
4
|
+
pollId?: HMSPoll['pollId'];
|
|
5
|
+
questions?: HMSPollQuestionCreateParams[];
|
|
6
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { HMSPollQuestionAnswer } from './HMSPollQuestionAnswer';
|
|
2
|
+
import type { HMSPollQuestionOption } from './HMSPollQuestionOption';
|
|
3
|
+
import type { HMSPollQuestionResponse } from './HMSPollQuestionResponse';
|
|
4
|
+
import type { HMSPollQuestionType } from './HMSPollQuestionType';
|
|
5
|
+
/**
|
|
6
|
+
Represents a question in a poll.
|
|
7
|
+
*/
|
|
8
|
+
export interface HMSPollQuestion {
|
|
9
|
+
/**
|
|
10
|
+
The index of the question within the poll.
|
|
11
|
+
*/
|
|
12
|
+
index: number;
|
|
13
|
+
/**
|
|
14
|
+
The text of the question.
|
|
15
|
+
*/
|
|
16
|
+
text: string;
|
|
17
|
+
/**
|
|
18
|
+
A flag indicating whether the question is skippable or not.
|
|
19
|
+
*/
|
|
20
|
+
skippable: boolean;
|
|
21
|
+
/**
|
|
22
|
+
The duration hint of the question in seconds. Can be used for setting a timeframe withing which a question can be responded to. Not enforced by the server.
|
|
23
|
+
*/
|
|
24
|
+
duration: number;
|
|
25
|
+
/**
|
|
26
|
+
A flag indicating whether the question can be answered only once.
|
|
27
|
+
*/
|
|
28
|
+
once: boolean;
|
|
29
|
+
/**
|
|
30
|
+
The weight of the question in scoring.
|
|
31
|
+
*/
|
|
32
|
+
weight: number;
|
|
33
|
+
/**
|
|
34
|
+
The minimum length of the answer (if applicable).
|
|
35
|
+
*/
|
|
36
|
+
answerMinLen?: number;
|
|
37
|
+
/**
|
|
38
|
+
The maximum length of the answer (if applicable).
|
|
39
|
+
*/
|
|
40
|
+
answerMaxLen?: number;
|
|
41
|
+
/**
|
|
42
|
+
The type of the question.
|
|
43
|
+
*/
|
|
44
|
+
type: HMSPollQuestionType;
|
|
45
|
+
/**
|
|
46
|
+
The list of options for the question (if applicable).
|
|
47
|
+
*/
|
|
48
|
+
options?: HMSPollQuestionOption[];
|
|
49
|
+
/**
|
|
50
|
+
The answer for the question (if it is a quiz).
|
|
51
|
+
*/
|
|
52
|
+
answer?: HMSPollQuestionAnswer;
|
|
53
|
+
/**
|
|
54
|
+
The list of responses for the question.
|
|
55
|
+
*/
|
|
56
|
+
responses?: HMSPollQuestionResponse[];
|
|
57
|
+
/**
|
|
58
|
+
The responses provided by the current user for the question.
|
|
59
|
+
*/
|
|
60
|
+
myResponses: HMSPollQuestionResponse[];
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Provides the correct answer for a quiz question to check users' responses against.
|
|
3
|
+
*/
|
|
4
|
+
export interface HMSPollQuestionAnswer {
|
|
5
|
+
/**
|
|
6
|
+
A flag indicating whether the answer should be hidden or not.
|
|
7
|
+
*/
|
|
8
|
+
hidden: boolean;
|
|
9
|
+
/**
|
|
10
|
+
The index of the selected option (in case of single choice question).
|
|
11
|
+
*/
|
|
12
|
+
option?: number;
|
|
13
|
+
/**
|
|
14
|
+
The list of indexes of selected options (in case of multiple choice question).
|
|
15
|
+
*/
|
|
16
|
+
options?: number[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HMSPollQuestion } from './HMSPollQuestion';
|
|
2
|
+
import type { HMSPollQuestionOptionCreateParams } from './HMSPollQuestionOptionCreateParams';
|
|
3
|
+
import type { HMSPollQuestionQuizOptionCreateParams } from './HMSPollQuestionQuizOptionCreateParams';
|
|
4
|
+
export interface HMSPollQuestionCreateParams extends Pick<HMSPollQuestion, 'text' | 'skippable' | 'type' | 'answerMinLen' | 'answerMaxLen'> {
|
|
5
|
+
/**
|
|
6
|
+
* A flag indicating whether the question can be answered only once.
|
|
7
|
+
*/
|
|
8
|
+
once?: HMSPollQuestion['once'];
|
|
9
|
+
/**
|
|
10
|
+
* The duration hint of the question in seconds. Can be used for setting a timeframe withing which a question can be responded to. Not enforced by the server.
|
|
11
|
+
*/
|
|
12
|
+
duration?: HMSPollQuestion['duration'];
|
|
13
|
+
/**
|
|
14
|
+
* The index of the question within the poll.
|
|
15
|
+
*/
|
|
16
|
+
index?: HMSPollQuestion['index'];
|
|
17
|
+
/**
|
|
18
|
+
* The options of the question.
|
|
19
|
+
*/
|
|
20
|
+
options?: HMSPollQuestionOptionCreateParams[] | HMSPollQuestionQuizOptionCreateParams[];
|
|
21
|
+
/**
|
|
22
|
+
* The weight of the question in scoring.
|
|
23
|
+
*/
|
|
24
|
+
weight?: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Represents an option for a poll question.
|
|
3
|
+
*/
|
|
4
|
+
export interface HMSPollQuestionOption {
|
|
5
|
+
/**
|
|
6
|
+
The index of the option within the question.
|
|
7
|
+
*/
|
|
8
|
+
index: number;
|
|
9
|
+
/**
|
|
10
|
+
The text of the option.
|
|
11
|
+
*/
|
|
12
|
+
text: string;
|
|
13
|
+
/**
|
|
14
|
+
The weight of the option in scoring.
|
|
15
|
+
*/
|
|
16
|
+
weight: number;
|
|
17
|
+
/**
|
|
18
|
+
The count of votes received for the option. `0` is the default value.
|
|
19
|
+
*/
|
|
20
|
+
voteCount: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { HMSPollQuestionType } from './HMSPollQuestionType';
|
|
2
|
+
import type { HMSPollResponsePeerInfo } from './HMSPollResponsePeerInfo';
|
|
3
|
+
/**
|
|
4
|
+
Represents a response for a poll question.
|
|
5
|
+
*/
|
|
6
|
+
export interface HMSPollQuestionResponse {
|
|
7
|
+
/**
|
|
8
|
+
The ID of the question associated with the response.
|
|
9
|
+
*/
|
|
10
|
+
questionID: number;
|
|
11
|
+
/**
|
|
12
|
+
The type of the question associated with the response.
|
|
13
|
+
*/
|
|
14
|
+
type: HMSPollQuestionType;
|
|
15
|
+
/**
|
|
16
|
+
A flag indicating whether the question was skipped or not.
|
|
17
|
+
*/
|
|
18
|
+
skipped: boolean;
|
|
19
|
+
/**
|
|
20
|
+
The index of the selected option (in case of single choice question).
|
|
21
|
+
*/
|
|
22
|
+
option: number;
|
|
23
|
+
/**
|
|
24
|
+
The list of indexes of selected options (in case of multiple choice question).
|
|
25
|
+
*/
|
|
26
|
+
options?: number[];
|
|
27
|
+
/**
|
|
28
|
+
The text answer provided (in case of short/long answer question).
|
|
29
|
+
*/
|
|
30
|
+
text: string;
|
|
31
|
+
/**
|
|
32
|
+
A flag indicating whether the response was updated from previous response.
|
|
33
|
+
*/
|
|
34
|
+
update: boolean;
|
|
35
|
+
/**
|
|
36
|
+
Time taken to respond.
|
|
37
|
+
*/
|
|
38
|
+
duration: number;
|
|
39
|
+
/**
|
|
40
|
+
The peer information associated with the response. Depends on the tracking type selected for poll.
|
|
41
|
+
*/
|
|
42
|
+
peer?: HMSPollResponsePeerInfo;
|
|
43
|
+
/**
|
|
44
|
+
A flag indicating whether the response is final in case multiple responses were sent for this question.
|
|
45
|
+
*/
|
|
46
|
+
responseFinal?: boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the result of a poll question response.
|
|
3
|
+
*/
|
|
4
|
+
export interface HMSPollQuestionResponse {
|
|
5
|
+
/**
|
|
6
|
+
* The ID of the question associated with the response result.
|
|
7
|
+
*/
|
|
8
|
+
question: number;
|
|
9
|
+
/**
|
|
10
|
+
* A flag indicating whether the response was correct or not in case of quiz.
|
|
11
|
+
*/
|
|
12
|
+
correct?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* An error associated with the response result (if any).
|
|
15
|
+
*/
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Represents the result of a poll question within a poll result.
|
|
3
|
+
*/
|
|
4
|
+
export interface HMSPollQuestionResult {
|
|
5
|
+
/**
|
|
6
|
+
The ID of the question associated with the result.
|
|
7
|
+
*/
|
|
8
|
+
question: number;
|
|
9
|
+
/**
|
|
10
|
+
The type of the question associated with the result.
|
|
11
|
+
*/
|
|
12
|
+
type: string;
|
|
13
|
+
/**
|
|
14
|
+
The vote counts for each option of the question.
|
|
15
|
+
*/
|
|
16
|
+
optionVoteCounts: number[];
|
|
17
|
+
/**
|
|
18
|
+
The number of correct votes for the question.
|
|
19
|
+
*/
|
|
20
|
+
correctVotes: number;
|
|
21
|
+
/**
|
|
22
|
+
The number of skipped votes for the question.
|
|
23
|
+
*/
|
|
24
|
+
skippedVotes: number;
|
|
25
|
+
/**
|
|
26
|
+
The total number of votes received for the question.
|
|
27
|
+
*/
|
|
28
|
+
totalVotes: number;
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum HMSPollQuestionType {
|
|
2
|
+
/**
|
|
3
|
+
The question allows for a single choice answer.
|
|
4
|
+
*/
|
|
5
|
+
singleChoice = 0,
|
|
6
|
+
/**
|
|
7
|
+
The question allows for multiple choice answers.
|
|
8
|
+
*/
|
|
9
|
+
multipleChoice = 1,
|
|
10
|
+
/**
|
|
11
|
+
The question expects a short text answer.
|
|
12
|
+
*/
|
|
13
|
+
shortAnswer = 2,
|
|
14
|
+
/**
|
|
15
|
+
The question expects a long text answer.
|
|
16
|
+
*/
|
|
17
|
+
longAnswer = 3
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Represents the peer information associated with a poll response. The properties are filled according to HMSPollUserTrackingMode selected for the poll.
|
|
3
|
+
*/
|
|
4
|
+
export interface HMSPollResponsePeerInfo {
|
|
5
|
+
/**
|
|
6
|
+
The user hash associated with the peer.
|
|
7
|
+
*/
|
|
8
|
+
userHash?: string;
|
|
9
|
+
/**
|
|
10
|
+
The peer ID associated with the response.
|
|
11
|
+
*/
|
|
12
|
+
peerId?: string;
|
|
13
|
+
/**
|
|
14
|
+
The user ID associated with the peer.
|
|
15
|
+
*/
|
|
16
|
+
customerUserId?: string;
|
|
17
|
+
/**
|
|
18
|
+
The username associated with the peer.
|
|
19
|
+
*/
|
|
20
|
+
userName?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HMSPollQuestionResult } from './HMSPollQuestionResult';
|
|
2
|
+
/**
|
|
3
|
+
Represents the result of a poll.
|
|
4
|
+
*/
|
|
5
|
+
export interface HMSPollResult {
|
|
6
|
+
/**
|
|
7
|
+
The total number of responses received for the poll.
|
|
8
|
+
*/
|
|
9
|
+
totalResponse: number;
|
|
10
|
+
/**
|
|
11
|
+
The number of unique users who responded to the poll.
|
|
12
|
+
*/
|
|
13
|
+
userCount: number;
|
|
14
|
+
/**
|
|
15
|
+
The maximum number of users in the room during the poll.
|
|
16
|
+
*/
|
|
17
|
+
maxUserCount: number;
|
|
18
|
+
/**
|
|
19
|
+
The list of question results for the poll.
|
|
20
|
+
*/
|
|
21
|
+
questions: HMSPollQuestionResult[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum HMSPollState {
|
|
2
|
+
/**
|
|
3
|
+
The poll is created but not started yet.
|
|
4
|
+
*/
|
|
5
|
+
created = 0,
|
|
6
|
+
/**
|
|
7
|
+
The poll has started and is currently active.
|
|
8
|
+
*/
|
|
9
|
+
started = 1,
|
|
10
|
+
/**
|
|
11
|
+
The poll has been stopped and is no longer active.
|
|
12
|
+
*/
|
|
13
|
+
stopped = 2
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum HMSPollUserTrackingMode {
|
|
2
|
+
/**
|
|
3
|
+
User tracking is based on the peer ID.
|
|
4
|
+
*/
|
|
5
|
+
peerID = 0,
|
|
6
|
+
/**
|
|
7
|
+
User tracking is based on the customer ID.
|
|
8
|
+
*/
|
|
9
|
+
customerUserID = 1,
|
|
10
|
+
/**
|
|
11
|
+
User tracking is based on the username.
|
|
12
|
+
*/
|
|
13
|
+
userName = 2
|
|
14
|
+
}
|
|
@@ -86,6 +86,14 @@ export type { HMSSessionStore, JsonArray, JsonMap, JsonPrimitive, JsonValue, } f
|
|
|
86
86
|
export type { HmsViewComponent as HMSView, HmsComponentProps as HMSViewProps, } from './classes/HmsView';
|
|
87
87
|
export type { HMSPIPConfig } from './classes/HMSPIPConfig';
|
|
88
88
|
export { HMSRecordingState } from './classes/HMSRecordingState';
|
|
89
|
+
export type { HMSPoll } from './classes/polls/HMSPoll';
|
|
90
|
+
export { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';
|
|
91
|
+
export { HMSPollType } from './classes/polls/HMSPollType';
|
|
92
|
+
export { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';
|
|
93
|
+
export { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';
|
|
94
|
+
export { HMSPollState } from './classes/polls/HMSPollState';
|
|
95
|
+
export { HMSPollQuestion } from './classes/polls/HMSPollQuestion';
|
|
96
|
+
export { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';
|
|
89
97
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
90
98
|
export { default as HMSManagerModule } from './modules/HMSManagerModule';
|
|
91
99
|
export * from './components/HMSHLSPlayer';
|
|
@@ -93,6 +101,7 @@ export * from './hooks/useHMSPeerUpdates';
|
|
|
93
101
|
export { useHmsViewsResolutionsState } from './hooks/hmsviews';
|
|
94
102
|
export type { NotificationResult } from './utils/notification';
|
|
95
103
|
export { checkNotifications } from './utils/notification';
|
|
104
|
+
export * from './utils/windowController';
|
|
96
105
|
export * from './utils/keyboard';
|
|
97
106
|
export * from './types';
|
|
98
107
|
export * from './stores/types';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const useHMSInteractivityStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<import("./types").HMSPollsSlice>, "subscribe"> & {
|
|
2
|
+
subscribe: {
|
|
3
|
+
(listener: (selectedState: import("./types").HMSPollsSlice, previousSelectedState: import("./types").HMSPollsSlice) => void): () => void;
|
|
4
|
+
<U>(selector: (state: import("./types").HMSPollsSlice) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
5
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
6
|
+
fireImmediately?: boolean | undefined;
|
|
7
|
+
} | undefined): () => void;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { HMSPoll } from '../classes/polls/HMSPoll';
|
|
1
2
|
import type { HMSHLSPlayerPlaybackState, HMSHLSPlayerPlaybackCueEventData, HMSHLSPlayerPlaybackFailureEventData, HMSHLSPlayerPlaybackResolutionChangeEventData, HMSHLSPlayerStatsErrorEventData, HMSHLSPlayerStatsUpdateEventData } from '../types';
|
|
2
3
|
export type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;
|
|
3
4
|
export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;
|
|
5
|
+
export type HMSInteractivityStore = HMSPollsSlice;
|
|
4
6
|
export type TrackId = string;
|
|
5
7
|
export type Resolution = {
|
|
6
8
|
width: number;
|
|
@@ -35,3 +37,7 @@ export interface HMSHLSPlayerStatsSlice {
|
|
|
35
37
|
changeStats(stats: HMSHLSPlayerStats): void;
|
|
36
38
|
setError(error: HMSHLSPlayerStatsError): void;
|
|
37
39
|
}
|
|
40
|
+
export type HMSPollsSlice = {
|
|
41
|
+
polls: Record<string, HMSPoll>;
|
|
42
|
+
setPolls(poll: HMSPoll): void;
|
|
43
|
+
};
|
|
@@ -16,6 +16,7 @@ export { EmitterSubscription } from './_EmitterSubscription';
|
|
|
16
16
|
*/
|
|
17
17
|
export declare class EventEmitter {
|
|
18
18
|
_subscriber: EventSubscriptionVendor;
|
|
19
|
+
_onAllListenersRemoved: ((eventType: string | 'all') => void) | null | undefined;
|
|
19
20
|
/**
|
|
20
21
|
* @constructor
|
|
21
22
|
*
|
|
@@ -23,6 +24,12 @@ export declare class EventEmitter {
|
|
|
23
24
|
* to use. If omitted, a new subscriber will be created for the emitter.
|
|
24
25
|
*/
|
|
25
26
|
constructor(subscriber?: EventSubscriptionVendor | null);
|
|
27
|
+
/**
|
|
28
|
+
* Registers a listener to be invoked when all event listeners have been removed
|
|
29
|
+
* Given listener is invoked with event type or `all` when all listeners are removed
|
|
30
|
+
* @param onAllListenersRemoved
|
|
31
|
+
*/
|
|
32
|
+
registerOnAllListenersRemoved(onAllListenersRemoved: (eventType: string | 'all') => void): void;
|
|
26
33
|
/**
|
|
27
34
|
* Adds a listener to be invoked when events of the specified type are
|
|
28
35
|
* emitted. An optional calling context may be provided. The data arguments
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@100mslive/react-native-hms",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.10",
|
|
4
4
|
"description": "Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, and Chat in your apps with 100ms React Native SDK. With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
package/sdk-versions.json
CHANGED