@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,39 @@
|
|
|
1
|
+
import { NAME } from '../../const/index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 装饰器:阻止函数重复调用
|
|
5
|
+
* @export
|
|
6
|
+
* @param {Object} options 入参
|
|
7
|
+
* @param {Function} options.fn 函数
|
|
8
|
+
* @param {Object} options.context 上下文对象
|
|
9
|
+
* @param {String} options.name 函数名
|
|
10
|
+
* @returns {Function} 封装后的函数
|
|
11
|
+
*/
|
|
12
|
+
export function avoidRepeatedCall() {
|
|
13
|
+
return function (target: any, name: string, descriptor: any) {
|
|
14
|
+
const oldFn = descriptor.value;
|
|
15
|
+
const isCallingSet = new Set();
|
|
16
|
+
descriptor.value = async function (...args: any[]) {
|
|
17
|
+
if (isCallingSet.has(this)) {
|
|
18
|
+
console.warn((`${NAME.PREFIX}previous ${name}() is ongoing, please avoid repeated calls`));
|
|
19
|
+
// throw new Error(`previous ${name}() is ongoing, please avoid repeated calls`);
|
|
20
|
+
this?.getTUICallEngineInstance()?.reportLog?.({
|
|
21
|
+
name: 'TUICallKit.avoidRepeatedCall.fail',
|
|
22
|
+
data: { name },
|
|
23
|
+
error: `previous ${name}() is ongoing`,
|
|
24
|
+
});
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
isCallingSet.add(this);
|
|
29
|
+
const result = await oldFn.apply(this, args);
|
|
30
|
+
isCallingSet.delete(this);
|
|
31
|
+
return result;
|
|
32
|
+
} catch (error) {
|
|
33
|
+
isCallingSet.delete(this);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return descriptor;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { NAME, MAX_NUMBER_ROOM_ID, VideoResolution, VideoDisplayMode } from "../../const/index";
|
|
2
|
+
|
|
3
|
+
export const VALIDATE_PARAMS = {
|
|
4
|
+
init: {
|
|
5
|
+
SDKAppID: {
|
|
6
|
+
required: true,
|
|
7
|
+
rules: [NAME.NUMBER],
|
|
8
|
+
allowEmpty: false,
|
|
9
|
+
},
|
|
10
|
+
userID: {
|
|
11
|
+
required: true,
|
|
12
|
+
rules: [NAME.STRING],
|
|
13
|
+
allowEmpty: false,
|
|
14
|
+
},
|
|
15
|
+
userSig: {
|
|
16
|
+
required: true,
|
|
17
|
+
rules: [NAME.STRING],
|
|
18
|
+
allowEmpty: false,
|
|
19
|
+
},
|
|
20
|
+
tim: {
|
|
21
|
+
required: false,
|
|
22
|
+
rules: [NAME.OBJECT],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
call: {
|
|
26
|
+
userID: {
|
|
27
|
+
required: true,
|
|
28
|
+
rules: [NAME.STRING],
|
|
29
|
+
allowEmpty: false
|
|
30
|
+
},
|
|
31
|
+
type: {
|
|
32
|
+
required: true,
|
|
33
|
+
rules: [NAME.NUMBER],
|
|
34
|
+
range: [1, 2],
|
|
35
|
+
allowEmpty: false
|
|
36
|
+
},
|
|
37
|
+
roomID: {
|
|
38
|
+
required: false,
|
|
39
|
+
rules: [NAME.NUMBER], // 仅支持数字房间号, 后续会支持字符串房间号
|
|
40
|
+
range: `1~${MAX_NUMBER_ROOM_ID}`,
|
|
41
|
+
allowEmpty: false,
|
|
42
|
+
},
|
|
43
|
+
userData: {
|
|
44
|
+
required: false,
|
|
45
|
+
rules: [NAME.STRING],
|
|
46
|
+
allowEmpty: false,
|
|
47
|
+
},
|
|
48
|
+
timeout: {
|
|
49
|
+
required: false,
|
|
50
|
+
rules: [NAME.NUMBER],
|
|
51
|
+
allowEmpty: false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
groupCall: {
|
|
55
|
+
userIDList: {
|
|
56
|
+
required: true,
|
|
57
|
+
rules: [NAME.ARRAY],
|
|
58
|
+
allowEmpty: false
|
|
59
|
+
},
|
|
60
|
+
type: {
|
|
61
|
+
required: true,
|
|
62
|
+
rules: [NAME.NUMBER],
|
|
63
|
+
range: [1, 2],
|
|
64
|
+
allowEmpty: false
|
|
65
|
+
},
|
|
66
|
+
groupID: {
|
|
67
|
+
required: true,
|
|
68
|
+
rules: [NAME.STRING],
|
|
69
|
+
allowEmpty: false
|
|
70
|
+
},
|
|
71
|
+
roomID: {
|
|
72
|
+
required: false,
|
|
73
|
+
rules: [NAME.NUMBER], // 仅支持数字房间号, 后续会支持字符串房间号
|
|
74
|
+
range: `1~${MAX_NUMBER_ROOM_ID}`,
|
|
75
|
+
allowEmpty: false
|
|
76
|
+
},
|
|
77
|
+
timeout: {
|
|
78
|
+
required: false,
|
|
79
|
+
rules: [NAME.NUMBER],
|
|
80
|
+
allowEmpty: false
|
|
81
|
+
},
|
|
82
|
+
userData: {
|
|
83
|
+
required: false,
|
|
84
|
+
rules: [NAME.STRING],
|
|
85
|
+
allowEmpty: false,
|
|
86
|
+
},
|
|
87
|
+
offlinePushInfo: {
|
|
88
|
+
required: false,
|
|
89
|
+
rules: [NAME.OBJECT],
|
|
90
|
+
allowEmpty: false,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
joinInGroupCall: {
|
|
94
|
+
type: {
|
|
95
|
+
required: true,
|
|
96
|
+
rules: [NAME.NUMBER],
|
|
97
|
+
range: [1, 2],
|
|
98
|
+
allowEmpty: false
|
|
99
|
+
},
|
|
100
|
+
groupID: {
|
|
101
|
+
required: true,
|
|
102
|
+
rules: [NAME.STRING],
|
|
103
|
+
allowEmpty: false
|
|
104
|
+
},
|
|
105
|
+
roomID: {
|
|
106
|
+
required: true,
|
|
107
|
+
rules: [NAME.NUMBER],
|
|
108
|
+
allowEmpty: false,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
inviteUser: {
|
|
112
|
+
userIDList: {
|
|
113
|
+
required: true,
|
|
114
|
+
rules: [NAME.ARRAY],
|
|
115
|
+
allowEmpty: false
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
setSelfInfo: {
|
|
119
|
+
nickName: {
|
|
120
|
+
required: false,
|
|
121
|
+
rules: [NAME.STRING],
|
|
122
|
+
allowEmpty: false,
|
|
123
|
+
},
|
|
124
|
+
avatar: {
|
|
125
|
+
required: false,
|
|
126
|
+
rules: [NAME.STRING],
|
|
127
|
+
allowEmpty: false,
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
enableFloatWindow: [
|
|
131
|
+
{
|
|
132
|
+
key: "enable",
|
|
133
|
+
required: false,
|
|
134
|
+
rules: [NAME.BOOLEAN],
|
|
135
|
+
allowEmpty: false,
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
enableAIVoice: [
|
|
139
|
+
{
|
|
140
|
+
key: "enable",
|
|
141
|
+
required: true,
|
|
142
|
+
rules: [NAME.BOOLEAN],
|
|
143
|
+
allowEmpty: false,
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
enableMuteMode: [
|
|
147
|
+
{
|
|
148
|
+
key: "enable",
|
|
149
|
+
required: true,
|
|
150
|
+
rules: [NAME.BOOLEAN],
|
|
151
|
+
allowEmpty: false,
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
setCallingBell: [
|
|
155
|
+
{
|
|
156
|
+
key: "filePath",
|
|
157
|
+
required: false,
|
|
158
|
+
rules: [NAME.STRING],
|
|
159
|
+
allowEmpty: true,
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
setLanguage: [
|
|
163
|
+
{
|
|
164
|
+
key: "language",
|
|
165
|
+
required: true,
|
|
166
|
+
rules: [NAME.STRING],
|
|
167
|
+
allowEmpty: false
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
setVideoDisplayMode: [
|
|
171
|
+
{
|
|
172
|
+
key: "displayMode",
|
|
173
|
+
required: true,
|
|
174
|
+
rules: [NAME.STRING],
|
|
175
|
+
range: [VideoDisplayMode.CONTAIN, VideoDisplayMode.COVER, VideoDisplayMode.FILL],
|
|
176
|
+
allowEmpty: false
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
setVideoResolution: [
|
|
180
|
+
{
|
|
181
|
+
key: "resolution",
|
|
182
|
+
required: true,
|
|
183
|
+
rules: [NAME.STRING],
|
|
184
|
+
range: [VideoResolution.RESOLUTION_1080P, VideoResolution.RESOLUTION_480P, VideoResolution.RESOLUTION_720P],
|
|
185
|
+
allowEmpty: false
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { getType, isArray, isString, isUndefined, isNumber, modifyObjectKey } from "../common-utils";
|
|
2
|
+
import { NAME } from "../../const/index";
|
|
3
|
+
const PREFIX = NAME.PREFIX + "API";
|
|
4
|
+
|
|
5
|
+
export function paramValidate (config: any) {
|
|
6
|
+
return function (target, propertyName: string, descriptor: PropertyDescriptor) {
|
|
7
|
+
let method = descriptor.value;
|
|
8
|
+
descriptor.value = function (...args) {
|
|
9
|
+
doValidate.call(this, config, args, propertyName);
|
|
10
|
+
return method.apply(this, args);
|
|
11
|
+
};
|
|
12
|
+
return descriptor;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function doValidate(config, args, name) {
|
|
16
|
+
try {
|
|
17
|
+
// 兼容 init 方法中: SDKAppID sdkAppID 两种写法的参数校验判断
|
|
18
|
+
if (!args[0].SDKAppID) {
|
|
19
|
+
config = modifyObjectKey(config, "SDKAppID", "sdkAppID");
|
|
20
|
+
}
|
|
21
|
+
if (isArray(config)) {
|
|
22
|
+
for (let i = 0; i < config.length; i++) {
|
|
23
|
+
check.call(this, {
|
|
24
|
+
...config[i],
|
|
25
|
+
value: args[i],
|
|
26
|
+
name,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
for (const key in config) {
|
|
31
|
+
if (config.hasOwnProperty(key)) {
|
|
32
|
+
check.call(this, {
|
|
33
|
+
...config[key],
|
|
34
|
+
value: args[0][key],
|
|
35
|
+
name,
|
|
36
|
+
key,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error(error);
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function check({ required, rules, range, value, allowEmpty, name, key }) {
|
|
47
|
+
// 用户没传指定参数
|
|
48
|
+
if (isUndefined(value)) {
|
|
49
|
+
// 检查必填参数, 若配置是必填则报错
|
|
50
|
+
if (required) {
|
|
51
|
+
throw new Error(`${PREFIX}<${name}>: ${key} is required.`);
|
|
52
|
+
} else {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// 判断参数类型是否正确
|
|
57
|
+
const result = rules.some((item)=>item === getType(value));
|
|
58
|
+
let type = '';
|
|
59
|
+
if (!result) {
|
|
60
|
+
for (let i = 0; i < rules.length; i++) {
|
|
61
|
+
let str = rules[i];
|
|
62
|
+
str = str.replace(str[0], str[0].toUpperCase());
|
|
63
|
+
type += `${str}/`;
|
|
64
|
+
}
|
|
65
|
+
type = type.substring(0, type.length - 1);
|
|
66
|
+
throw new Error(`${PREFIX}<${name}>: ${key} must be ${type}, current ${key} is ${typeof value}.`);
|
|
67
|
+
}
|
|
68
|
+
// 不允许传空值, 例如: '', ' '
|
|
69
|
+
if (allowEmpty === false) {
|
|
70
|
+
const isEmptyString = isString(value) && value.trim() === '';
|
|
71
|
+
if (isEmptyString) {
|
|
72
|
+
throw new Error(`${PREFIX}<${name}>: ${key} is blank.`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// 判断是否符合限制条件
|
|
76
|
+
if (isArray(range)) {
|
|
77
|
+
if (range && range.indexOf(value) === -1) {
|
|
78
|
+
throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// 取值范围, 前闭后闭
|
|
82
|
+
if (isString(range) && range.indexOf('~') !== -1) {
|
|
83
|
+
const valueList = range.split('~');
|
|
84
|
+
if (value < +valueList[0] || value > +valueList[1] || (isNumber(value) && Number.isNaN(value))) {
|
|
85
|
+
throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NAME } from "../../const/index";
|
|
2
|
+
import { t } from '../../locales/index';
|
|
3
|
+
|
|
4
|
+
interface IStatusValidateParams {
|
|
5
|
+
engineInstance?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function statusValidate (config: IStatusValidateParams) {
|
|
9
|
+
return function (target, propertyName: string, descriptor: PropertyDescriptor) {
|
|
10
|
+
let method = descriptor.value;
|
|
11
|
+
descriptor.value = function (...args: Array<any>) {
|
|
12
|
+
doValidate.call(this, config, args, propertyName);
|
|
13
|
+
return method.apply(this, args);
|
|
14
|
+
};
|
|
15
|
+
return descriptor;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function doValidate(config) {
|
|
20
|
+
if (config?.engineInstance && !this._tuiCallEngine) {
|
|
21
|
+
const error = `${NAME.PREFIX} ${t('TUICallKit init is not complete')}`;
|
|
22
|
+
console.error(error);
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
package/src/image.d.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TUIGlobal,
|
|
3
|
+
TUIStore,
|
|
4
|
+
StoreName,
|
|
5
|
+
TUICallKitAPI,
|
|
6
|
+
NAME,
|
|
7
|
+
StatusChange as STATUS,
|
|
8
|
+
CallRole,
|
|
9
|
+
CallMediaType,
|
|
10
|
+
VideoResolution,
|
|
11
|
+
VideoDisplayMode,
|
|
12
|
+
t,
|
|
13
|
+
uiDesign,
|
|
14
|
+
FeatureButton,
|
|
15
|
+
LayoutMode,
|
|
16
|
+
} from './TUICallService/index';
|
|
17
|
+
import CallMessage from './Components/components/common/CallMessage/CallMessage.tsx';
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
import TUICallKit from './Components/TUICallKit/TUICallKit.tsx';
|
|
20
|
+
const plugin = (TUICore) => {
|
|
21
|
+
TUICore.component('TUICallKit', { server: TUICallKitAPI });
|
|
22
|
+
TUICallKitAPI.bindTUICore(TUICore);
|
|
23
|
+
return TUICallKit;
|
|
24
|
+
};
|
|
25
|
+
const install = (app) => {
|
|
26
|
+
app.component('TUICallKit', TUICallKit);
|
|
27
|
+
console.log('TUICallKit&mini installed', app);
|
|
28
|
+
};
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
TUICallKit.plugin = plugin;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
TUICallKit.install = install;
|
|
33
|
+
// Web TUICallKit ≤v2.2.1 抛出的字段
|
|
34
|
+
const TUICallType = {
|
|
35
|
+
AUDIO_CALL: 1,
|
|
36
|
+
VIDEO_CALL: 2,
|
|
37
|
+
};
|
|
38
|
+
const Version = '4.1.0'; // basic-demo 原来上报使用
|
|
39
|
+
|
|
40
|
+
// 输出产物
|
|
41
|
+
export {
|
|
42
|
+
TUIGlobal,
|
|
43
|
+
TUIStore,
|
|
44
|
+
StoreName,
|
|
45
|
+
TUICallKitAPI,
|
|
46
|
+
// uni-app 打包小程序无法引入 vue 组件, 只能在使用侧单独引入 vue 文件
|
|
47
|
+
TUICallKit,
|
|
48
|
+
plugin,
|
|
49
|
+
install,
|
|
50
|
+
TUICallType,
|
|
51
|
+
NAME,
|
|
52
|
+
STATUS,
|
|
53
|
+
CallRole,
|
|
54
|
+
CallMediaType,
|
|
55
|
+
VideoResolution,
|
|
56
|
+
VideoDisplayMode,
|
|
57
|
+
Version,
|
|
58
|
+
t,
|
|
59
|
+
uiDesign,
|
|
60
|
+
FeatureButton,
|
|
61
|
+
LayoutMode,
|
|
62
|
+
CallMessage,
|
|
63
|
+
};
|
package/src/style.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '*.module.scss'
|