@trtc/calls-uikit-react 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-zh_CN.md +97 -0
- package/README.md +104 -0
- package/debug/GenerateTestUserSig-es.js +26 -0
- package/debug/lib-generate-test-usersig-es.min.js +2 -0
- package/package.json +42 -0
- package/src/Components/TUICallKit/TUICallKit.module.scss +21 -0
- package/src/Components/TUICallKit/TUICallKit.tsx +267 -0
- package/src/Components/TUICallKit/index.ts +3 -0
- package/src/Components/assets/base/close.svg +1 -0
- package/src/Components/assets/base/error.svg +1 -0
- package/src/Components/assets/base/info.svg +1 -0
- package/src/Components/assets/base/loading-circle.svg +1 -0
- package/src/Components/assets/base/success.svg +1 -0
- package/src/Components/assets/base/waring.svg +1 -0
- package/src/Components/assets/button/accept.svg +10 -0
- package/src/Components/assets/button/backgroundBlurClose.svg +3 -0
- package/src/Components/assets/button/backgroundBlurOpen.svg +3 -0
- package/src/Components/assets/button/camera-close.svg +8 -0
- package/src/Components/assets/button/camera-open.svg +3 -0
- package/src/Components/assets/button/desktop/arrow.png +0 -0
- package/src/Components/assets/button/desktop/fullScreen.svg +4 -0
- package/src/Components/assets/button/desktop/minimize.svg +6 -0
- package/src/Components/assets/button/hangup.svg +3 -0
- package/src/Components/assets/button/microphone-close.svg +4 -0
- package/src/Components/assets/button/microphone-open.svg +4 -0
- package/src/Components/assets/button/mobile/down.svg +4 -0
- package/src/Components/assets/button/mobile/minimize.svg +4 -0
- package/src/Components/assets/button/mobile/switch-camera.svg +3 -0
- package/src/Components/assets/button/mobile/up.svg +4 -0
- package/src/Components/assets/button/speaker-close.svg +4 -0
- package/src/Components/assets/button/speaker-open.svg +3 -0
- package/src/Components/assets/button/switch-audio.svg +3 -0
- package/src/Components/assets/callMessage/audioCall.svg +3 -0
- package/src/Components/assets/callMessage/videoCall.svg +3 -0
- package/src/Components/assets/common/defaultAvatar.svg +11 -0
- package/src/Components/assets/common/microphone-volumn-close.svg +9 -0
- package/src/Components/assets/floatingWindow/desktop/floatCallEnd.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatFullScreen.svg +3 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophone.svg +4 -0
- package/src/Components/assets/floatingWindow/desktop/floatMicrophoneClosed.svg +3 -0
- package/src/Components/assets/floatingWindow/mobile/camera-close.svg +14 -0
- package/src/Components/assets/floatingWindow/mobile/camera-open.svg +14 -0
- package/src/Components/assets/floatingWindow/mobile/earphone.svg +3 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-close.svg +4 -0
- package/src/Components/assets/floatingWindow/mobile/microphone-open.svg +4 -0
- package/src/Components/assets/permission/desktop/index.ts +11 -0
- package/src/Components/assets/permission/desktop/mac/permit-en.jpg +0 -0
- package/src/Components/assets/permission/desktop/mac/permit-zh.jpg +0 -0
- package/src/Components/assets/permission/desktop/win/permit-en.png +0 -0
- package/src/Components/assets/permission/desktop/win/permit-zh.png +0 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-group.svg +19 -0
- package/src/Components/assets/streamInfo/mobile/microphone-close-single.svg +6 -0
- package/src/Components/assets/streamInfo/mobile/volumn.svg +20 -0
- package/src/Components/assets/streamInfo/networkStatus.svg +22 -0
- package/src/Components/components/GroupCall/GroupCall.module.scss +13 -0
- package/src/Components/components/GroupCall/GroupCall.tsx +82 -0
- package/src/Components/components/GroupCall/MediaContainer/AudioStream/AudioStream.tsx +41 -0
- package/src/Components/components/GroupCall/MediaContainer/MediaContainer.module.scss +74 -0
- package/src/Components/components/GroupCall/MediaContainer/MediaContainer.tsx +138 -0
- package/src/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.tsx +48 -0
- package/src/Components/components/GroupCall/MediaContainer/index.ts +3 -0
- package/src/Components/components/GroupCall/Waiting/Waiting.module.scss +44 -0
- package/src/Components/components/GroupCall/Waiting/Waiting.tsx +89 -0
- package/src/Components/components/SingleCall/MediaContainer/AudioStream/AudioStream.tsx +86 -0
- package/src/Components/components/SingleCall/MediaContainer/MediaContainer.module.scss +33 -0
- package/src/Components/components/SingleCall/MediaContainer/MediaContainer.tsx +121 -0
- package/src/Components/components/SingleCall/MediaContainer/hooks/useGetLargeViewName.ts +29 -0
- package/src/Components/components/SingleCall/MediaContainer/index.ts +3 -0
- package/src/Components/components/SingleCall/SingleCall.module.scss +28 -0
- package/src/Components/components/SingleCall/SingleCall.tsx +54 -0
- package/src/Components/components/SingleCall/Waiting/Waiting.module.scss +3 -0
- package/src/Components/components/SingleCall/Waiting/Waiting.tsx +45 -0
- package/src/Components/components/base/Avatar/Avatar.scss +28 -0
- package/src/Components/components/base/Avatar/Avatar.tsx +52 -0
- package/src/Components/components/base/Avatar/index.ts +3 -0
- package/src/Components/components/base/Button/Button.scss +122 -0
- package/src/Components/components/base/Button/Button.tsx +107 -0
- package/src/Components/components/base/Button/index.ts +3 -0
- package/src/Components/components/base/Drag/Drag.tsx +155 -0
- package/src/Components/components/base/Drag/index.tsx +3 -0
- package/src/Components/components/base/Grid/Col/Col.scss +31 -0
- package/src/Components/components/base/Grid/Col/Col.tsx +52 -0
- package/src/Components/components/base/Grid/Col/index.ts +3 -0
- package/src/Components/components/base/Grid/Row/Row.scss +27 -0
- package/src/Components/components/base/Grid/Row/Row.tsx +51 -0
- package/src/Components/components/base/Grid/Row/index.ts +5 -0
- package/src/Components/components/base/Grid/style/mixin.scss +61 -0
- package/src/Components/components/base/GridLayout/GridLayout.tsx +189 -0
- package/src/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.scss +11 -0
- package/src/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.tsx +37 -0
- package/src/Components/components/base/GridLayout/index.ts +7 -0
- package/src/Components/components/base/Icon/Icon.tsx +25 -0
- package/src/Components/components/base/Loading/Circle/Cilrcle.tsx +20 -0
- package/src/Components/components/base/Loading/Circle/Circle.scss +29 -0
- package/src/Components/components/base/Loading/Dot/Dot.scss +69 -0
- package/src/Components/components/base/Loading/Dot/Dot.tsx +21 -0
- package/src/Components/components/base/Loading/Loading.scss +22 -0
- package/src/Components/components/base/Loading/Loading.tsx +47 -0
- package/src/Components/components/base/Loading/index.ts +3 -0
- package/src/Components/components/base/Message/Message.scss +61 -0
- package/src/Components/components/base/Message/Message.tsx +94 -0
- package/src/Components/components/base/Message/MessageIcon/Error.tsx +7 -0
- package/src/Components/components/base/Message/MessageIcon/Info.tsx +7 -0
- package/src/Components/components/base/Message/MessageIcon/Success.tsx +8 -0
- package/src/Components/components/base/Message/MessageIcon/Warning.tsx +7 -0
- package/src/Components/components/base/Message/MessagePlugin.tsx +148 -0
- package/src/Components/components/base/Overlayer/Overlayer.scss +17 -0
- package/src/Components/components/base/Overlayer/Overlayer.tsx +49 -0
- package/src/Components/components/base/Popup/Popup.scss +34 -0
- package/src/Components/components/base/Popup/Popup.tsx +91 -0
- package/src/Components/components/base/Popup/hooks/useTrigger.tsx +67 -0
- package/src/Components/components/base/Portal/Portal.tsx +74 -0
- package/src/Components/components/base/Text/Text.scss +15 -0
- package/src/Components/components/base/Text/Text.tsx +30 -0
- package/src/Components/components/base/Time/Time.scss +14 -0
- package/src/Components/components/base/Time/Time.tsx +13 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.scss +9 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindow.tsx +83 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.scss +51 -0
- package/src/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.tsx +50 -0
- package/src/Components/components/base/ToggleWindow/index.ts +7 -0
- package/src/Components/components/base/common.ts +13 -0
- package/src/Components/components/base/hooks/useControlled.ts +31 -0
- package/src/Components/components/base/hooks/useDrag.ts +96 -0
- package/src/Components/components/base/hooks/useListenerEvent.ts +37 -0
- package/src/Components/components/base/hooks/useMutationObserver.ts +38 -0
- package/src/Components/components/base/hooks/useOnClickOutSide.ts +24 -0
- package/src/Components/components/base/util/index.ts +26 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanel.tsx +127 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.module.scss +67 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.tsx +153 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.module.scss +9 -0
- package/src/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.tsx +32 -0
- package/src/Components/components/common/ButtonPanel/button/Accept/Accept.module.scss +7 -0
- package/src/Components/components/common/ButtonPanel/button/Accept/Accept.tsx +39 -0
- package/src/Components/components/common/ButtonPanel/button/Accept/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.module.scss +15 -0
- package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.tsx +46 -0
- package/src/Components/components/common/ButtonPanel/button/BackgroundBlur/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Camera.tsx +81 -0
- package/src/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.module.scss +13 -0
- package/src/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.tsx +26 -0
- package/src/Components/components/common/ButtonPanel/button/FullScreen/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Hangup/Hangup.module.scss +7 -0
- package/src/Components/components/common/ButtonPanel/button/Hangup/Hangup.tsx +42 -0
- package/src/Components/components/common/ButtonPanel/button/Hangup/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Microphone.tsx +78 -0
- package/src/Components/components/common/ButtonPanel/button/Minimize/Minimize.module.scss +23 -0
- package/src/Components/components/common/ButtonPanel/button/Minimize/Minimize.tsx +35 -0
- package/src/Components/components/common/ButtonPanel/button/Minimize/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Reject/Reject.module.scss +7 -0
- package/src/Components/components/common/ButtonPanel/button/Reject/Reject.tsx +39 -0
- package/src/Components/components/common/ButtonPanel/button/Reject/index.ts +3 -0
- package/src/Components/components/common/ButtonPanel/button/Speaker.tsx +75 -0
- package/src/Components/components/common/ButtonPanel/button/SwitchAudioCall.tsx +32 -0
- package/src/Components/components/common/ButtonPanel/button/SwitchCamera.tsx +19 -0
- package/src/Components/components/common/ButtonPanel/button/common.module.scss +51 -0
- package/src/Components/components/common/ButtonPanel/config.ts +505 -0
- package/src/Components/components/common/ButtonPanel/index.ts +3 -0
- package/src/Components/components/common/CallMessage/CallMessage.tsx +18 -0
- package/src/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.module.scss +19 -0
- package/src/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.tsx +84 -0
- package/src/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.module.scss +5 -0
- package/src/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.tsx +37 -0
- package/src/Components/components/common/CallMessage/index.ts +3 -0
- package/src/Components/components/common/DeviceSelector/DeviceSelector.module.scss +62 -0
- package/src/Components/components/common/DeviceSelector/DeviceSelector.tsx +105 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindow.tsx +37 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/FloatingWindowGroupCall.tsx +97 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/FloatingWindowGroupCall.module.scss +2 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/mobile.module.scss +126 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowGroupCall/style/pc.module.scss +126 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/FloatingWindowSingleCall.tsx +75 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/FloatingWindowSingleCall.module.scss +2 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/mobile.module.scss +117 -0
- package/src/Components/components/common/FloatingWindow/FloatingWindowSingleCall/style/pc.module.scss +123 -0
- package/src/Components/components/common/FloatingWindow/index.ts +3 -0
- package/src/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.module.scss +9 -0
- package/src/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.tsx +50 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.module.scss +165 -0
- package/src/Components/components/common/OverlayStream/OverlayStream.tsx +119 -0
- package/src/Components/components/common/Player/Player.module.scss +11 -0
- package/src/Components/components/common/Player/Player.tsx +75 -0
- package/src/Components/components/common/Pusher/Pusher.module.scss +10 -0
- package/src/Components/components/common/Pusher/Pusher.tsx +96 -0
- package/src/Components/components/common/StreamInfo/StreamInfo.tsx +10 -0
- package/src/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.module.scss +21 -0
- package/src/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.tsx +95 -0
- package/src/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.module.scss +38 -0
- package/src/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.tsx +35 -0
- package/src/Components/components/common/StreamInfo/index.ts +3 -0
- package/src/Components/components/common/Tip/Tip.tsx +68 -0
- package/src/Components/components/common/TopBar/TopBar.tsx +17 -0
- package/src/Components/components/common/TopBar/h5/TopBarH5.module.scss +12 -0
- package/src/Components/components/common/TopBar/h5/TopBarH5.tsx +40 -0
- package/src/Components/components/common/TopBar/pc/TopBarPC.module.scss +8 -0
- package/src/Components/components/common/TopBar/pc/TopBarPC.tsx +36 -0
- package/src/Components/const/common.ts +15 -0
- package/src/Components/context/CallUserInfoContext.ts +21 -0
- package/src/Components/context/CallerUserInfoContext.ts +11 -0
- package/src/Components/context/CustomUIConfigContext.ts +6 -0
- package/src/Components/context/FocusItemContext.ts +13 -0
- package/src/Components/context/IsClickableContext.ts +5 -0
- package/src/Components/context/TranslateContext.ts +6 -0
- package/src/Components/context/UserInfoContext.ts +9 -0
- package/src/Components/context/index.ts +17 -0
- package/src/Components/hooks/index.ts +9 -0
- package/src/Components/hooks/useCallDuration.ts +34 -0
- package/src/Components/hooks/useCustomButtonUIConfig.ts +27 -0
- package/src/Components/hooks/useDeviceList.ts +53 -0
- package/src/Components/hooks/useGetSpeakers.ts +69 -0
- package/src/Components/hooks/useGetVolumeMap.ts +67 -0
- package/src/Components/hooks/useNetWorkStatus.ts +34 -0
- package/src/Components/hooks/useTranslate.ts +7 -0
- package/src/Components/hooks/useViewBackgroundConfig.ts +8 -0
- package/src/Components/style/common/mixin.scss +22 -0
- package/src/Components/style/common/var.scss +21 -0
- package/src/Components/style/index.scss +5 -0
- package/src/Components/style/theme/_dark.scss +56 -0
- package/src/Components/style/theme/_light.scss +56 -0
- package/src/Components/style/theme/_util.scss +79 -0
- package/src/Components/style/theme/color.scss +23 -0
- package/src/Components/util/classnames.ts +35 -0
- package/src/Components/util/index.ts +138 -0
- package/src/Components/util/uiDesign.ts +45 -0
- package/src/TUICallService/CallService/UIDesign.ts +174 -0
- package/src/TUICallService/CallService/bellContext.ts +88 -0
- package/src/TUICallService/CallService/chatCombine.ts +313 -0
- package/src/TUICallService/CallService/engineEventHandler.ts +404 -0
- package/src/TUICallService/CallService/index.ts +797 -0
- package/src/TUICallService/CallService/miniProgram.ts +65 -0
- package/src/TUICallService/CallService/utils.ts +281 -0
- package/src/TUICallService/TUIGlobal/tuiGlobal.ts +43 -0
- package/src/TUICallService/TUIStore/callStore.ts +93 -0
- package/src/TUICallService/TUIStore/tuiStore.ts +167 -0
- package/src/TUICallService/assets/phone_dialing.mp3 +0 -0
- package/src/TUICallService/assets/phone_ringing.mp3 +0 -0
- package/src/TUICallService/const/call.ts +157 -0
- package/src/TUICallService/const/error.ts +20 -0
- package/src/TUICallService/const/index.ts +103 -0
- package/src/TUICallService/const/log.ts +9 -0
- package/src/TUICallService/index.ts +37 -0
- package/src/TUICallService/interface/ICallService.ts +70 -0
- package/src/TUICallService/interface/ICallStore.ts +55 -0
- package/src/TUICallService/interface/ITUIGlobal.ts +36 -0
- package/src/TUICallService/interface/ITUIStore.ts +87 -0
- package/src/TUICallService/interface/index.ts +4 -0
- package/src/TUICallService/locales/en.ts +135 -0
- package/src/TUICallService/locales/index.ts +61 -0
- package/src/TUICallService/locales/ja_JP.ts +134 -0
- package/src/TUICallService/locales/zh-cn.ts +130 -0
- package/src/TUICallService/serve/callManager.ts +109 -0
- package/src/TUICallService/utils/common-utils.ts +269 -0
- package/src/TUICallService/utils/decorators/promise-retry.ts +51 -0
- package/src/TUICallService/utils/env.ts +51 -0
- package/src/TUICallService/utils/index.ts +32 -0
- package/src/TUICallService/utils/is-empty.ts +31 -0
- package/src/TUICallService/utils/retry.ts +88 -0
- package/src/TUICallService/utils/timer.ts +162 -0
- package/src/TUICallService/utils/validate/avoidRepeatedCall.ts +39 -0
- package/src/TUICallService/utils/validate/index.ts +7 -0
- package/src/TUICallService/utils/validate/validateConfig.ts +188 -0
- package/src/TUICallService/utils/validate/validateParams.ts +88 -0
- package/src/TUICallService/utils/validate/validateStatus.ts +26 -0
- package/src/image.d.ts +8 -0
- package/src/index.ts +63 -0
- package/src/style.d.ts +1 -0
- package/tuicall-uikit-react.es.js +13177 -0
- package/tuicall-uikit-react.umd.js +133 -0
- package/types/Components/TUICallKit/TUICallKit.d.ts +15 -0
- package/types/Components/TUICallKit/index.d.ts +2 -0
- package/types/Components/assets/permission/desktop/index.d.ts +5 -0
- package/types/Components/components/GroupCall/GroupCall.d.ts +1 -0
- package/types/Components/components/GroupCall/MediaContainer/AudioStream/AudioStream.d.ts +10 -0
- package/types/Components/components/GroupCall/MediaContainer/MediaContainer.d.ts +1 -0
- package/types/Components/components/GroupCall/MediaContainer/StreamLoading/StreamLoading.d.ts +7 -0
- package/types/Components/components/GroupCall/MediaContainer/index.d.ts +2 -0
- package/types/Components/components/GroupCall/Waiting/Waiting.d.ts +8 -0
- package/types/Components/components/SingleCall/MediaContainer/AudioStream/AudioStream.d.ts +11 -0
- package/types/Components/components/SingleCall/MediaContainer/MediaContainer.d.ts +1 -0
- package/types/Components/components/SingleCall/MediaContainer/hooks/useGetLargeViewName.d.ts +3 -0
- package/types/Components/components/SingleCall/MediaContainer/index.d.ts +2 -0
- package/types/Components/components/SingleCall/SingleCall.d.ts +3 -0
- package/types/Components/components/SingleCall/Waiting/Waiting.d.ts +9 -0
- package/types/Components/components/base/Avatar/Avatar.d.ts +12 -0
- package/types/Components/components/base/Avatar/index.d.ts +2 -0
- package/types/Components/components/base/Button/Button.d.ts +25 -0
- package/types/Components/components/base/Button/index.d.ts +2 -0
- package/types/Components/components/base/Drag/Drag.d.ts +14 -0
- package/types/Components/components/base/Drag/index.d.ts +2 -0
- package/types/Components/components/base/Grid/Col/Col.d.ts +14 -0
- package/types/Components/components/base/Grid/Col/index.d.ts +2 -0
- package/types/Components/components/base/Grid/Row/Row.d.ts +14 -0
- package/types/Components/components/base/Grid/Row/index.d.ts +3 -0
- package/types/Components/components/base/GridLayout/GridLayout.d.ts +11 -0
- package/types/Components/components/base/GridLayout/GridPlusItem/GridPlusItem.d.ts +14 -0
- package/types/Components/components/base/GridLayout/index.d.ts +3 -0
- package/types/Components/components/base/Icon/Icon.d.ts +9 -0
- package/types/Components/components/base/Loading/Circle/Cilrcle.d.ts +6 -0
- package/types/Components/components/base/Loading/Dot/Dot.d.ts +6 -0
- package/types/Components/components/base/Loading/Loading.d.ts +14 -0
- package/types/Components/components/base/Loading/index.d.ts +2 -0
- package/types/Components/components/base/Message/Message.d.ts +16 -0
- package/types/Components/components/base/Message/MessageIcon/Error.d.ts +1 -0
- package/types/Components/components/base/Message/MessageIcon/Info.d.ts +1 -0
- package/types/Components/components/base/Message/MessageIcon/Success.d.ts +1 -0
- package/types/Components/components/base/Message/MessageIcon/Warning.d.ts +1 -0
- package/types/Components/components/base/Message/MessagePlugin.d.ts +14 -0
- package/types/Components/components/base/Overlayer/Overlayer.d.ts +14 -0
- package/types/Components/components/base/Popup/Popup.d.ts +13 -0
- package/types/Components/components/base/Popup/hooks/useTrigger.d.ts +10 -0
- package/types/Components/components/base/Portal/Portal.d.ts +19 -0
- package/types/Components/components/base/Text/Text.d.ts +10 -0
- package/types/Components/components/base/Time/Time.d.ts +7 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindow.d.ts +15 -0
- package/types/Components/components/base/ToggleWindow/ToggleWindowItem/ToggleWindowItem.d.ts +14 -0
- package/types/Components/components/base/ToggleWindow/index.d.ts +3 -0
- package/types/Components/components/base/common.d.ts +7 -0
- package/types/Components/components/base/hooks/useControlled.d.ts +8 -0
- package/types/Components/components/base/hooks/useDrag.d.ts +6 -0
- package/types/Components/components/base/hooks/useListenerEvent.d.ts +13 -0
- package/types/Components/components/base/hooks/useMutationObserver.d.ts +4 -0
- package/types/Components/components/base/hooks/useOnClickOutSide.d.ts +1 -0
- package/types/Components/components/base/util/index.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/ButtonPanel.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/ButtonPanelH5/ButtonPanelH5.d.ts +8 -0
- package/types/Components/components/common/ButtonPanel/ButtonPanelPC/ButtonPanelPC.d.ts +6 -0
- package/types/Components/components/common/ButtonPanel/button/Accept/Accept.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Accept/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/BackgroundBlur/BackgroundBlur.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/button/BackgroundBlur/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Camera.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/FullScreen/FullScreen.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/FullScreen/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Hangup/Hangup.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Hangup/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Microphone.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Minimize/Minimize.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/button/Minimize/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Reject/Reject.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/Reject/index.d.ts +2 -0
- package/types/Components/components/common/ButtonPanel/button/Speaker.d.ts +5 -0
- package/types/Components/components/common/ButtonPanel/button/SwitchAudioCall.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/button/SwitchCamera.d.ts +1 -0
- package/types/Components/components/common/ButtonPanel/config.d.ts +254 -0
- package/types/Components/components/common/ButtonPanel/index.d.ts +2 -0
- package/types/Components/components/common/CallMessage/CallMessage.d.ts +10 -0
- package/types/Components/components/common/CallMessage/CallMessageC2C/CallMessageC2C.d.ts +2 -0
- package/types/Components/components/common/CallMessage/CallMessageGroup/CallMessageGroup.d.ts +2 -0
- package/types/Components/components/common/CallMessage/index.d.ts +2 -0
- package/types/Components/components/common/DeviceSelector/DeviceSelector.d.ts +7 -0
- package/types/Components/components/common/FloatingWindow/FloatingWindow.d.ts +10 -0
- package/types/Components/components/common/FloatingWindow/FloatingWindowGroupCall/FloatingWindowGroupCall.d.ts +9 -0
- package/types/Components/components/common/FloatingWindow/FloatingWindowSingleCall/FloatingWindowSingleCall.d.ts +10 -0
- package/types/Components/components/common/FloatingWindow/index.d.ts +2 -0
- package/types/Components/components/common/MicrophoneVolumn/MicrophoneVolumn.d.ts +8 -0
- package/types/Components/components/common/OverlayStream/OverlayStream.d.ts +28 -0
- package/types/Components/components/common/Player/Player.d.ts +15 -0
- package/types/Components/components/common/Pusher/Pusher.d.ts +13 -0
- package/types/Components/components/common/StreamInfo/StreamInfo.d.ts +1 -0
- package/types/Components/components/common/StreamInfo/StreamInfoH5/StreamInfoH5.d.ts +10 -0
- package/types/Components/components/common/StreamInfo/StreamInfoPC/StreamInfoPC.d.ts +9 -0
- package/types/Components/components/common/StreamInfo/index.d.ts +2 -0
- package/types/Components/components/common/Tip/Tip.d.ts +7 -0
- package/types/Components/components/common/TopBar/TopBar.d.ts +1 -0
- package/types/Components/components/common/TopBar/h5/TopBarH5.d.ts +5 -0
- package/types/Components/components/common/TopBar/pc/TopBarPC.d.ts +5 -0
- package/types/Components/const/common.d.ts +11 -0
- package/types/Components/context/CallUserInfoContext.d.ts +17 -0
- package/types/Components/context/CallerUserInfoContext.d.ts +7 -0
- package/types/Components/context/CustomUIConfigContext.d.ts +3 -0
- package/types/Components/context/FocusItemContext.d.ts +8 -0
- package/types/Components/context/IsClickableContext.d.ts +2 -0
- package/types/Components/context/TranslateContext.d.ts +4 -0
- package/types/Components/context/UserInfoContext.d.ts +6 -0
- package/types/Components/context/index.d.ts +8 -0
- package/types/Components/hooks/index.d.ts +4 -0
- package/types/Components/hooks/useCallDuration.d.ts +1 -0
- package/types/Components/hooks/useCustomButtonUIConfig.d.ts +1 -0
- package/types/Components/hooks/useDeviceList.d.ts +8 -0
- package/types/Components/hooks/useGetSpeakers.d.ts +1 -0
- package/types/Components/hooks/useGetVolumeMap.d.ts +3 -0
- package/types/Components/hooks/useNetWorkStatus.d.ts +1 -0
- package/types/Components/hooks/useTranslate.d.ts +3 -0
- package/types/Components/hooks/useViewBackgroundConfig.d.ts +1 -0
- package/types/Components/util/classnames.d.ts +1 -0
- package/types/Components/util/index.d.ts +15 -0
- package/types/Components/util/uiDesign.d.ts +2 -0
- package/types/TUICallService/CallService/UIDesign.d.ts +28 -0
- package/types/TUICallService/CallService/bellContext.d.ts +19 -0
- package/types/TUICallService/CallService/chatCombine.d.ts +50 -0
- package/types/TUICallService/CallService/engineEventHandler.d.ts +35 -0
- package/types/TUICallService/CallService/index.d.ts +98 -0
- package/types/TUICallService/CallService/miniProgram.d.ts +7 -0
- package/types/TUICallService/CallService/utils.d.ts +42 -0
- package/types/TUICallService/TUIGlobal/tuiGlobal.d.ts +21 -0
- package/types/TUICallService/TUIStore/callStore.d.ts +10 -0
- package/types/TUICallService/TUIStore/tuiStore.d.ts +57 -0
- package/types/TUICallService/const/call.d.ts +141 -0
- package/types/TUICallService/const/error.d.ts +2 -0
- package/types/TUICallService/const/index.d.ts +27 -0
- package/types/TUICallService/const/log.d.ts +7 -0
- package/types/TUICallService/index.d.ts +5 -0
- package/types/TUICallService/interface/ICallService.d.ts +69 -0
- package/types/TUICallService/interface/ICallStore.d.ts +47 -0
- package/types/TUICallService/interface/ITUIGlobal.d.ts +36 -0
- package/types/TUICallService/interface/ITUIStore.d.ts +83 -0
- package/types/TUICallService/interface/index.d.ts +4 -0
- package/types/TUICallService/locales/en.d.ts +128 -0
- package/types/TUICallService/locales/index.d.ts +10 -0
- package/types/TUICallService/locales/ja_JP.d.ts +127 -0
- package/types/TUICallService/locales/zh-cn.d.ts +123 -0
- package/types/TUICallService/serve/callManager.d.ts +11 -0
- package/types/TUICallService/utils/common-utils.d.ts +62 -0
- package/types/TUICallService/utils/decorators/promise-retry.d.ts +32 -0
- package/types/TUICallService/utils/env.d.ts +10 -0
- package/types/TUICallService/utils/index.d.ts +2 -0
- package/types/TUICallService/utils/is-empty.d.ts +2 -0
- package/types/TUICallService/utils/retry.d.ts +36 -0
- package/types/TUICallService/utils/timer.d.ts +63 -0
- package/types/TUICallService/utils/validate/avoidRepeatedCall.d.ts +10 -0
- package/types/TUICallService/utils/validate/index.d.ts +2 -0
- package/types/TUICallService/utils/validate/validateConfig.d.ts +173 -0
- package/types/TUICallService/utils/validate/validateParams.d.ts +1 -0
- package/types/TUICallService/utils/validate/validateStatus.d.ts +5 -0
- package/types/index.d.ts +11 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @property {String} call 1v1 通话 + 群组通话
|
|
3
|
+
* @property {String} CUSTOM 自定义 Store
|
|
4
|
+
*/
|
|
5
|
+
export enum StoreName {
|
|
6
|
+
CALL = 'call',
|
|
7
|
+
CUSTOM = 'custom'
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @property {String} idle 空闲
|
|
11
|
+
* @property {String} connecting 呼叫等待中
|
|
12
|
+
* @property {String} connected 通话中
|
|
13
|
+
*/
|
|
14
|
+
export enum CallMediaType {
|
|
15
|
+
UNKNOWN,
|
|
16
|
+
AUDIO,
|
|
17
|
+
VIDEO,
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @property {String} caller 主叫
|
|
21
|
+
* @property {String} callee 被叫
|
|
22
|
+
*/
|
|
23
|
+
export enum CallRole {
|
|
24
|
+
UNKNOWN = 'unknown',
|
|
25
|
+
CALLEE = 'callee',
|
|
26
|
+
CALLER = 'caller',
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @property {String} idle 空闲
|
|
30
|
+
* @property {String} calling 呼叫等待中
|
|
31
|
+
* @property {String} connected 通话中
|
|
32
|
+
*/
|
|
33
|
+
export enum CallStatus {
|
|
34
|
+
IDLE = 'idle',
|
|
35
|
+
CALLING = 'calling',
|
|
36
|
+
CONNECTED = 'connected',
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 视频画面显示模式
|
|
40
|
+
* 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。
|
|
41
|
+
* @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。
|
|
42
|
+
* @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗
|
|
43
|
+
* @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持)
|
|
44
|
+
*/
|
|
45
|
+
export enum VideoDisplayMode {
|
|
46
|
+
CONTAIN = 'contain',
|
|
47
|
+
COVER = 'cover',
|
|
48
|
+
FILL = 'fill',
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 视频分辨率
|
|
52
|
+
* @property {String} 480p
|
|
53
|
+
* @property {String} 720p
|
|
54
|
+
* @property {String} 1080p
|
|
55
|
+
*/
|
|
56
|
+
export enum VideoResolution {
|
|
57
|
+
RESOLUTION_480P = '480p',
|
|
58
|
+
RESOLUTION_720P = '720p',
|
|
59
|
+
RESOLUTION_1080P = '1080p',
|
|
60
|
+
}
|
|
61
|
+
// 支持的语言
|
|
62
|
+
export enum LanguageType {
|
|
63
|
+
EN = 'en',
|
|
64
|
+
'ZH-CN' = 'zh-cn',
|
|
65
|
+
JA_JP = 'ja_JP',
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type TDeviceList = {
|
|
69
|
+
cameraList: any[],
|
|
70
|
+
microphoneList: any[],
|
|
71
|
+
currentCamera: any,
|
|
72
|
+
currentMicrophone: any,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/* === 【原来 TUICallKit 对外暴露】=== */
|
|
76
|
+
// 原来 web callKit 定义通知外部状态变更的变量, 对外暴露
|
|
77
|
+
export const StatusChange = {
|
|
78
|
+
IDLE: "idle",
|
|
79
|
+
BE_INVITED: "be-invited",
|
|
80
|
+
DIALING_C2C: "dialing-c2c",
|
|
81
|
+
DIALING_GROUP: "dialing-group",
|
|
82
|
+
CALLING_C2C_AUDIO: "calling-c2c-audio",
|
|
83
|
+
CALLING_C2C_VIDEO: "calling-c2c-video",
|
|
84
|
+
CALLING_GROUP_AUDIO: "calling-group-audio",
|
|
85
|
+
CALLING_GROUP_VIDEO: "calling-group-video",
|
|
86
|
+
} as const;
|
|
87
|
+
|
|
88
|
+
export const CallType = {
|
|
89
|
+
'unknown': CallMediaType.UNKNOWN,
|
|
90
|
+
'audio': CallMediaType.AUDIO,
|
|
91
|
+
'video': CallMediaType.VIDEO,
|
|
92
|
+
} as const;
|
|
93
|
+
|
|
94
|
+
/* === 【小程序使用】=== */
|
|
95
|
+
/**
|
|
96
|
+
* @property {String} ear 听筒
|
|
97
|
+
* @property {String} speaker 免提
|
|
98
|
+
*/
|
|
99
|
+
export enum AudioPlayBackDevice {
|
|
100
|
+
EAR = 'ear',
|
|
101
|
+
SPEAKER = 'speaker',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export enum DeviceType {
|
|
105
|
+
MICROPHONE = 'microphone',
|
|
106
|
+
CAMERA = 'camera',
|
|
107
|
+
SPEAKER = 'speaker',
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export enum CameraPosition {
|
|
111
|
+
FRONT = 0,
|
|
112
|
+
BACK = 1,
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export enum FeatureButton {
|
|
116
|
+
Camera = 'camera',
|
|
117
|
+
Microphone = 'microphone',
|
|
118
|
+
SwitchCamera = 'switchCamera',
|
|
119
|
+
InviteUser = 'inviteUser',
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export enum ButtonState {
|
|
123
|
+
Open = 'open',
|
|
124
|
+
Close = 'close',
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface IViewBackgroundImage {
|
|
128
|
+
[userId: string]: string,
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export enum ViewName {
|
|
132
|
+
LOCAL = 'local',
|
|
133
|
+
REMOTE = 'remote',
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export enum LayoutMode {
|
|
137
|
+
LocalInLargeView = ViewName.LOCAL,
|
|
138
|
+
RemoteInLargeView = ViewName.REMOTE,
|
|
139
|
+
}
|
|
140
|
+
export interface ICustomUIConfig {
|
|
141
|
+
button?: {
|
|
142
|
+
[buttonName in FeatureButton]?: {
|
|
143
|
+
show: boolean;
|
|
144
|
+
state: ButtonState;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
viewBackground?: IViewBackgroundImage;
|
|
148
|
+
layoutMode?: LayoutMode,
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export enum ACTION_TYPE {
|
|
152
|
+
INVITE = 1,
|
|
153
|
+
CANCEL_INVITE = 2,
|
|
154
|
+
ACCEPT_INVITE = 3,
|
|
155
|
+
REJECT_INVITE = 4,
|
|
156
|
+
INVITE_TIMEOUT = 5,
|
|
157
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 错误码
|
|
2
|
+
export const ErrorCode: any = {
|
|
3
|
+
SWITCH_TO_AUDIO_CALL_FAILED: 60001,
|
|
4
|
+
SWITCH_TO_VIDEO_CALL_FAILED: 60002,
|
|
5
|
+
MICROPHONE_UNAVAILABLE: 60003,
|
|
6
|
+
CAMERA_UNAVAILABLE: 60004,
|
|
7
|
+
BAN_DEVICE: 60005,
|
|
8
|
+
NOT_SUPPORTED_WEBRTC: 60006,
|
|
9
|
+
ERROR_BLACKLIST: 20007,
|
|
10
|
+
} as const;
|
|
11
|
+
|
|
12
|
+
export const ErrorMessage: any = {
|
|
13
|
+
SWITCH_TO_AUDIO_CALL_FAILED: 'switchToAudioCall-call-failed',
|
|
14
|
+
SWITCH_TO_VIDEO_CALL_FAILED: 'switchToVideoCall-call-failed',
|
|
15
|
+
MICROPHONE_UNAVAILABLE: 'microphone-unavailable',
|
|
16
|
+
CAMERA_UNAVAILABLE: 'camera-unavailable',
|
|
17
|
+
BAN_DEVICE: 'ban-device',
|
|
18
|
+
NOT_SUPPORTED_WEBRTC: 'not-supported-webrtc',
|
|
19
|
+
ERROR_BLACKLIST: 'blacklist-user-tips'
|
|
20
|
+
} as const;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export * from './call';
|
|
2
|
+
export * from './error';
|
|
3
|
+
export * from './log';
|
|
4
|
+
|
|
5
|
+
export const CALL_DATA_KEY: any = {
|
|
6
|
+
CALL_STATUS: 'callStatus',
|
|
7
|
+
CALL_ROLE: 'callRole',
|
|
8
|
+
CALL_MEDIA_TYPE: 'callMediaType',
|
|
9
|
+
LOCAL_USER_INFO: 'localUserInfo',
|
|
10
|
+
LOCAL_USER_INFO_EXCLUDE_VOLUMN: 'localUserInfoExcludeVolume',
|
|
11
|
+
REMOTE_USER_INFO_LIST: 'remoteUserInfoList',
|
|
12
|
+
REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST: 'remoteUserInfoExcludeVolumeList',
|
|
13
|
+
CALLER_USER_INFO: 'callerUserInfo',
|
|
14
|
+
IS_GROUP: 'isGroup',
|
|
15
|
+
CALL_DURATION: 'callDuration',
|
|
16
|
+
CALL_TIPS: 'callTips',
|
|
17
|
+
TOAST_INFO: 'toastInfo',
|
|
18
|
+
IS_MINIMIZED: 'isMinimized',
|
|
19
|
+
ENABLE_FLOAT_WINDOW: 'enableFloatWindow',
|
|
20
|
+
BIG_SCREEN_USER_ID: 'bigScreenUserId',
|
|
21
|
+
LANGUAGE: 'language',
|
|
22
|
+
IS_CLICKABLE: 'isClickable',
|
|
23
|
+
DISPLAY_MODE: 'displayMode',
|
|
24
|
+
VIDEO_RESOLUTION: 'videoResolution',
|
|
25
|
+
PUSHER: 'pusher',
|
|
26
|
+
PLAYER: 'player',
|
|
27
|
+
IS_EAR_PHONE: 'isEarPhone',
|
|
28
|
+
IS_MUTE_SPEAKER: 'isMuteSpeaker',
|
|
29
|
+
SHOW_PERMISSION_TIP: 'SHOW_PERMISSION_TIP',
|
|
30
|
+
NETWORK_STATUS: 'NetWorkStatus',
|
|
31
|
+
CALL_ID: 'callID',
|
|
32
|
+
GROUP_ID: 'groupID',
|
|
33
|
+
ROOM_ID: 'roomID',
|
|
34
|
+
ROOM_ID_TYPE: 'roomIdType',
|
|
35
|
+
SHOW_SELECT_USER: 'showSelectUser',
|
|
36
|
+
IS_SHOW_ENABLE_VIRTUAL_BACKGROUND: 'isShowEnableVirtualBackground',
|
|
37
|
+
ENABLE_VIRTUAL_BACKGROUND: 'enableVirtualBackground',
|
|
38
|
+
GROUP_CALL_MEMBERS: 'groupCallMembers',
|
|
39
|
+
PUSHER_ID: 'pusherId',
|
|
40
|
+
IS_FORCE_USE_V2_API: 'isForceUseV2API',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const CHAT_DATA_KEY: any = {
|
|
44
|
+
"INNER_ATTR_KIT_INFO": "inner_attr_kit_info",
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const PUSHER_ID = {
|
|
48
|
+
INITIAL_PUSHER: 'initialPusher',
|
|
49
|
+
NEW_PUSHER: 'newPusher'
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const NAME = {
|
|
53
|
+
PREFIX: '【CallService】',
|
|
54
|
+
AUDIO: 'audio',
|
|
55
|
+
VIDEO: 'video',
|
|
56
|
+
LOCAL_VIDEO: 'localVideo',
|
|
57
|
+
ERROR: 'error',
|
|
58
|
+
TIMEOUT: 'timeout',
|
|
59
|
+
RAF: 'raf',
|
|
60
|
+
INTERVAL: 'interval',
|
|
61
|
+
DEFAULT: 'default',
|
|
62
|
+
BOOLEAN: 'boolean',
|
|
63
|
+
STRING: 'string',
|
|
64
|
+
NUMBER: 'number',
|
|
65
|
+
OBJECT: 'object',
|
|
66
|
+
ARRAY: 'array',
|
|
67
|
+
FUNCTION: 'function',
|
|
68
|
+
UNDEFINED: "undefined",
|
|
69
|
+
UNKNOWN: 'unknown',
|
|
70
|
+
ALL: 'all',
|
|
71
|
+
MYSELF: 'myself',
|
|
72
|
+
DEVICE_LIST: 'deviceList',
|
|
73
|
+
CAMERA_POSITION: 'cameraPosition',
|
|
74
|
+
CUSTOM_UI_CONFIG: 'customUIConfig',
|
|
75
|
+
TRANSLATE: 'translate',
|
|
76
|
+
...PUSHER_ID,
|
|
77
|
+
...CALL_DATA_KEY,
|
|
78
|
+
...CHAT_DATA_KEY,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const AudioCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call.png';
|
|
82
|
+
export const VideoCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg';
|
|
83
|
+
export const MAX_NUMBER_ROOM_ID = 2147483647;
|
|
84
|
+
export const DEFAULT_BLUR_LEVEL = 3;
|
|
85
|
+
export const NETWORK_QUALITY_THRESHOLD = 4;
|
|
86
|
+
export enum PLATFORM {
|
|
87
|
+
// eslint-disable-next-line no-unused-vars
|
|
88
|
+
MAC = 'mac',
|
|
89
|
+
// eslint-disable-next-line no-unused-vars
|
|
90
|
+
WIN = 'win',
|
|
91
|
+
};
|
|
92
|
+
export enum COMPONENT {
|
|
93
|
+
// eslint-disable-next-line no-unused-vars
|
|
94
|
+
TUI_CALL_KIT = 14,
|
|
95
|
+
// eslint-disable-next-line no-unused-vars
|
|
96
|
+
TIM_CALL_KIT = 15,
|
|
97
|
+
};
|
|
98
|
+
export enum ROOM_ID_TYPE {
|
|
99
|
+
// eslint-disable-next-line no-unused-vars
|
|
100
|
+
NUMBER_ROOM_ID = 1,
|
|
101
|
+
// eslint-disable-next-line no-unused-vars
|
|
102
|
+
STRING_ROOM_ID = 2,
|
|
103
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// 唯一一个变量格式有问题的, 但是为了和原来 TUICallKit 对外暴露的保持一致
|
|
3
|
+
export enum LOG_LEVEL {
|
|
4
|
+
NORMAL = 0, // 普通级别,日志量较多,接入时建议使用
|
|
5
|
+
RELEASE = 1, // release级别,SDK 输出关键信息,生产环境时建议使用
|
|
6
|
+
WARNING = 2, // 告警级别,SDK 只输出告警和错误级别的日志
|
|
7
|
+
ERROR = 3, // 错误级别,SDK 只输出错误级别的日志
|
|
8
|
+
NONE = 4, // 无日志级别,SDK 将不打印任何日志
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import TUICallService, { TUIGlobal, TUIStore, uiDesign } from './CallService/index';
|
|
2
|
+
import {
|
|
3
|
+
StoreName,
|
|
4
|
+
NAME,
|
|
5
|
+
CallRole,
|
|
6
|
+
CallMediaType,
|
|
7
|
+
CallStatus,
|
|
8
|
+
StatusChange,
|
|
9
|
+
VideoResolution,
|
|
10
|
+
VideoDisplayMode,
|
|
11
|
+
AudioPlayBackDevice,
|
|
12
|
+
FeatureButton,
|
|
13
|
+
LayoutMode,
|
|
14
|
+
} from './const/index';
|
|
15
|
+
import { t } from './locales/index';
|
|
16
|
+
|
|
17
|
+
// 实例化
|
|
18
|
+
const TUICallKitAPI = TUICallService.getInstance();
|
|
19
|
+
// 输出产物
|
|
20
|
+
export {
|
|
21
|
+
TUIGlobal,
|
|
22
|
+
TUIStore,
|
|
23
|
+
StoreName,
|
|
24
|
+
TUICallKitAPI,
|
|
25
|
+
NAME,
|
|
26
|
+
CallStatus,
|
|
27
|
+
CallRole,
|
|
28
|
+
CallMediaType,
|
|
29
|
+
StatusChange,
|
|
30
|
+
VideoResolution,
|
|
31
|
+
VideoDisplayMode,
|
|
32
|
+
AudioPlayBackDevice,
|
|
33
|
+
t,
|
|
34
|
+
uiDesign,
|
|
35
|
+
FeatureButton,
|
|
36
|
+
LayoutMode,
|
|
37
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CallStatus, CallRole } from '../const/index';
|
|
2
|
+
|
|
3
|
+
type SDKAppID = { SDKAppID: number; } | { sdkAppID: number; };
|
|
4
|
+
export interface IInitParamsBase {
|
|
5
|
+
userID: string;
|
|
6
|
+
userSig: string;
|
|
7
|
+
tim?: any;
|
|
8
|
+
isFromChat?: boolean;
|
|
9
|
+
component?: number;
|
|
10
|
+
}
|
|
11
|
+
export type IInitParams = IInitParamsBase & SDKAppID;
|
|
12
|
+
// calls params interface
|
|
13
|
+
export interface ICallsParams {
|
|
14
|
+
userIDList: Array<string>;
|
|
15
|
+
type: number;
|
|
16
|
+
chatGroupID?: string;
|
|
17
|
+
roomID?: number;
|
|
18
|
+
strRoomID?: string;
|
|
19
|
+
userData?: string;
|
|
20
|
+
timeout?: number;
|
|
21
|
+
offlinePushInfo?: IOfflinePushInfo;
|
|
22
|
+
}
|
|
23
|
+
// userInfo interface
|
|
24
|
+
export interface IUserInfo {
|
|
25
|
+
userId: string;
|
|
26
|
+
nick?: string;
|
|
27
|
+
avatar?: string;
|
|
28
|
+
remark?: string;
|
|
29
|
+
displayUserInfo?: string; // 远端用户信息展示: remark -> nick -> userId, 简化 UI 组件; 本地用户信息展示: nick -> userId
|
|
30
|
+
isAudioAvailable?: boolean; // 用来设置: 麦克风是否打开
|
|
31
|
+
isVideoAvailable?: boolean; // 用来设置: 摄像头是否打开
|
|
32
|
+
volume?: number;
|
|
33
|
+
isEnter?: boolean; // 远端用户, 用来控制预览远端是否显示 loading 效果; 本地用户, 用来控制 "呼叫"、"接通" 接通后显示的 loading 效果
|
|
34
|
+
domId?: string; // 播放流 dom 节点, localUserInfo 的 domId = 'localVideo'; remoteUserInfo 的 domId 就是 userId
|
|
35
|
+
}
|
|
36
|
+
export interface IOfflinePushInfo {
|
|
37
|
+
title?: string,
|
|
38
|
+
description?: string,
|
|
39
|
+
androidOPPOChannelID?: string,
|
|
40
|
+
extension: String
|
|
41
|
+
}
|
|
42
|
+
export interface ICallbackParam {
|
|
43
|
+
beforeCalling?: (...args: any[]) => void;
|
|
44
|
+
afterCalling?: (...args: any[]) => void;
|
|
45
|
+
onMinimized?: (...args: any[]) => void;
|
|
46
|
+
onMessageSentByMe?: (...args: any[]) => void;
|
|
47
|
+
kickedOut?: (...args: any[]) => void;
|
|
48
|
+
statusChanged?: (...args: any[]) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ISelfInfoParams {
|
|
52
|
+
nickName: string;
|
|
53
|
+
avatar: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface IBellParams {
|
|
57
|
+
callRole?: CallRole;
|
|
58
|
+
callStatus?: CallStatus;
|
|
59
|
+
isMuteBell?: boolean;
|
|
60
|
+
calleeBellFilePath?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface IInviteUserParams {
|
|
63
|
+
userIDList: string[];
|
|
64
|
+
offlinePushInfo?: IOfflinePushInfo;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface INetWorkQuality {
|
|
68
|
+
userId: string;
|
|
69
|
+
quality: number
|
|
70
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList, CameraPosition, ICustomUIConfig } from '../const/index';
|
|
2
|
+
import { IUserInfo, INetWorkQuality } from './index';
|
|
3
|
+
|
|
4
|
+
export interface IToastInfo {
|
|
5
|
+
text: string;
|
|
6
|
+
type?: string; // 默认 info 通知, 取值: 'info' | 'warn' | 'success' | 'error'
|
|
7
|
+
}
|
|
8
|
+
export interface ICallStore {
|
|
9
|
+
callStatus: CallStatus; // 当前的通话状态, 默认: 'idle'
|
|
10
|
+
callRole: CallRole; // 通话角色, 默认: 'callee'
|
|
11
|
+
callMediaType: CallMediaType; // 通话类型
|
|
12
|
+
localUserInfo: IUserInfo; // 自己的信息, 默认: { userId: '' }
|
|
13
|
+
localUserInfoExcludeVolume: IUserInfo; // 不包含音量的当前用户信息
|
|
14
|
+
remoteUserInfoList: Array<IUserInfo>; // 远端用户信息列表, 默认: []
|
|
15
|
+
remoteUserInfoExcludeVolumeList: Array<IUserInfo>; // 不包含音量的远端用户信息列表
|
|
16
|
+
// 被叫在未接通时,展示主叫的 userId、头像。但是如果主叫进入通话后再挂断,此时被叫无法知道主叫的信息了。
|
|
17
|
+
// 因为目前 store 中仅提供了 remoteUserInfoList 数据,主叫离开后,被叫就没有主叫的信息了。因此考虑在 store 中增加 callerUserInfo 字段。
|
|
18
|
+
callerUserInfo: IUserInfo;
|
|
19
|
+
isGroup: boolean; // 是否是群组通话, 默认: false
|
|
20
|
+
callDuration: string; // 通话时长, 默认: '00:00:00'
|
|
21
|
+
callTips: string; // 通话提示的信息. 例如: '等待谁接听', 'xxx 拒绝通话', 'xxx 挂断通话'
|
|
22
|
+
toastInfo: IToastInfo; // 远端用户挂断、拒绝、超时、忙线等的 toast 提示信息
|
|
23
|
+
isMinimized: boolean; // 当前是否悬浮窗模式, 默认: false
|
|
24
|
+
enableFloatWindow: boolean, // 开启/关闭悬浮窗功能,默认: false
|
|
25
|
+
bigScreenUserId: string, // 当前大屏幕显示的 userID 用户
|
|
26
|
+
language: string; // 当前语言
|
|
27
|
+
isClickable: boolean; // 按钮是否可点击(呼叫后, '挂断' 按钮不可点击, 发送信令后才可以点击)
|
|
28
|
+
showPermissionTip: boolean; // 设备权限弹窗是否展示(如果有麦克风权限为 false,如果没有麦克风也没有摄像头权限为 true)
|
|
29
|
+
netWorkQualityList: Array<INetWorkQuality>; // 通话中用户的网络状态
|
|
30
|
+
deviceList: TDeviceList;
|
|
31
|
+
callID: string; // callEngine v3.1 support
|
|
32
|
+
groupID: string;
|
|
33
|
+
roomID: number | string;
|
|
34
|
+
roomIdType: number;
|
|
35
|
+
cameraPosition: CameraPosition; // 前置或后置,值为front, back
|
|
36
|
+
isMuteSpeaker: boolean;
|
|
37
|
+
groupCallMembers: IUserInfo[]; // chat 群会话中在通话的成员
|
|
38
|
+
// TUICallKit 组件上的属性
|
|
39
|
+
displayMode: VideoDisplayMode; // 设置预览远端的画面显示模式, 默认: VideoDisplayMode.COVER
|
|
40
|
+
videoResolution: VideoResolution; // 设置视频分辨率, 默认: VideoResolution.RESOLUTION_720P
|
|
41
|
+
// 小程序相关属性
|
|
42
|
+
pusher: any;
|
|
43
|
+
player: any[];
|
|
44
|
+
isEarPhone: boolean; // 是否是听筒, 默认: false
|
|
45
|
+
showSelectUser: boolean;
|
|
46
|
+
// 是否开启虚拟背景, 目前仅 web 支持
|
|
47
|
+
isShowEnableVirtualBackground: boolean, // 是否显示虚拟背景图标, 默认: false
|
|
48
|
+
enableVirtualBackground: boolean, // 是否开启虚拟背景, 默认: false
|
|
49
|
+
// customUIConfig
|
|
50
|
+
customUIConfig: ICustomUIConfig,
|
|
51
|
+
pusherId: string, // 重新渲染 live-Pusher 的标识位
|
|
52
|
+
// translate function
|
|
53
|
+
translate: Function,
|
|
54
|
+
isForceUseV2API: boolean, // 是否使用 call/groupCall 接口, 默认: false
|
|
55
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @interface TUIGlobal
|
|
3
|
+
* @property {Object} global 根据运行环境代理 wx、uni、window
|
|
4
|
+
* @property {Boolean} isPC true 标识是 pc 网页
|
|
5
|
+
* @property {Boolean} isH5 true 标识是 手机 H5
|
|
6
|
+
* @property {Boolean} isWeChat true 标识是 微信小程序
|
|
7
|
+
* @property {Boolean} isApp true 标识是 uniapp 打包的 native app
|
|
8
|
+
* @property {Boolean} isUniPlatform true 标识当前应用是通过 uniapp 平台打包的产物
|
|
9
|
+
* @property {Boolean} isOfficial true 标识是腾讯云官网 Demo 应用
|
|
10
|
+
* @property {Boolean} isWIN true 标识是window系统pc
|
|
11
|
+
* @property {Boolean} isMAC true 标识是mac os系统pc
|
|
12
|
+
*/
|
|
13
|
+
export interface ITUIGlobal {
|
|
14
|
+
global: any; // 挂在 wx、uni、window 对象
|
|
15
|
+
isPC: boolean;
|
|
16
|
+
isH5: boolean;
|
|
17
|
+
isWeChat: boolean;
|
|
18
|
+
isApp: boolean;
|
|
19
|
+
isUniPlatform: boolean;
|
|
20
|
+
isOfficial: boolean;
|
|
21
|
+
isWIN: boolean;
|
|
22
|
+
isMAC: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 初始化 TUIGlobal 环境变量
|
|
25
|
+
* @function
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
initEnv(): void;
|
|
29
|
+
/**
|
|
30
|
+
* 初始化 isOfficial
|
|
31
|
+
* @function
|
|
32
|
+
* @param {number} SDKAppID 当前实例的应用 SDKAppID
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
initOfficial(SDKAppID: number): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { StoreName } from '../const/index';
|
|
2
|
+
|
|
3
|
+
// 此处 Map 的 value = 1 为占位作用
|
|
4
|
+
export type Task = Record<StoreName, Record<string, Map<(data?: unknown) => void, 1>>>
|
|
5
|
+
|
|
6
|
+
export interface IOptions {
|
|
7
|
+
[key: string]: (newData?: any) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @class TUIStore
|
|
12
|
+
* @property {ICustomStore} customStore 自定义 store,可根据业务需要通过以下 API 进行数据操作。
|
|
13
|
+
*/
|
|
14
|
+
export interface ITUIStore {
|
|
15
|
+
task: Task;
|
|
16
|
+
/**
|
|
17
|
+
* UI 组件注册监听
|
|
18
|
+
* @function
|
|
19
|
+
* @param {StoreName} storeName store 名称
|
|
20
|
+
* @param {IOptions} options UI 组件注册的监听信息
|
|
21
|
+
* @param {Object} params 扩展参数
|
|
22
|
+
* @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围
|
|
23
|
+
* @example
|
|
24
|
+
* // UI 层监听会话列表更新通知
|
|
25
|
+
* let onConversationListUpdated = function(conversationList) {
|
|
26
|
+
* console.warn(conversationList);
|
|
27
|
+
* }
|
|
28
|
+
* TUIStore.watch(StoreName.CONV, {
|
|
29
|
+
* conversationList: onConversationListUpdated,
|
|
30
|
+
* })
|
|
31
|
+
*/
|
|
32
|
+
watch(storeName: StoreName, options: IOptions, params?: any): void;
|
|
33
|
+
/**
|
|
34
|
+
* UI 组件取消监听回调
|
|
35
|
+
* @function
|
|
36
|
+
* @param {StoreName} storeName store 名称
|
|
37
|
+
* @param {IOptions} options 监听信息,包含需要取消的回调等
|
|
38
|
+
* @example
|
|
39
|
+
* // UI 层取消监听会话列表更新通知
|
|
40
|
+
* TUIStore.unwatch(StoreName.CONV, {
|
|
41
|
+
* conversationList: onConversationListUpdated,
|
|
42
|
+
* })
|
|
43
|
+
*/
|
|
44
|
+
unwatch(storeName: StoreName, options: IOptions | string): void;
|
|
45
|
+
/**
|
|
46
|
+
* 获取 store 中的上一个状态
|
|
47
|
+
* @function
|
|
48
|
+
* @param {StoreName} storeName store 名称
|
|
49
|
+
* @param {String} key 需要获取的 key
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
getPrevData(storeName: StoreName, key: string): any;
|
|
53
|
+
/**
|
|
54
|
+
* 获取 store 中的数据
|
|
55
|
+
* @function
|
|
56
|
+
* @param {StoreName} storeName store 名称
|
|
57
|
+
* @param {String} key 需要获取的 key
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
getData(storeName: StoreName, key: string): any;
|
|
61
|
+
/**
|
|
62
|
+
* 更新 store
|
|
63
|
+
* - 需要使用自定义 store 时可以用此 API 更新自定义数据
|
|
64
|
+
* @function
|
|
65
|
+
* @param {StoreName} storeName store 名称
|
|
66
|
+
* @param {String} key 需要更新的 key
|
|
67
|
+
* @example
|
|
68
|
+
* // UI 层更新自定义 Store 数据
|
|
69
|
+
* TUIStore.update(StoreName.CUSTOM, 'customKey', 'customData')
|
|
70
|
+
*/
|
|
71
|
+
update(storeName: StoreName, key: string, data: unknown): void;
|
|
72
|
+
/**
|
|
73
|
+
* 重置 store 内数据
|
|
74
|
+
* @function
|
|
75
|
+
* @param {StoreName} storeName store 名称
|
|
76
|
+
* @param {Array<string>} keyList 需要 reset 的 keyList
|
|
77
|
+
* @param {boolean} isNotificationNeeded 是否需要触发更新
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
reset: (storeName: StoreName, keyList?: Array<string>, isNotificationNeeded?: boolean) => void;
|
|
81
|
+
/**
|
|
82
|
+
* 修改多个 key-value
|
|
83
|
+
* @param {Object} params 多个 key-value 组成的 object
|
|
84
|
+
* @param {StoreName} storeName store 名称
|
|
85
|
+
*/
|
|
86
|
+
updateStore: (params: any, name?: StoreName) => void;
|
|
87
|
+
}
|