@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 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPoll.ts"],"sourcesContent":["import type { HMSPollState } from './HMSPollState';\nimport type { HMSPollQuestion } from './HMSPollQuestion';\nimport type { HMSPollResult } from './HMSPollResult';\nimport type { HMSRole } from '../HMSRole';\nimport type { HMSPollUserTrackingMode } from './HMSPollUserTrackingMode';\nimport type { HMSPollType } from './HMSPollType';\nimport type { HMSPeer } from '../HMSPeer';\n\ntype HMSPeerSubset = {\n peerID: HMSPeer['peerID'];\n name: HMSPeer['name'];\n};\n\ntype HMSRoleSubset = {\n name: HMSRole['name'];\n};\n\nexport interface HMSPoll {\n /**\n The unique identifier of the poll.\n */\n pollId: string;\n\n /**\n The title of the poll.\n */\n title: string;\n\n /**\n The duration of the poll in seconds.\n */\n duration?: number;\n\n /**\n A flag indicating whether the poll is anonymous or not.\n */\n anonymous?: boolean;\n\n /**\n The tracking mode for user participation in the poll.\n */\n mode?: HMSPollUserTrackingMode;\n\n /**\n The roles that can vote in the poll.\n */\n rolesThatCanVote?: HMSRoleSubset[];\n\n /**\n The roles that can view the poll responses.\n */\n rolesThatCanViewResponses?: HMSRoleSubset[];\n\n /**\n The peer who started the poll.\n */\n startedBy?: HMSPeerSubset;\n\n /**\n The peer who stopped the poll.\n */\n stoppedBy?: HMSPeerSubset;\n\n /**\n The peer who created the poll.\n */\n createdBy?: HMSPeerSubset;\n\n /**\n The date and time when the poll was started.\n */\n startedAt?: Date;\n\n /**\n The date and time when the poll was stopped.\n */\n stoppedAt?: Date;\n\n /**\n The type of the poll.\n */\n type: HMSPollType;\n\n /**\n The current state of the poll.\n */\n state?: HMSPollState;\n\n /**\n The list of questions in the poll.\n */\n questions?: HMSPollQuestion[];\n\n /**\n The result of the poll.\n */\n result?: HMSPollResult;\n\n // /**\n // The visiblity of the poll. (Not available on iOS)\n // */\n // visibility?: boolean;\n\n // /**\n // * Is poll locked currently? (Not available on iOS)\n // */\n // locked?: boolean;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSPollCategory"],"sources":["HMSPollCategory.ts"],"sourcesContent":["export enum HMSPollCategory {\n /**\n The poll is a standard poll.\n */\n poll,\n\n /**\n The poll is a quiz.\n */\n quiz,\n}\n"],"mappings":"AAAA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollCreateParams.ts"],"sourcesContent":["import type { HMSPoll } from './HMSPoll';\nimport type { HMSPollQuestionCreateParams } from './HMSPollQuestionCreateParams';\n\nexport interface HMSPollCreateParams\n extends Pick<\n HMSPoll,\n | 'title'\n | 'type'\n | 'duration'\n | 'anonymous'\n // | 'visibility'\n // | 'locked'\n | 'mode'\n | 'rolesThatCanVote'\n | 'rolesThatCanViewResponses'\n > {\n pollId?: HMSPoll['pollId'];\n questions?: HMSPollQuestionCreateParams[];\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestion.ts"],"sourcesContent":["import type { HMSPollQuestionAnswer } from './HMSPollQuestionAnswer';\nimport type { HMSPollQuestionOption } from './HMSPollQuestionOption';\nimport type { HMSPollQuestionResponse } from './HMSPollQuestionResponse';\nimport type { HMSPollQuestionType } from './HMSPollQuestionType';\n\n/**\n Represents a question in a poll.\n */\nexport interface HMSPollQuestion {\n /**\n The index of the question within the poll.\n */\n index: number;\n\n /**\n The text of the question.\n */\n text: string;\n\n /**\n A flag indicating whether the question is skippable or not.\n */\n skippable: boolean;\n\n /**\n 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.\n */\n duration: number;\n\n /**\n A flag indicating whether the question can be answered only once.\n */\n once: boolean;\n\n /**\n The weight of the question in scoring.\n */\n weight: number;\n\n /**\n The minimum length of the answer (if applicable).\n */\n answerMinLen?: number;\n\n /**\n The maximum length of the answer (if applicable).\n */\n answerMaxLen?: number;\n\n /**\n The type of the question.\n */\n type: HMSPollQuestionType;\n\n /**\n The list of options for the question (if applicable).\n */\n options?: HMSPollQuestionOption[];\n\n /**\n The answer for the question (if it is a quiz).\n */\n answer?: HMSPollQuestionAnswer;\n\n /**\n The list of responses for the question.\n */\n responses?: HMSPollQuestionResponse[];\n\n /**\n The responses provided by the current user for the question.\n */\n myResponses: HMSPollQuestionResponse[];\n}\n\n// Web Inteface -\n// export interface HMSPollQuestion {\n// index: number;\n// text: string;\n// type: HMSPollQuestionType;\n// skippable?: boolean;\n// duration?: number;\n// once?: boolean;\n// weight?: number;\n// negative?: boolean;\n// answerMinLen?: number;\n// answerMaxLen?: number;\n// options?: HMSPollQuestionOption[];\n// answer?: HMSPollQuestionAnswer;\n// responses?: HMSPollQuestionResponse[];\n// result?: HMSPollQuestionResult;\n// }\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionAnswer.ts"],"sourcesContent":["/**\n Provides the correct answer for a quiz question to check users' responses against.\n */\nexport interface HMSPollQuestionAnswer {\n /**\n A flag indicating whether the answer should be hidden or not.\n */\n hidden: boolean;\n\n /**\n The index of the selected option (in case of single choice question).\n */\n option?: number;\n\n /**\n The list of indexes of selected options (in case of multiple choice question).\n */\n options?: number[];\n}\n\n// Web Inteface -\n// export interface HMSPollQuestionAnswer {\n// hidden: boolean; // if true answer will not be returned when poll is running\n// option?: number; // option index for correct answer, in case of single choice\n// options?: number[]; // list of options that shoould be in answer\n// text?: string; // answer text for answer.\n// case?: boolean; // if false case is ignored when comparing.\n// trim?: boolean; // if true, empty space is trimmer from start and end of asnwer.\n// }\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionCreateParams.ts"],"sourcesContent":["import type { HMSPollQuestion } from './HMSPollQuestion';\nimport type { HMSPollQuestionOptionCreateParams } from './HMSPollQuestionOptionCreateParams';\nimport type { HMSPollQuestionQuizOptionCreateParams } from './HMSPollQuestionQuizOptionCreateParams';\n\nexport interface HMSPollQuestionCreateParams\n extends Pick<\n HMSPollQuestion,\n 'text' | 'skippable' | 'type' | 'answerMinLen' | 'answerMaxLen'\n > {\n /**\n * A flag indicating whether the question can be answered only once.\n */\n once?: HMSPollQuestion['once'];\n\n /**\n * 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.\n */\n duration?: HMSPollQuestion['duration'];\n\n /**\n * The index of the question within the poll.\n */\n index?: HMSPollQuestion['index'];\n\n /**\n * The options of the question.\n */\n options?:\n | HMSPollQuestionOptionCreateParams[]\n | HMSPollQuestionQuizOptionCreateParams[];\n\n /**\n * The weight of the question in scoring.\n */\n weight?: number;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionOption.ts"],"sourcesContent":["/**\n Represents an option for a poll question.\n */\nexport interface HMSPollQuestionOption {\n /**\n The index of the option within the question.\n */\n index: number;\n\n /**\n The text of the option.\n */\n text: string;\n\n /**\n The weight of the option in scoring.\n */\n weight: number; // (optional on web)\n\n /**\n The count of votes received for the option. `0` is the default value.\n */\n voteCount: number; // (optional on web)\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionOptionCreateParams.ts"],"sourcesContent":["import type { HMSPollQuestionOption } from './HMSPollQuestionOption';\n\nexport interface HMSPollQuestionOptionCreateParams\n extends Pick<\n HMSPollQuestionOption,\n 'text'\n // | 'weight' // `weight` field is not required as of now\n > {}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionQuizOptionCreateParams.ts"],"sourcesContent":["import type { HMSPollQuestionOptionCreateParams } from './HMSPollQuestionOptionCreateParams';\n\nexport interface HMSPollQuestionQuizOptionCreateParams\n extends HMSPollQuestionOptionCreateParams {\n isCorrectAnswer: boolean;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionResponse.ts"],"sourcesContent":["import type { HMSPollQuestionType } from './HMSPollQuestionType';\nimport type { HMSPollResponsePeerInfo } from './HMSPollResponsePeerInfo';\n\n/**\n Represents a response for a poll question.\n */\nexport interface HMSPollQuestionResponse {\n /**\n The ID of the question associated with the response.\n */\n questionID: number;\n\n /**\n The type of the question associated with the response.\n */\n type: HMSPollQuestionType;\n\n /**\n A flag indicating whether the question was skipped or not.\n */\n skipped: boolean;\n\n /**\n The index of the selected option (in case of single choice question).\n */\n option: number;\n\n /**\n The list of indexes of selected options (in case of multiple choice question).\n */\n options?: number[];\n\n /**\n The text answer provided (in case of short/long answer question).\n */\n text: string;\n\n /**\n A flag indicating whether the response was updated from previous response.\n */\n update: boolean;\n\n /**\n Time taken to respond.\n */\n duration: number;\n\n /**\n The peer information associated with the response. Depends on the tracking type selected for poll.\n */\n peer?: HMSPollResponsePeerInfo;\n\n /**\n A flag indicating whether the response is final in case multiple responses were sent for this question.\n */\n responseFinal?: boolean;\n}\n\n// Web Interface -\n// export interface HMSPollQuestionResponse {\n// id?: string;\n// questionIndex: number;\n// peer?: HMSPollResponsePeerInfo;\n// type?: HMSPollQuestionType;\n// skipped?: boolean;\n// option?: number;\n// options?: number[];\n// text?: string;\n// update?: boolean; // SDK Needs to track whether we previously answered and set accordingly\n// duration?: number; // Time it took to answer the question for leaderboard\n// responseFinal?: boolean; // Indicates whether this is last update when fetching responses\n// }\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionResponseCreateParams.ts"],"sourcesContent":["import type { HMSPollQuestionResponse } from './HMSPollQuestionResponse';\n\nexport type HMSPollQuestionResponseCreateParams = Omit<\n HMSPollQuestionResponse,\n 'type' | 'peer' | 'update' | 'responseFinal'\n>;\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionResponseResult.ts"],"sourcesContent":["/**\n * Represents the result of a poll question response.\n */\nexport interface HMSPollQuestionResponse {\n /**\n * The ID of the question associated with the response result.\n */\n question: number;\n\n /**\n * A flag indicating whether the response was correct or not in case of quiz.\n */\n correct?: boolean;\n\n /**\n * An error associated with the response result (if any).\n */\n error?: string;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollQuestionResult.ts"],"sourcesContent":["/**\n Represents the result of a poll question within a poll result.\n */\nexport interface HMSPollQuestionResult {\n /**\n The ID of the question associated with the result.\n */\n question: number;\n\n /**\n The type of the question associated with the result.\n */\n type: string;\n\n /**\n The vote counts for each option of the question.\n */\n optionVoteCounts: number[];\n\n /**\n The number of correct votes for the question.\n */\n correctVotes: number;\n\n /**\n The number of skipped votes for the question.\n */\n skippedVotes: number;\n\n /**\n The total number of votes received for the question.\n */\n totalVotes: number;\n}\n\n// Web Interface -\n// export interface HMSPollQuestionResult {\n// correctResponses?: number;\n// skippedCount?: number;\n// totalResponses?: number;\n// }\n"],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export let HMSPollQuestionType = /*#__PURE__*/function (HMSPollQuestionType) {
|
|
2
|
+
HMSPollQuestionType[HMSPollQuestionType["singleChoice"] = 0] = "singleChoice";
|
|
3
|
+
HMSPollQuestionType[HMSPollQuestionType["multipleChoice"] = 1] = "multipleChoice";
|
|
4
|
+
HMSPollQuestionType[HMSPollQuestionType["shortAnswer"] = 2] = "shortAnswer";
|
|
5
|
+
HMSPollQuestionType[HMSPollQuestionType["longAnswer"] = 3] = "longAnswer";
|
|
6
|
+
return HMSPollQuestionType;
|
|
7
|
+
}({});
|
|
8
|
+
//# sourceMappingURL=HMSPollQuestionType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSPollQuestionType"],"sources":["HMSPollQuestionType.ts"],"sourcesContent":["export enum HMSPollQuestionType {\n /**\n The question allows for a single choice answer.\n */\n singleChoice,\n\n /**\n The question allows for multiple choice answers.\n */\n multipleChoice,\n\n /**\n The question expects a short text answer.\n */\n shortAnswer,\n\n /**\n The question expects a long text answer.\n */\n longAnswer,\n}\n"],"mappings":"AAAA,WAAYA,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAnBA,mBAAmB,CAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollResponsePeerInfo.ts"],"sourcesContent":["/**\n Represents the peer information associated with a poll response. The properties are filled according to HMSPollUserTrackingMode selected for the poll.\n */\nexport interface HMSPollResponsePeerInfo {\n /**\n The user hash associated with the peer.\n */\n userHash?: string;\n\n /**\n The peer ID associated with the response.\n */\n peerId?: string;\n\n /**\n The user ID associated with the peer.\n */\n customerUserId?: string;\n\n /**\n The username associated with the peer.\n */\n userName?: string;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["HMSPollResult.ts"],"sourcesContent":["import type { HMSPollQuestionResult } from './HMSPollQuestionResult';\n\n/**\n Represents the result of a poll.\n */\nexport interface HMSPollResult {\n /**\n The total number of responses received for the poll.\n */\n totalResponse: number; // totalResponses?: number; (on web)\n\n /**\n The number of unique users who responded to the poll.\n */\n userCount: number; // totalUsers?: number; (on web)\n\n /**\n The maximum number of users in the room during the poll.\n */\n maxUserCount: number; // maxUsers?: number; (on web)\n\n /**\n The list of question results for the poll.\n */\n questions: HMSPollQuestionResult[];\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export let HMSPollState = /*#__PURE__*/function (HMSPollState) {
|
|
2
|
+
HMSPollState[HMSPollState["created"] = 0] = "created";
|
|
3
|
+
HMSPollState[HMSPollState["started"] = 1] = "started";
|
|
4
|
+
HMSPollState[HMSPollState["stopped"] = 2] = "stopped";
|
|
5
|
+
return HMSPollState;
|
|
6
|
+
}({});
|
|
7
|
+
//# sourceMappingURL=HMSPollState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSPollState"],"sources":["HMSPollState.ts"],"sourcesContent":["export enum HMSPollState {\n /**\n The poll is created but not started yet.\n */\n created,\n\n /**\n The poll has started and is currently active.\n */\n started,\n\n /**\n The poll has been stopped and is no longer active.\n */\n stopped,\n}\n"],"mappings":"AAAA,WAAYA,YAAY,0BAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSPollType"],"sources":["HMSPollType.ts"],"sourcesContent":["export enum HMSPollType {\n poll,\n quiz,\n}\n"],"mappings":"AAAA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export let HMSPollUpdateType = /*#__PURE__*/function (HMSPollUpdateType) {
|
|
2
|
+
HMSPollUpdateType[HMSPollUpdateType["started"] = 0] = "started";
|
|
3
|
+
HMSPollUpdateType[HMSPollUpdateType["resultsUpdated"] = 1] = "resultsUpdated";
|
|
4
|
+
HMSPollUpdateType[HMSPollUpdateType["stopped"] = 2] = "stopped";
|
|
5
|
+
return HMSPollUpdateType;
|
|
6
|
+
}({});
|
|
7
|
+
//# sourceMappingURL=HMSPollUpdateType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSPollUpdateType"],"sources":["HMSPollUpdateType.ts"],"sourcesContent":["export enum HMSPollUpdateType {\n started,\n resultsUpdated,\n stopped,\n}\n"],"mappings":"AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export let HMSPollUserTrackingMode = /*#__PURE__*/function (HMSPollUserTrackingMode) {
|
|
2
|
+
HMSPollUserTrackingMode[HMSPollUserTrackingMode["peerID"] = 0] = "peerID";
|
|
3
|
+
HMSPollUserTrackingMode[HMSPollUserTrackingMode["customerUserID"] = 1] = "customerUserID";
|
|
4
|
+
HMSPollUserTrackingMode[HMSPollUserTrackingMode["userName"] = 2] = "userName";
|
|
5
|
+
return HMSPollUserTrackingMode;
|
|
6
|
+
}({});
|
|
7
|
+
//# sourceMappingURL=HMSPollUserTrackingMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSPollUserTrackingMode"],"sources":["HMSPollUserTrackingMode.ts"],"sourcesContent":["export enum HMSPollUserTrackingMode {\n /**\n User tracking is based on the peer ID.\n */\n peerID,\n\n /**\n User tracking is based on the customer ID.\n */\n customerUserID,\n\n /**\n User tracking is based on the username.\n */\n userName,\n}\n"],"mappings":"AAAA,WAAYA,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB,CAAvBA,uBAAuB;EAAvBA,uBAAuB,CAAvBA,uBAAuB;EAAvBA,uBAAuB,CAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useHMSInteractivityStore } from '../stores/hms-interactivity-store';
|
|
2
|
+
|
|
3
|
+
// use latest state (with component rerender)
|
|
4
|
+
|
|
5
|
+
export const usePollsState = pollId => {
|
|
6
|
+
return useHMSInteractivityStore(state => pollId ? state.polls[pollId] : state.polls);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// state setters
|
|
10
|
+
|
|
11
|
+
export const setPollsState = useHMSInteractivityStore.getState().setPolls;
|
|
12
|
+
//# sourceMappingURL=polls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useHMSInteractivityStore","usePollsState","pollId","state","polls","setPollsState","getState","setPolls"],"sources":["polls.ts"],"sourcesContent":["import type { HMSPoll } from '../classes/polls/HMSPoll';\nimport { useHMSInteractivityStore } from '../stores/hms-interactivity-store';\n\n// use latest state (with component rerender)\n\nexport const usePollsState = (pollId?: HMSPoll['pollId']) => {\n return useHMSInteractivityStore((state) =>\n pollId ? state.polls[pollId] : state.polls\n );\n};\n\n// state setters\n\nexport const setPollsState = useHMSInteractivityStore.getState().setPolls;\n"],"mappings":"AACA,SAASA,wBAAwB,QAAQ,mCAAmC;;AAE5E;;AAEA,OAAO,MAAMC,aAAa,GAAIC,MAA0B,IAAK;EAC3D,OAAOF,wBAAwB,CAAEG,KAAK,IACpCD,MAAM,GAAGC,KAAK,CAACC,KAAK,CAACF,MAAM,CAAC,GAAGC,KAAK,CAACC,KACvC,CAAC;AACH,CAAC;;AAED;;AAEA,OAAO,MAAMC,aAAa,GAAGL,wBAAwB,CAACM,QAAQ,CAAC,CAAC,CAACC,QAAQ"}
|
package/lib/module/index.js
CHANGED
|
@@ -83,6 +83,13 @@ export * from './classes/HMSIOSAudioMode';
|
|
|
83
83
|
export * from './classes/HMSRecordingState';
|
|
84
84
|
export * from './classes/HMSStreamingState';
|
|
85
85
|
export { HMSRecordingState } from './classes/HMSRecordingState';
|
|
86
|
+
export { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';
|
|
87
|
+
export { HMSPollType } from './classes/polls/HMSPollType';
|
|
88
|
+
export { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';
|
|
89
|
+
export { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';
|
|
90
|
+
export { HMSPollState } from './classes/polls/HMSPollState';
|
|
91
|
+
export { HMSPollQuestion } from './classes/polls/HMSPollQuestion';
|
|
92
|
+
export { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';
|
|
86
93
|
import { HMSSDK as HmsManager } from './classes/HMSSDK';
|
|
87
94
|
|
|
88
95
|
// 100ms React Native Module
|
|
@@ -98,6 +105,7 @@ export { useHmsViewsResolutionsState } from './hooks/hmsviews';
|
|
|
98
105
|
// 100ms Utilities
|
|
99
106
|
|
|
100
107
|
export { checkNotifications } from './utils/notification';
|
|
108
|
+
export * from './utils/windowController';
|
|
101
109
|
export * from './utils/keyboard';
|
|
102
110
|
|
|
103
111
|
// 100ms types
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HMSRecordingState","HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState","checkNotifications"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport * from './classes/HMSRecordingState';\nexport * from './classes/HMSStreamingState';\nexport type {\n HMSSessionStore,\n JsonArray,\n JsonMap,\n JsonPrimitive,\n JsonValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\nexport { HMSRecordingState } from './classes/HMSRecordingState';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Module\nexport { default as HMSManagerModule } from './modules/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms Utilities\nexport type { NotificationResult } from './utils/notification';\nexport { checkNotifications } from './utils/notification';\n\nexport * from './utils/keyboard';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,mBAAmB;AACjC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AA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AAC1C,cAAc,2BAA2B;AACzC,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAa3C,SAASA,iBAAiB,QAAQ,6BAA6B;
|
|
1
|
+
{"version":3,"names":["HMSRecordingState","HMSPollQuestionType","HMSPollType","HMSPollUserTrackingMode","HMSPollUpdateType","HMSPollState","HMSPollQuestion","HMSPollQuestionOption","HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState","checkNotifications"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport * from './classes/HMSRecordingState';\nexport * from './classes/HMSStreamingState';\nexport type {\n HMSSessionStore,\n JsonArray,\n JsonMap,\n JsonPrimitive,\n JsonValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\nexport { HMSRecordingState } from './classes/HMSRecordingState';\nexport type { HMSPoll } from './classes/polls/HMSPoll';\n\nexport { HMSPollQuestionType } from './classes/polls/HMSPollQuestionType';\nexport { HMSPollType } from './classes/polls/HMSPollType';\nexport { HMSPollUserTrackingMode } from './classes/polls/HMSPollUserTrackingMode';\nexport { HMSPollUpdateType } from './classes/polls/HMSPollUpdateType';\nexport { HMSPollState } from './classes/polls/HMSPollState';\nexport { HMSPollQuestion } from './classes/polls/HMSPollQuestion';\nexport { HMSPollQuestionOption } from './classes/polls/HMSPollQuestionOption';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Module\nexport { default as HMSManagerModule } from './modules/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms Utilities\nexport type { NotificationResult } from './utils/notification';\nexport { checkNotifications } from './utils/notification';\n\nexport * from './utils/windowController';\nexport * from './utils/keyboard';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,mBA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,oBAAoB;AAClC,cAAc,uCAAuC;AACrD,cAAc,uCAAuC;AACrD,cAAc,sCAAsC;AACpD,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AACzC,cAAc,6BAA6B;AAC3C,cAAc,6BAA6B;AAa3C,SAASA,iBAAiB,QAAQ,6BAA6B;AAG/D,SAASC,mBAAmB,QAAQ,qCAAqC;AACzE,SAASC,WAAW,QAAQ,6BAA6B;AACzD,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,iBAAiB,QAAQ,mCAAmC;AACrE,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,eAAe,QAAQ,iCAAiC;AACjE,SAASC,qBAAqB,QAAQ,uCAAuC;AAE7E,SAASC,MAAM,IAAIC,UAAU,QAAQ,kBAAkB;;AAEvD;AACA,SAASC,OAAO,IAAIC,gBAAgB,QAAQ,4BAA4B;;AAExE;AACA,cAAc,2BAA2B;;AAEzC;AACA,cAAc,2BAA2B;AACzC,SAASC,2BAA2B,QAAQ,kBAAkB;;AAE9D;;AAEA,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,cAAc,0BAA0B;AACxC,cAAc,kBAAkB;;AAEhC;AACA,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAE9B,eAAeJ,UAAU"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
import { subscribeWithSelector } from 'zustand/middleware';
|
|
3
|
+
// import { immer } from 'zustand/middleware/immer';
|
|
4
|
+
|
|
5
|
+
import { createHMSPollsSlice } from './hms-polls-slice';
|
|
6
|
+
export const useHMSInteractivityStore = create()(
|
|
7
|
+
// [['zustand/subscribeWithSelector', never], ['zustand/immer', never]]
|
|
8
|
+
subscribeWithSelector(
|
|
9
|
+
// immer((...a) => ({
|
|
10
|
+
// ...createHMSPollsSlice(...a),
|
|
11
|
+
// }))
|
|
12
|
+
(...a) => ({
|
|
13
|
+
...createHMSPollsSlice(...a)
|
|
14
|
+
})));
|
|
15
|
+
//# sourceMappingURL=hms-interactivity-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["create","subscribeWithSelector","createHMSPollsSlice","useHMSInteractivityStore","a"],"sources":["hms-interactivity-store.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { subscribeWithSelector } from 'zustand/middleware';\n// import { immer } from 'zustand/middleware/immer';\n\nimport { createHMSPollsSlice } from './hms-polls-slice';\nimport type { HMSInteractivityStore } from './types';\n\nexport const useHMSInteractivityStore = create<HMSInteractivityStore>()(\n // [['zustand/subscribeWithSelector', never], ['zustand/immer', never]]\n subscribeWithSelector(\n // immer((...a) => ({\n // ...createHMSPollsSlice(...a),\n // }))\n (...a) => ({\n ...createHMSPollsSlice(...a),\n })\n )\n);\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D;;AAEA,SAASC,mBAAmB,QAAQ,mBAAmB;AAGvD,OAAO,MAAMC,wBAAwB,GAAGH,MAAM,CAAwB,CAAC;AACrE;AACAC,qBAAqB;AACnB;AACA;AACA;AACA,CAAC,GAAGG,CAAC,MAAM;EACT,GAAGF,mBAAmB,CAAC,GAAGE,CAAC;AAC7B,CAAC,CACH,CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const createHMSPollsSlice = set => ({
|
|
2
|
+
polls: {},
|
|
3
|
+
setPolls: poll => {
|
|
4
|
+
set(state => {
|
|
5
|
+
state.polls[poll.pollId] = poll;
|
|
6
|
+
return state; // TODO: remove when use immer
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
// cue: undefined,
|
|
10
|
+
// setCue: (cue: HMSHLSPlayerPlaybackCue) => set({ cue }),
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=hms-polls-slice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createHMSPollsSlice","set","polls","setPolls","poll","state","pollId"],"sources":["hms-polls-slice.ts"],"sourcesContent":["import type { StateCreator } from 'zustand';\nimport type { HMSInteractivityStore, HMSPollsSlice } from './types';\nimport type { HMSPoll } from '../classes/polls/HMSPoll';\n\nexport const createHMSPollsSlice: StateCreator<\n HMSInteractivityStore,\n [],\n [],\n HMSPollsSlice\n> = (set) => ({\n polls: {},\n setPolls: (poll: HMSPoll) => {\n set((state) => {\n state.polls[poll.pollId] = poll;\n return state; // TODO: remove when use immer\n });\n },\n // cue: undefined,\n // setCue: (cue: HMSHLSPlayerPlaybackCue) => set({ cue }),\n});\n"],"mappings":"AAIA,OAAO,MAAMA,mBAKZ,GAAIC,GAAG,KAAM;EACZC,KAAK,EAAE,CAAC,CAAC;EACTC,QAAQ,EAAGC,IAAa,IAAK;IAC3BH,GAAG,CAAEI,KAAK,IAAK;MACbA,KAAK,CAACH,KAAK,CAACE,IAAI,CAACE,MAAM,CAAC,GAAGF,IAAI;MAC/B,OAAOC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAC;EACJ;EACA;EACA;AACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["// Stores\n\nimport type {\n HMSHLSPlayerPlaybackState,\n HMSHLSPlayerPlaybackCueEventData,\n HMSHLSPlayerPlaybackFailureEventData,\n HMSHLSPlayerPlaybackResolutionChangeEventData,\n HMSHLSPlayerStatsErrorEventData,\n HMSHLSPlayerStatsUpdateEventData,\n} from '../types';\n\nexport type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;\nexport type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;\n\n
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["// Stores\n\nimport type { HMSPoll } from '../classes/polls/HMSPoll';\nimport type {\n HMSHLSPlayerPlaybackState,\n HMSHLSPlayerPlaybackCueEventData,\n HMSHLSPlayerPlaybackFailureEventData,\n HMSHLSPlayerPlaybackResolutionChangeEventData,\n HMSHLSPlayerStatsErrorEventData,\n HMSHLSPlayerStatsUpdateEventData,\n} from '../types';\n\nexport type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;\nexport type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;\nexport type HMSInteractivityStore = HMSPollsSlice;\n\n//#region HMSViews Slice\n\nexport type TrackId = string;\n\nexport type Resolution = {\n width: number;\n height: number;\n};\n\nexport interface HMSViewsSlice {\n hmsviewsResolutions: Record<TrackId, Resolution | undefined>;\n setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void;\n}\n\n//#endregion HMSViews Slice\n\n//#region HLS Player Playback Slice\n\nexport interface HMSHLSPlayerPlaybackCue\n extends Omit<HMSHLSPlayerPlaybackCueEventData, 'endDate' | 'startDate'> {\n endDate?: Date;\n startDate: Date;\n}\n\nexport type HMSHLSPlayerCue = HMSHLSPlayerPlaybackCue | undefined;\n\nexport type HMSHLSPlayerPlaybackError =\n | HMSHLSPlayerPlaybackFailureEventData['error']\n | undefined;\n\nexport type HMSHLSPlayerResolution =\n | HMSHLSPlayerPlaybackResolutionChangeEventData\n | undefined;\n\nexport interface HMSHLSPlayerPlaybackSlice {\n cue: HMSHLSPlayerCue;\n playbackState: HMSHLSPlayerPlaybackState;\n resolution: HMSHLSPlayerResolution;\n error: HMSHLSPlayerPlaybackError;\n setCue(cue: HMSHLSPlayerPlaybackCue): void;\n setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void;\n setResolution(resolution: HMSHLSPlayerResolution): void;\n setPlaybackError(error: HMSHLSPlayerPlaybackError): void;\n}\n\n//#endregion HLS Player Playback Slice\n\n//#region HLS Player Stats Slice\n\nexport type HMSHLSPlayerStats = HMSHLSPlayerStatsUpdateEventData;\nexport type HMSHLSPlayerStatsError =\n | HMSHLSPlayerStatsErrorEventData\n | undefined;\n\nexport interface HMSHLSPlayerStatsSlice {\n stats: HMSHLSPlayerStats;\n error: HMSHLSPlayerStatsError | undefined;\n changeStats(stats: HMSHLSPlayerStats): void;\n setError(error: HMSHLSPlayerStatsError): void;\n}\n\n//#endregion HLS Player Stats Slice\n\n//#region Polls Slice\n\nexport type HMSPollsSlice = {\n polls: Record<string, HMSPoll>;\n setPolls(poll: HMSPoll): void;\n};\n\n//#endregion Polls Slice\n"],"mappings":""}
|
|
@@ -28,9 +28,19 @@ export class EventEmitter {
|
|
|
28
28
|
*/
|
|
29
29
|
constructor(subscriber) {
|
|
30
30
|
_defineProperty(this, "_subscriber", void 0);
|
|
31
|
+
_defineProperty(this, "_onAllListenersRemoved", void 0);
|
|
31
32
|
this._subscriber = subscriber || new EventSubscriptionVendor();
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Registers a listener to be invoked when all event listeners have been removed
|
|
37
|
+
* Given listener is invoked with event type or `all` when all listeners are removed
|
|
38
|
+
* @param onAllListenersRemoved
|
|
39
|
+
*/
|
|
40
|
+
registerOnAllListenersRemoved(onAllListenersRemoved) {
|
|
41
|
+
this._onAllListenersRemoved = onAllListenersRemoved;
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
/**
|
|
35
45
|
* Adds a listener to be invoked when events of the specified type are
|
|
36
46
|
* emitted. An optional calling context may be provided. The data arguments
|
|
@@ -57,7 +67,9 @@ export class EventEmitter {
|
|
|
57
67
|
* listeners to remove
|
|
58
68
|
*/
|
|
59
69
|
removeAllListeners(eventType) {
|
|
70
|
+
var _this$_onAllListeners;
|
|
60
71
|
this._subscriber.removeAllSubscriptions(eventType);
|
|
72
|
+
(_this$_onAllListeners = this._onAllListenersRemoved) === null || _this$_onAllListeners === void 0 || _this$_onAllListeners.call(this, eventType || 'all');
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
/**
|
|
@@ -69,7 +81,14 @@ export class EventEmitter {
|
|
|
69
81
|
console.warn('Subscription does not belong to this emitter.'); // TODO: use HMSLogger here
|
|
70
82
|
return;
|
|
71
83
|
}
|
|
84
|
+
const eventType = subscription.eventType;
|
|
72
85
|
this._subscriber.removeSubscription(subscription);
|
|
86
|
+
|
|
87
|
+
// check if all subscriptions are removed for the event type
|
|
88
|
+
if (typeof this._onAllListenersRemoved === 'function' && this.listenerCount(eventType) === 0) {
|
|
89
|
+
// invoke passed cleanup function if any for the event type
|
|
90
|
+
this._onAllListenersRemoved(eventType);
|
|
91
|
+
}
|
|
73
92
|
}
|
|
74
93
|
|
|
75
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EmitterSubscription","EventSubscriptionVendor","sparseFilterPredicate","EventEmitter","constructor","subscriber","_defineProperty","_subscriber","addListener","eventType","listener","context","addSubscription","removeAllListeners","removeAllSubscriptions","removeSubscription","subscription","emitter","console","warn","listenerCount","subscriptions","getSubscriptionsForType","filter","length","emit","args","i","l","apply","removeListener","remove"],"sources":["EventEmitter.ts"],"sourcesContent":["import { EmitterSubscription } from './_EmitterSubscription';\nimport { EventSubscriptionVendor } from './_EventSubscriptionVendor';\n\nconst sparseFilterPredicate = () => true;\n\nexport { EmitterSubscription } from './_EmitterSubscription';\n\n/**\n * @class EventEmitter\n * @description\n * An EventEmitter is responsible for managing a set of listeners and publishing\n * events to them when it is told that such events happened. In addition to the\n * data for the given event it also sends a event control object which allows\n * the listeners/handlers to prevent the default behavior of the given event.\n *\n * The emitter is designed to be generic enough to support all the different\n * contexts in which one might want to emit events. It is a simple multicast\n * mechanism on top of which extra functionality can be composed. For example, a\n * more advanced emitter may use an EventHolder and EventFactory.\n */\nexport class EventEmitter {\n _subscriber: EventSubscriptionVendor;\n\n /**\n * @constructor\n *\n * @param {EventSubscriptionVendor} subscriber - Optional subscriber instance\n * to use. If omitted, a new subscriber will be created for the emitter.\n */\n constructor(subscriber?: EventSubscriptionVendor | null) {\n this._subscriber = subscriber || new EventSubscriptionVendor();\n }\n\n /**\n * Adds a listener to be invoked when events of the specified type are\n * emitted. An optional calling context may be provided. The data arguments\n * emitted will be passed to the listener function.\n *\n * TODO: Annotate the listener arg's type. This is tricky because listeners\n * can be invoked with varargs.\n *\n * @param {string} eventType - Name of the event to listen to\n * @param {function} listener - Function to invoke when the specified event is\n * emitted\n * @param {*} context - Optional context object to use when invoking the\n * listener\n */\n addListener(\n eventType: string,\n listener: Function,\n context: Object | null | undefined\n ): EmitterSubscription {\n return this._subscriber.addSubscription(\n eventType,\n new EmitterSubscription(this, this._subscriber, listener, context)\n ) as EmitterSubscription;\n }\n\n /**\n * Removes all of the registered listeners, including those registered as\n * listener maps.\n *\n * @param {?string} eventType - Optional name of the event whose registered\n * listeners to remove\n */\n removeAllListeners(eventType: string | undefined | null) {\n this._subscriber.removeAllSubscriptions(eventType);\n }\n\n /**\n * Removes a specific subscription. Called by the `remove()` method of the\n * subscription itself to ensure any necessary cleanup is performed.\n */\n removeSubscription(subscription: EmitterSubscription) {\n if (subscription.emitter !== this) {\n console.warn('Subscription does not belong to this emitter.'); // TODO: use HMSLogger here\n return;\n }\n\n this._subscriber.removeSubscription(subscription);\n }\n\n /**\n * Returns the number of listeners that are currently registered for the given\n * event.\n *\n * @param {string} eventType - Name of the event to query\n * @returns {number}\n */\n listenerCount(eventType: string): number {\n const subscriptions = this._subscriber.getSubscriptionsForType(eventType);\n return subscriptions\n ? // We filter out missing entries because the array is sparse.\n // \"callbackfn is called only for elements of the array which actually\n // exist; it is not called for missing elements of the array.\"\n // https://www.ecma-international.org/ecma-262/9.0/index.html#sec-array.prototype.filter\n subscriptions.filter(sparseFilterPredicate).length\n : 0;\n }\n\n /**\n * Emits an event of the given type with the given data. All handlers of that\n * particular type will be notified.\n *\n * @param {string} eventType - Name of the event to emit\n * @param {...*} Arbitrary arguments to be passed to each registered listener\n *\n * @example\n * emitter.addListener('someEvent', function(message) {\n * console.log(message);\n * });\n *\n * emitter.emit('someEvent', 'abc'); // logs 'abc'\n */\n emit(eventType: string, ...args: any[]) {\n const subscriptions = this._subscriber.getSubscriptionsForType(\n eventType\n ) as EmitterSubscription[] | null | undefined;\n if (subscriptions) {\n for (let i = 0, l = subscriptions.length; i < l; i++) {\n const subscription = subscriptions[i];\n\n // The subscription may have been removed during this event loop.\n if (subscription && subscription.listener) {\n subscription.listener.apply(subscription.context, args);\n }\n }\n }\n }\n\n /**\n * Removes the given listener for event of specific type.\n *\n * @param {string} eventType - Name of the event to emit\n * @param {function} listener - Function to invoke when the specified event is\n * emitted\n *\n * @example\n * emitter.removeListener('someEvent', function(message) {\n * console.log(message);\n * }); // removes the listener if already registered\n *\n */\n removeListener(eventType: string, listener: Function) {\n const subscriptions = this._subscriber.getSubscriptionsForType(\n eventType\n ) as EmitterSubscription[] | null | undefined;\n if (subscriptions) {\n for (let i = 0, l = subscriptions.length; i < l; i++) {\n const subscription = subscriptions[i];\n\n // The subscription may have been removed during this event loop.\n // its listener matches the listener in method parameters\n if (subscription && subscription.listener === listener) {\n subscription.remove();\n }\n }\n }\n }\n}\n"],"mappings":";;;AAAA,SAASA,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,MAAMC,qBAAqB,GAAGA,CAAA,KAAM,IAAI;AAExC,SAASF,mBAAmB,QAAQ,wBAAwB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,YAAY,CAAC;EAGxB;AACF;AACA;AACA;AACA;AACA;EACEC,WAAWA,CAACC,UAA2C,EAAE;IAAAC,eAAA;IACvD,IAAI,CAACC,WAAW,GAAGF,UAAU,IAAI,IAAIJ,uBAAuB,CAAC,CAAC;EAChE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEO,WAAWA,CACTC,SAAiB,EACjBC,QAAkB,EAClBC,OAAkC,EACb;IACrB,OAAO,IAAI,CAACJ,WAAW,CAACK,eAAe,CACrCH,SAAS,EACT,IAAIT,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAACO,WAAW,EAAEG,QAAQ,EAAEC,OAAO,C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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEI,cAAcA,CAACrB,SAAiB,EAAEC,QAAkB,EAAE;IACpD,MAAMW,aAAa,GAAG,IAAI,CAACd,WAAW,CAACe,uBAAuB,CAC5Db,SACF,CAA6C;IAC7C,IAAIY,aAAa,EAAE;MACjB,KAAK,IAAIM,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAGP,aAAa,CAACG,MAAM,EAAEG,CAAC,GAAGC,CAAC,EAAED,CAAC,EAAE,EAAE;QACpD,MAAMX,YAAY,GAAGK,aAAa,CAACM,CAAC,CAAC;;QAErC;QACA;QACA,IAAIX,YAAY,IAAIA,YAAY,CAACN,QAAQ,KAAKA,QAAQ,EAAE;UACtDM,YAAY,CAACe,MAAM,CAAC,CAAC;QACvB;MACF;IACF;EACF;AACF"}
|
|
1
|
+
{"version":3,"names":["EmitterSubscription","EventSubscriptionVendor","sparseFilterPredicate","EventEmitter","constructor","subscriber","_defineProperty","_subscriber","registerOnAllListenersRemoved","onAllListenersRemoved","_onAllListenersRemoved","addListener","eventType","listener","context","addSubscription","removeAllListeners","_this$_onAllListeners","removeAllSubscriptions","call","removeSubscription","subscription","emitter","console","warn","listenerCount","subscriptions","getSubscriptionsForType","filter","length","emit","args","i","l","apply","removeListener","remove"],"sources":["EventEmitter.ts"],"sourcesContent":["import { EmitterSubscription } from './_EmitterSubscription';\nimport { EventSubscriptionVendor } from './_EventSubscriptionVendor';\n\nconst sparseFilterPredicate = () => true;\n\nexport { EmitterSubscription } from './_EmitterSubscription';\n\n/**\n * @class EventEmitter\n * @description\n * An EventEmitter is responsible for managing a set of listeners and publishing\n * events to them when it is told that such events happened. In addition to the\n * data for the given event it also sends a event control object which allows\n * the listeners/handlers to prevent the default behavior of the given event.\n *\n * The emitter is designed to be generic enough to support all the different\n * contexts in which one might want to emit events. It is a simple multicast\n * mechanism on top of which extra functionality can be composed. For example, a\n * more advanced emitter may use an EventHolder and EventFactory.\n */\nexport class EventEmitter {\n _subscriber: EventSubscriptionVendor;\n _onAllListenersRemoved:\n | ((eventType: string | 'all') => void)\n | null\n | undefined;\n\n /**\n * @constructor\n *\n * @param {EventSubscriptionVendor} subscriber - Optional subscriber instance\n * to use. If omitted, a new subscriber will be created for the emitter.\n */\n constructor(subscriber?: EventSubscriptionVendor | null) {\n this._subscriber = subscriber || new EventSubscriptionVendor();\n }\n\n /**\n * Registers a listener to be invoked when all event listeners have been removed\n * Given listener is invoked with event type or `all` when all listeners are removed\n * @param onAllListenersRemoved\n */\n registerOnAllListenersRemoved(\n onAllListenersRemoved: (eventType: string | 'all') => void\n ) {\n this._onAllListenersRemoved = onAllListenersRemoved;\n }\n\n /**\n * Adds a listener to be invoked when events of the specified type are\n * emitted. An optional calling context may be provided. The data arguments\n * emitted will be passed to the listener function.\n *\n * TODO: Annotate the listener arg's type. This is tricky because listeners\n * can be invoked with varargs.\n *\n * @param {string} eventType - Name of the event to listen to\n * @param {function} listener - Function to invoke when the specified event is\n * emitted\n * @param {*} context - Optional context object to use when invoking the\n * listener\n */\n addListener(\n eventType: string,\n listener: Function,\n context: Object | null | undefined\n ): EmitterSubscription {\n return this._subscriber.addSubscription(\n eventType,\n new EmitterSubscription(this, this._subscriber, listener, context)\n ) as EmitterSubscription;\n }\n\n /**\n * Removes all of the registered listeners, including those registered as\n * listener maps.\n *\n * @param {?string} eventType - Optional name of the event whose registered\n * listeners to remove\n */\n removeAllListeners(eventType: string | undefined | null) {\n this._subscriber.removeAllSubscriptions(eventType);\n this._onAllListenersRemoved?.(eventType || 'all');\n }\n\n /**\n * Removes a specific subscription. Called by the `remove()` method of the\n * subscription itself to ensure any necessary cleanup is performed.\n */\n removeSubscription(subscription: EmitterSubscription) {\n if (subscription.emitter !== this) {\n console.warn('Subscription does not belong to this emitter.'); // TODO: use HMSLogger here\n return;\n }\n\n const eventType = subscription.eventType;\n this._subscriber.removeSubscription(subscription);\n\n // check if all subscriptions are removed for the event type\n if (\n typeof this._onAllListenersRemoved === 'function' &&\n this.listenerCount(eventType) === 0\n ) {\n // invoke passed cleanup function if any for the event type\n this._onAllListenersRemoved(eventType);\n }\n }\n\n /**\n * Returns the number of listeners that are currently registered for the given\n * event.\n *\n * @param {string} eventType - Name of the event to query\n * @returns {number}\n */\n listenerCount(eventType: string): number {\n const subscriptions = this._subscriber.getSubscriptionsForType(eventType);\n return subscriptions\n ? // We filter out missing entries because the array is sparse.\n // \"callbackfn is called only for elements of the array which actually\n // exist; it is not called for missing elements of the array.\"\n // https://www.ecma-international.org/ecma-262/9.0/index.html#sec-array.prototype.filter\n subscriptions.filter(sparseFilterPredicate).length\n : 0;\n }\n\n /**\n * Emits an event of the given type with the given data. All handlers of that\n * particular type will be notified.\n *\n * @param {string} eventType - Name of the event to emit\n * @param {...*} Arbitrary arguments to be passed to each registered listener\n *\n * @example\n * emitter.addListener('someEvent', function(message) {\n * console.log(message);\n * });\n *\n * emitter.emit('someEvent', 'abc'); // logs 'abc'\n */\n emit(eventType: string, ...args: any[]) {\n const subscriptions = this._subscriber.getSubscriptionsForType(\n eventType\n ) as EmitterSubscription[] | null | undefined;\n if (subscriptions) {\n for (let i = 0, l = subscriptions.length; i < l; i++) {\n const subscription = subscriptions[i];\n\n // The subscription may have been removed during this event loop.\n if (subscription && subscription.listener) {\n subscription.listener.apply(subscription.context, args);\n }\n }\n }\n }\n\n /**\n * Removes the given listener for event of specific type.\n *\n * @param {string} eventType - Name of the event to emit\n * @param {function} listener - Function to invoke when the specified event is\n * emitted\n *\n * @example\n * emitter.removeListener('someEvent', function(message) {\n * console.log(message);\n * }); // removes the listener if already registered\n *\n */\n removeListener(eventType: string, listener: Function) {\n const subscriptions = this._subscriber.getSubscriptionsForType(\n eventType\n ) as EmitterSubscription[] | null | undefined;\n if (subscriptions) {\n for (let i = 0, l = subscriptions.length; i < l; i++) {\n const subscription = subscriptions[i];\n\n // The subscription may have been removed during this event loop.\n // its listener matches the listener in method parameters\n if (subscription && subscription.listener === listener) {\n subscription.remove();\n }\n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AACA;AACA;AACA;AACA;EACEI,cAAcA,CAACvB,SAAiB,EAAEC,QAAkB,EAAE;IACpD,MAAMa,aAAa,GAAG,IAAI,CAACnB,WAAW,CAACoB,uBAAuB,CAC5Df,SACF,CAA6C;IAC7C,IAAIc,aAAa,EAAE;MACjB,KAAK,IAAIM,CAAC,GAAG,CAAC,EAAEC,CAAC,GAAGP,aAAa,CAACG,MAAM,EAAEG,CAAC,GAAGC,CAAC,EAAED,CAAC,EAAE,EAAE;QACpD,MAAMX,YAAY,GAAGK,aAAa,CAACM,CAAC,CAAC;;QAErC;QACA;QACA,IAAIX,YAAY,IAAIA,YAAY,CAACR,QAAQ,KAAKA,QAAQ,EAAE;UACtDQ,YAAY,CAACe,MAAM,CAAC,CAAC;QACvB;MACF;IACF;EACF;AACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import HMSManager from '../modules/HMSManagerModule';
|
|
3
|
+
export class WindowController {
|
|
4
|
+
/**
|
|
5
|
+
* [Android Only] Hides the navigation bar.
|
|
6
|
+
*/
|
|
7
|
+
static hideSystemBars() {
|
|
8
|
+
if (Platform.OS === 'android') {
|
|
9
|
+
return HMSManager.hideSystemBars();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* [Android Only] Shows the navigation bar.
|
|
15
|
+
*/
|
|
16
|
+
static showSystemBars() {
|
|
17
|
+
if (Platform.OS === 'android') {
|
|
18
|
+
return HMSManager.showSystemBars();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=windowController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","HMSManager","WindowController","hideSystemBars","OS","showSystemBars"],"sources":["windowController.ts"],"sourcesContent":["import { Platform } from 'react-native';\n\nimport HMSManager from '../modules/HMSManagerModule';\n\nexport class WindowController {\n /**\n * [Android Only] Hides the navigation bar.\n */\n static hideSystemBars() {\n if (Platform.OS === 'android') {\n return HMSManager.hideSystemBars();\n }\n }\n\n /**\n * [Android Only] Shows the navigation bar.\n */\n static showSystemBars() {\n if (Platform.OS === 'android') {\n return HMSManager.showSystemBars();\n }\n }\n}\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,UAAU,MAAM,6BAA6B;AAEpD,OAAO,MAAMC,gBAAgB,CAAC;EAC5B;AACF;AACA;EACE,OAAOC,cAAcA,CAAA,EAAG;IACtB,IAAIH,QAAQ,CAACI,EAAE,KAAK,SAAS,EAAE;MAC7B,OAAOH,UAAU,CAACE,cAAc,CAAC,CAAC;IACpC;EACF;;EAEA;AACF;AACA;EACE,OAAOE,cAAcA,CAAA,EAAG;IACtB,IAAIL,QAAQ,CAACI,EAAE,KAAK,SAAS,EAAE;MAC7B,OAAOH,UAAU,CAACI,cAAc,CAAC,CAAC;IACpC;EACF;AACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HMSPoll } from './polls/HMSPoll';
|
|
2
|
+
import type { HMSPollCreateParams } from './polls/HMSPollCreateParams';
|
|
3
|
+
import type { HMSPollUpdateType } from './polls/HMSPollUpdateType';
|
|
4
|
+
type PollQuestionResponseCreateParams = {
|
|
5
|
+
pollId: string;
|
|
6
|
+
pollQuestionIndex: number;
|
|
7
|
+
responses: {
|
|
8
|
+
text: string;
|
|
9
|
+
duration?: number;
|
|
10
|
+
} | {
|
|
11
|
+
options: number[];
|
|
12
|
+
duration?: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare class HMSInteractivityCenter {
|
|
16
|
+
private _eventEmitter;
|
|
17
|
+
private _pollUpdateListener;
|
|
18
|
+
private _onAllPollUpdateListenerRemoved;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Adds a listener for poll updates
|
|
22
|
+
* @param listener - Callback to be called when a poll is updated
|
|
23
|
+
* @returns HMSEventSubscription
|
|
24
|
+
*/
|
|
25
|
+
addPollUpdateListener(listener: (updatedPoll: HMSPoll, update: HMSPollUpdateType) => void): import("../utils").EmitterSubscription;
|
|
26
|
+
/**
|
|
27
|
+
* Starts a poll
|
|
28
|
+
*
|
|
29
|
+
* @param pollParams
|
|
30
|
+
*/
|
|
31
|
+
startPoll(pollParams: HMSPollCreateParams): Promise<any>;
|
|
32
|
+
add(pollQuestionResponseParams: PollQuestionResponseCreateParams): Promise<any>;
|
|
33
|
+
stop(pollId: string): Promise<any>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -7,6 +7,8 @@ export declare class HMSPermissions {
|
|
|
7
7
|
browserRecording?: boolean;
|
|
8
8
|
hlsStreaming?: boolean;
|
|
9
9
|
rtmpStreaming?: boolean;
|
|
10
|
+
pollRead?: boolean;
|
|
11
|
+
pollWrite?: boolean;
|
|
10
12
|
constructor(params?: {
|
|
11
13
|
endRoom?: boolean;
|
|
12
14
|
removeOthers?: boolean;
|
|
@@ -16,5 +18,7 @@ export declare class HMSPermissions {
|
|
|
16
18
|
browserRecording?: boolean;
|
|
17
19
|
hlsStreaming?: boolean;
|
|
18
20
|
rtmpStreaming?: boolean;
|
|
21
|
+
pollRead?: boolean;
|
|
22
|
+
pollWrite?: boolean;
|
|
19
23
|
});
|
|
20
24
|
}
|
|
@@ -21,9 +21,11 @@ import { HMSPIPListenerActions } from './HMSPIPListenerActions';
|
|
|
21
21
|
import type { HMSPeerListIteratorOptions } from './HMSPeerListIteratorOptions';
|
|
22
22
|
import { HMSPeerListIterator } from './HMSPeerListIterator';
|
|
23
23
|
import type { HMSPIPConfig } from './HMSPIPConfig';
|
|
24
|
+
import { HMSInteractivityCenter } from './HMSInteractivityCenter';
|
|
24
25
|
type HmsViewProps = Omit<HmsComponentProps, 'id'>;
|
|
25
26
|
export declare class HMSSDK {
|
|
26
27
|
id: string;
|
|
28
|
+
private _interactivityCenter;
|
|
27
29
|
private appStateSubscription?;
|
|
28
30
|
private onPreviewDelegate?;
|
|
29
31
|
private onJoinDelegate?;
|
|
@@ -622,6 +624,7 @@ export declare class HMSSDK {
|
|
|
622
624
|
isPipModeSupported(): Promise<undefined | boolean>;
|
|
623
625
|
enterPipMode(data?: HMSPIPConfig): Promise<undefined | boolean>;
|
|
624
626
|
setPipParams(data?: HMSPIPConfig): Promise<undefined | boolean>;
|
|
627
|
+
get interactivityCenter(): HMSInteractivityCenter;
|
|
625
628
|
/**
|
|
626
629
|
* - Returns the instance of logger which can be used to manipulate log levels.
|
|
627
630
|
* @returns @instance HMSLogger
|