@cloud-app-dev/vidc 4.0.20 → 4.0.21
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/es/AppContext/Sync.d.ts +8 -0
- package/es/AppContext/Sync.js +42 -0
- package/es/AppContext/index.d.ts +10 -0
- package/es/AppContext/index.js +141 -0
- package/es/AppContext/interface.d.ts +41 -0
- package/es/AppContext/static.d.ts +8 -0
- package/es/AppContext/static.js +9 -0
- package/es/Auth/index.d.ts +8 -0
- package/es/Auth/index.js +14 -0
- package/es/AutoExit/index.d.ts +6 -0
- package/es/AutoExit/index.js +19 -0
- package/es/CheckGroupFixed/demo.d.ts +3 -0
- package/es/CheckGroupFixed/demo.js +22 -0
- package/es/CheckGroupFixed/index.d.ts +24 -0
- package/es/CheckGroupFixed/index.js +140 -0
- package/es/CheckGroupFixed/index.less +56 -0
- package/es/Config/index.d.ts +4 -0
- package/es/Config/index.js +77 -0
- package/es/Config/interface.d.ts +65 -0
- package/es/Config/utils.d.ts +4 -0
- package/es/Config/utils.js +33 -0
- package/es/ConfigContext/index.d.ts +17 -0
- package/es/ConfigContext/index.js +21 -0
- package/es/CustomRenderSelect/index.d.ts +12 -0
- package/es/CustomRenderSelect/index.js +73 -0
- package/es/CustomRenderSelect/index.less +25 -0
- package/es/DBTools/index.d.ts +25 -0
- package/es/DBTools/index.js +336 -0
- package/es/DisableMark/index.d.ts +9 -0
- package/es/DisableMark/index.js +19 -0
- package/es/DisableMark/index.less +9 -0
- package/es/DomMove/demo.d.ts +2 -0
- package/es/DomMove/demo.js +16 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/index.js +139 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/DomMove/utils.js +32 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DragAndDropItem.js +134 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/DropItem.js +50 -0
- package/es/Drag/index.d.ts +7 -0
- package/es/Drag/index.js +7 -0
- package/es/Drag/interface.d.ts +16 -0
- package/es/DynamicGridList/Demo.d.ts +3 -0
- package/es/DynamicGridList/Demo.js +77 -0
- package/es/DynamicGridList/index.d.ts +24 -0
- package/es/DynamicGridList/index.js +67 -0
- package/es/DynamicList/demo.d.ts +2 -0
- package/es/DynamicList/demo.js +44 -0
- package/es/DynamicList/index.d.ts +22 -0
- package/es/DynamicList/index.js +86 -0
- package/es/DynamicList/index.less +17 -0
- package/es/DynamicList/interface.d.ts +19 -0
- package/es/DynamicList/utils.d.ts +4 -0
- package/es/DynamicList/utils.js +6 -0
- package/es/ErrorFallback/index.d.ts +9 -0
- package/es/ErrorFallback/index.js +31 -0
- package/es/ErrorFallback/inerface.d.ts +48 -0
- package/es/EventTools/index.d.ts +3 -0
- package/es/EventTools/index.js +12 -0
- package/es/FrontendPlayer/index.d.ts +4 -0
- package/es/FrontendPlayer/index.js +2 -0
- package/es/FullScreen/index.d.ts +22 -0
- package/es/FullScreen/index.js +33 -0
- package/es/FullScreen/index.less +18 -0
- package/es/GridList/Demo.d.ts +3 -0
- package/es/GridList/Demo.js +80 -0
- package/es/GridList/data.d.ts +16 -0
- package/es/GridList/data.js +609 -0
- package/es/GridList/hook.d.ts +13 -0
- package/es/GridList/hook.js +270 -0
- package/es/GridList/index.d.ts +15 -0
- package/es/GridList/index.js +44 -0
- package/es/GridList/index.less +8 -0
- package/es/GridList/interface.d.ts +59 -0
- package/es/GridList/utils.d.ts +9 -0
- package/es/GridList/utils.js +42 -0
- package/es/HightLevel/index.d.ts +9 -0
- package/es/HightLevel/index.js +18 -0
- package/es/HightLevel/index.less +3 -0
- package/es/IconFont/index.d.ts +12 -0
- package/es/IconFont/index.js +54 -0
- package/es/ImageView/index.d.ts +20 -0
- package/es/ImageView/index.js +51 -0
- package/es/ImageView/index.less +11 -0
- package/es/InstanceHistory/index.d.ts +3 -0
- package/es/InstanceHistory/index.js +7 -0
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +2 -0
- package/es/LabelPlayer/demo.js +115 -0
- package/es/LabelPlayer/index.d.ts +21 -0
- package/es/LabelPlayer/index.js +160 -0
- package/es/LabelPlayer/index.less +24 -0
- package/es/LabelValue/index.d.ts +15 -0
- package/es/LabelValue/index.js +27 -0
- package/es/LabelValue/index.less +23 -0
- package/es/List/demo.d.ts +3 -0
- package/es/List/demo.js +23 -0
- package/es/List/index.d.ts +28 -0
- package/es/List/index.js +28 -0
- package/es/List/index.less +20 -0
- package/es/ListWithSizeAnimate/demo.d.ts +2 -0
- package/es/ListWithSizeAnimate/demo.js +98 -0
- package/es/ListWithSizeAnimate/index.d.ts +14 -0
- package/es/ListWithSizeAnimate/index.js +85 -0
- package/es/ListWithSizeAnimate/index.less +23 -0
- package/es/LoaderScript/index.d.ts +47 -0
- package/es/LoaderScript/index.js +34 -0
- package/es/LoaderScript/utils.d.ts +13 -0
- package/es/LoaderScript/utils.js +179 -0
- package/es/Map/AMap.d.ts +7109 -0
- package/es/Map/BasicMap/AMapInstance.d.ts +19 -0
- package/es/Map/BasicMap/AMapInstance.js +98 -0
- package/es/Map/BasicMap/LeafletInstance.d.ts +18 -0
- package/es/Map/BasicMap/LeafletInstance.js +111 -0
- package/es/Map/BasicMap/index.d.ts +9 -0
- package/es/Map/BasicMap/index.js +90 -0
- package/es/Map/BasicMap/index.less +29 -0
- package/es/Map/ClusterLayer/demo.d.ts +3 -0
- package/es/Map/ClusterLayer/demo.js +18 -0
- package/es/Map/ClusterLayer/hook.d.ts +5 -0
- package/es/Map/ClusterLayer/hook.js +123 -0
- package/es/Map/ClusterLayer/index.d.ts +6 -0
- package/es/Map/ClusterLayer/index.js +28 -0
- package/es/Map/ClusterLayer/index.less +29 -0
- package/es/Map/ClusterLayer/props.d.ts +8 -0
- package/es/Map/Config/index.d.ts +9 -0
- package/es/Map/Config/index.js +48 -0
- package/es/Map/Config/utils.d.ts +2 -0
- package/es/Map/Config/utils.js +65 -0
- package/es/Map/Context/index.d.ts +11 -0
- package/es/Map/Context/index.js +51 -0
- package/es/Map/FindPio/index.d.ts +4 -0
- package/es/Map/FindPio/index.js +13 -0
- package/es/Map/FindPio/index.less +7 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +4 -0
- package/es/Map/InfoWindow/MakerLikeWindow.js +112 -0
- package/es/Map/InfoWindow/demo.d.ts +3 -0
- package/es/Map/InfoWindow/demo.js +70 -0
- package/es/Map/InfoWindow/index.d.ts +11 -0
- package/es/Map/InfoWindow/index.js +66 -0
- package/es/Map/LevelCenter/DragMarker/index.d.ts +10 -0
- package/es/Map/LevelCenter/DragMarker/index.js +42 -0
- package/es/Map/LevelCenter/demo.d.ts +3 -0
- package/es/Map/LevelCenter/demo.js +38 -0
- package/es/Map/LevelCenter/index.d.ts +15 -0
- package/es/Map/LevelCenter/index.js +66 -0
- package/es/Map/LoaderMap/index.d.ts +7 -0
- package/es/Map/LoaderMap/index.js +62 -0
- package/es/Map/MapDrawSelect/demo.d.ts +3 -0
- package/es/Map/MapDrawSelect/demo.js +71 -0
- package/es/Map/MapDrawSelect/index.d.ts +15 -0
- package/es/Map/MapDrawSelect/index.js +56 -0
- package/es/Map/MouseTool/index.d.ts +10 -0
- package/es/Map/MouseTool/index.js +40 -0
- package/es/Map/MouseTool/useMouseTools.d.ts +7 -0
- package/es/Map/MouseTool/useMouseTools.js +83 -0
- package/es/Map/ResetTools/index.d.ts +10 -0
- package/es/Map/ResetTools/index.js +57 -0
- package/es/Map/ResetTools/index.less +39 -0
- package/es/Map/SinglePoint/demo.d.ts +3 -0
- package/es/Map/SinglePoint/demo.js +14 -0
- package/es/Map/SinglePoint/index.d.ts +27 -0
- package/es/Map/SinglePoint/index.js +52 -0
- package/es/Map/SinglePoint/index.less +41 -0
- package/es/Map/hook/useMapEvent.d.ts +2 -0
- package/es/Map/hook/useMapEvent.js +19 -0
- package/es/Map/hook/useMapType.d.ts +4 -0
- package/es/Map/hook/useMapType.js +12 -0
- package/es/Map/icon.d.ts +2 -0
- package/es/Map/icon.js +10 -0
- package/es/Map/index.d.ts +24 -0
- package/es/Map/index.js +25 -0
- package/es/Map/interface.d.ts +74 -0
- package/es/Map/points.d.ts +50 -0
- package/es/Map/points.js +1 -0
- package/es/Map/useMarker/index.d.ts +10 -0
- package/es/Map/useMarker/index.js +71 -0
- package/es/Map/withMap/index.d.ts +3 -0
- package/es/Map/withMap/index.js +10 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +8 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +80 -0
- package/es/Picture/component/DefaultRects/index.d.ts +13 -0
- package/es/Picture/component/DefaultRects/index.js +52 -0
- package/es/Picture/component/DefaultRects/index.less +211 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DefaultRects/utils.js +11 -0
- package/es/Picture/component/DrawRect/index.d.ts +13 -0
- package/es/Picture/component/DrawRect/index.js +46 -0
- package/es/Picture/component/DrawRect/index.less +8 -0
- package/es/Picture/component/RectMenu/index.d.ts +12 -0
- package/es/Picture/component/RectMenu/index.js +76 -0
- package/es/Picture/component/RectMenu/index.less +36 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/RectMenu/utils.js +19 -0
- package/es/Picture/component/Tools/index.d.ts +12 -0
- package/es/Picture/component/Tools/index.js +73 -0
- package/es/Picture/component/Tools/index.less +49 -0
- package/es/Picture/component/WheelScale/index.d.ts +7 -0
- package/es/Picture/component/WheelScale/index.js +27 -0
- package/es/Picture/demo.d.ts +2 -0
- package/es/Picture/demo.js +105 -0
- package/es/Picture/index.d.ts +5 -0
- package/es/Picture/index.js +341 -0
- package/es/Picture/index.less +20 -0
- package/es/Picture/interface.d.ts +196 -0
- package/es/Picture/loadCaptureRectImage.d.ts +3 -0
- package/es/Picture/loadCaptureRectImage.js +99 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/useDraw.js +103 -0
- package/es/Picture/utils.d.ts +26 -0
- package/es/Picture/utils.js +143 -0
- package/es/Player/api/index.d.ts +68 -0
- package/es/Player/api/index.js +309 -0
- package/es/Player/context.d.ts +17 -0
- package/es/Player/context.js +24 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +20 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
- package/es/Player/contraller_bar/contraller_event.js +50 -0
- package/es/Player/contraller_bar/index.d.ts +14 -0
- package/es/Player/contraller_bar/index.js +27 -0
- package/es/Player/contraller_bar/left_bar.d.ts +10 -0
- package/es/Player/contraller_bar/left_bar.js +83 -0
- package/es/Player/contraller_bar/right_bar.d.ts +8 -0
- package/es/Player/contraller_bar/right_bar.js +32 -0
- package/es/Player/contraller_bar/time.d.ts +3 -0
- package/es/Player/contraller_bar/time.js +19 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
- package/es/Player/contraller_bar/useBarStatus.js +43 -0
- package/es/Player/contraller_bar/volume.d.ts +9 -0
- package/es/Player/contraller_bar/volume.js +62 -0
- package/es/Player/demo.d.ts +3 -0
- package/es/Player/demo.js +266 -0
- package/es/Player/empty.d.ts +2 -0
- package/es/Player/empty.js +4 -0
- package/es/Player/event/errorEvent.d.ts +14 -0
- package/es/Player/event/errorEvent.js +88 -0
- package/es/Player/event/eventName.d.ts +18 -0
- package/es/Player/event/eventName.js +29 -0
- package/es/Player/event/index.d.ts +24 -0
- package/es/Player/event/index.js +205 -0
- package/es/Player/fps_play.d.ts +11 -0
- package/es/Player/fps_play.js +83 -0
- package/es/Player/frontend_player.d.ts +8 -0
- package/es/Player/frontend_player.js +64 -0
- package/es/Player/frontend_timeline.d.ts +10 -0
- package/es/Player/frontend_timeline.js +132 -0
- package/es/Player/iconfont.d.ts +5 -0
- package/es/Player/iconfont.js +16 -0
- package/es/Player/index.d.ts +2 -0
- package/es/Player/index.js +2 -0
- package/es/Player/live_heart.d.ts +8 -0
- package/es/Player/live_heart.js +45 -0
- package/es/Player/message.d.ts +5 -0
- package/es/Player/message.js +137 -0
- package/es/Player/player.d.ts +233 -0
- package/es/Player/segment_player.d.ts +9 -0
- package/es/Player/segment_player.js +228 -0
- package/es/Player/segment_timeline.d.ts +12 -0
- package/es/Player/segment_timeline.js +173 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +262 -0
- package/es/Player/style/bar.less +43 -0
- package/es/Player/style/iconfont.js +43 -0
- package/es/Player/style/index.less +34 -0
- package/es/Player/style/message.less +56 -0
- package/es/Player/style/slider.less +106 -0
- package/es/Player/style/timeline.less +117 -0
- package/es/Player/style/volume.less +24 -0
- package/es/Player/timeline.d.ts +5 -0
- package/es/Player/timeline.js +95 -0
- package/es/Player/util.d.ts +43 -0
- package/es/Player/util.js +189 -0
- package/es/PlayerExt/demo.d.ts +3 -0
- package/es/PlayerExt/demo.js +154 -0
- package/es/PlayerExt/index.d.ts +48 -0
- package/es/PlayerExt/index.js +188 -0
- package/es/PlayerExt/index.less +10 -0
- package/es/Progress/index.d.ts +7 -0
- package/es/Progress/index.js +53 -0
- package/es/Progress/index.less +21 -0
- package/es/ROI/demo.d.ts +3 -0
- package/es/ROI/demo.js +16 -0
- package/es/ROI/index.d.ts +33 -0
- package/es/ROI/index.js +54 -0
- package/es/ROI/index.less +33 -0
- package/es/RefDrawer/Footer.d.ts +9 -0
- package/es/RefDrawer/Footer.js +22 -0
- package/es/RefDrawer/demo.d.ts +3 -0
- package/es/RefDrawer/demo.js +18 -0
- package/es/RefDrawer/index.d.ts +26 -0
- package/es/RefDrawer/index.js +71 -0
- package/es/RefModal/demo.d.ts +3 -0
- package/es/RefModal/demo.js +18 -0
- package/es/RefModal/index.d.ts +17 -0
- package/es/RefModal/index.js +70 -0
- package/es/ScreenPlayer/Live.d.ts +5 -0
- package/es/ScreenPlayer/Live.js +212 -0
- package/es/ScreenPlayer/LiveTools.d.ts +29 -0
- package/es/ScreenPlayer/LiveTools.js +151 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
- package/es/ScreenPlayer/PlayerWithExt.js +231 -0
- package/es/ScreenPlayer/RatePick.d.ts +8 -0
- package/es/ScreenPlayer/RatePick.js +29 -0
- package/es/ScreenPlayer/Record.d.ts +10 -0
- package/es/ScreenPlayer/Record.js +442 -0
- package/es/ScreenPlayer/RecordTools.d.ts +38 -0
- package/es/ScreenPlayer/RecordTools.js +197 -0
- package/es/ScreenPlayer/ScreenSelect.d.ts +7 -0
- package/es/ScreenPlayer/ScreenSelect.js +46 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +17 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +36 -0
- package/es/ScreenPlayer/TimeMode.d.ts +7 -0
- package/es/ScreenPlayer/TimeMode.js +26 -0
- package/es/ScreenPlayer/TimeSelect.d.ts +7 -0
- package/es/ScreenPlayer/TimeSelect.js +88 -0
- package/es/ScreenPlayer/demo.d.ts +2 -0
- package/es/ScreenPlayer/demo.js +21 -0
- package/es/ScreenPlayer/demo2.d.ts +2 -0
- package/es/ScreenPlayer/demo2.js +194 -0
- package/es/ScreenPlayer/index.d.ts +6 -0
- package/es/ScreenPlayer/index.js +9 -0
- package/es/ScreenPlayer/index.less +335 -0
- package/es/ScreenPlayer/interface.d.ts +216 -0
- package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
- package/es/ScreenPlayer/useTimeSlider.js +451 -0
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/useVideoFit.js +35 -0
- package/es/ScreenPlayer/utils.d.ts +17 -0
- package/es/ScreenPlayer/utils.js +85 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/SegmentPlayer/index.js +2 -0
- package/es/Service/http.d.ts +6 -0
- package/es/Service/http.js +133 -0
- package/es/Service/index.d.ts +3 -0
- package/es/Service/index.js +11 -0
- package/es/Service/interface.d.ts +23 -0
- package/es/Service/middleware.d.ts +8 -0
- package/es/Service/middleware.js +22 -0
- package/es/SocketEmitter/eventEmitter.d.ts +27 -0
- package/es/SocketEmitter/eventEmitter.js +88 -0
- package/es/SocketEmitter/index.d.ts +24 -0
- package/es/SocketEmitter/index.js +125 -0
- package/es/SocketEmitter/interface.d.ts +4 -0
- package/es/TableLayout/index.d.ts +10 -0
- package/es/TableLayout/index.js +27 -0
- package/es/TableLayout/index.less +4 -0
- package/es/ThemeAntd/demo.d.ts +4 -0
- package/es/ThemeAntd/demo.js +81 -0
- package/es/ThemeAntd/demo.less +20 -0
- package/es/ThemeAntd/index.d.ts +7 -0
- package/es/ThemeAntd/index.js +21 -0
- package/es/ThemeAntd/index.less +4 -0
- package/es/Timeout/index.d.ts +26 -0
- package/es/Timeout/index.js +65 -0
- package/es/bigNumberTransformCN/index.d.ts +5 -0
- package/es/bigNumberTransformCN/index.js +58 -0
- package/es/cache/index.d.ts +34 -0
- package/es/cache/index.js +94 -0
- package/es/copy/index.d.ts +1 -0
- package/es/copy/index.js +9 -0
- package/es/core.d.ts +0 -0
- package/es/getThemeStyle/index.d.ts +2 -0
- package/es/getThemeStyle/index.js +5 -0
- package/es/index.d.ts +62 -0
- package/es/index.js +62 -0
- package/es/likeGo/index.d.ts +2 -0
- package/es/likeGo/index.js +31 -0
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +7 -0
- package/es/logger/index.js +30 -0
- package/es/nextTick/index.d.ts +1 -0
- package/es/nextTick/index.js +3 -0
- package/es/recorder/demo.d.ts +3 -0
- package/es/recorder/demo.js +181 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +992 -0
- package/es/submidstr/index.d.ts +5 -0
- package/es/submidstr/index.js +14 -0
- package/es/treeHelper/index.d.ts +11 -0
- package/es/treeHelper/index.js +188 -0
- package/es/typings.d.ts +2 -0
- package/es/useDrawROI/index.d.ts +16 -0
- package/es/useDrawROI/index.js +318 -0
- package/es/useEventEmitterHandle/index.d.ts +2 -0
- package/es/useEventEmitterHandle/index.js +17 -0
- package/es/useFullscreen/demo.d.ts +2 -0
- package/es/useFullscreen/demo.js +43 -0
- package/es/useFullscreen/index.d.ts +12 -0
- package/es/useFullscreen/index.js +76 -0
- package/es/useHistory/index.d.ts +3 -0
- package/es/useHistory/index.js +9 -0
- package/es/useHistory/interface.d.ts +3 -0
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/useInfiniteScroll/index.js +102 -0
- package/es/useRafInterval/index.d.ts +5 -0
- package/es/useRafInterval/index.js +71 -0
- package/es/useSimpleState/index.d.ts +3 -0
- package/es/useSimpleState/index.js +35 -0
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/useVirtualList/index.js +136 -0
- package/es/utils.d.ts +14 -0
- package/es/utils.js +46 -0
- package/es/uuid/index.d.ts +5 -0
- package/es/uuid/index.js +6 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function likeGo(_x) {
|
|
6
|
+
return _likeGo.apply(this, arguments);
|
|
7
|
+
}
|
|
8
|
+
function _likeGo() {
|
|
9
|
+
_likeGo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fn) {
|
|
10
|
+
var result;
|
|
11
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13
|
+
case 0:
|
|
14
|
+
result = [];
|
|
15
|
+
_context.next = 3;
|
|
16
|
+
return fn().then(function (res) {
|
|
17
|
+
result[0] = res;
|
|
18
|
+
}).catch(function (err) {
|
|
19
|
+
result[1] = err;
|
|
20
|
+
});
|
|
21
|
+
case 3:
|
|
22
|
+
return _context.abrupt("return", result);
|
|
23
|
+
case 4:
|
|
24
|
+
case "end":
|
|
25
|
+
return _context.stop();
|
|
26
|
+
}
|
|
27
|
+
}, _callee);
|
|
28
|
+
}));
|
|
29
|
+
return _likeGo.apply(this, arguments);
|
|
30
|
+
}
|
|
31
|
+
export default likeGo;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
debug: function debug(title) {
|
|
3
|
+
var _console;
|
|
4
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
5
|
+
args[_key - 1] = arguments[_key];
|
|
6
|
+
}
|
|
7
|
+
(_console = console).debug.apply(_console, ["%c[DEBUG] -> ".concat(title), 'color:white;background-color:blue'].concat(args));
|
|
8
|
+
},
|
|
9
|
+
success: function success(title) {
|
|
10
|
+
var _console2;
|
|
11
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
12
|
+
args[_key2 - 1] = arguments[_key2];
|
|
13
|
+
}
|
|
14
|
+
(_console2 = console).debug.apply(_console2, ["%c[SUCCESS] -> ".concat(title), 'color:white;background-color:green'].concat(args));
|
|
15
|
+
},
|
|
16
|
+
error: function error(title) {
|
|
17
|
+
var _console3;
|
|
18
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
19
|
+
args[_key3 - 1] = arguments[_key3];
|
|
20
|
+
}
|
|
21
|
+
(_console3 = console).error.apply(_console3, ["%c[ERROR] -> ".concat(title), 'color:white;background-color:red'].concat(args));
|
|
22
|
+
},
|
|
23
|
+
warn: function warn(title) {
|
|
24
|
+
var _console4;
|
|
25
|
+
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
26
|
+
args[_key4 - 1] = arguments[_key4];
|
|
27
|
+
}
|
|
28
|
+
(_console4 = console).error.apply(_console4, ["%c[WARN] -> ".concat(title), 'color:white;background-color:yellow'].concat(args));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function nextTick(fn: () => void): void;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
/* eslint-disable react/button-has-type */
|
|
12
|
+
import { useCreation } from 'ahooks';
|
|
13
|
+
import React, { useEffect, useState } from 'react';
|
|
14
|
+
import io from 'socket.io-client';
|
|
15
|
+
import Recorder from "./index";
|
|
16
|
+
var recorder = new Recorder({
|
|
17
|
+
sampleBits: 16,
|
|
18
|
+
// 采样位数,支持 8 或 16,默认是16
|
|
19
|
+
sampleRate: 16000,
|
|
20
|
+
// 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000
|
|
21
|
+
numChannels: 1,
|
|
22
|
+
// 声道,支持 1 或 2, 默认是1
|
|
23
|
+
compiling: true //(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false
|
|
24
|
+
});
|
|
25
|
+
var recorder2 = new Recorder({
|
|
26
|
+
sampleBits: 16,
|
|
27
|
+
// 采样位数,支持 8 或 16,默认是16
|
|
28
|
+
sampleRate: 16000,
|
|
29
|
+
// 采样率,支持 11025、16000、22050、24000、44100、48000,根据浏览器默认值,我的chrome是48000
|
|
30
|
+
numChannels: 1,
|
|
31
|
+
// 声道,支持 1 或 2, 默认是1
|
|
32
|
+
compiling: true //(0.x版本中生效,1.x增加中) // 是否边录边转换,默认是false
|
|
33
|
+
});
|
|
34
|
+
var App = function App() {
|
|
35
|
+
var _useState = useState(false),
|
|
36
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
+
state = _useState2[0],
|
|
38
|
+
setState = _useState2[1];
|
|
39
|
+
var sokect = useCreation(function () {
|
|
40
|
+
return io('ws://192.168.101.89:9614', {
|
|
41
|
+
path: '/socket.io',
|
|
42
|
+
query: {
|
|
43
|
+
sn: '110110110110',
|
|
44
|
+
meetingNo: '54325432543',
|
|
45
|
+
manufacturer: 'speech',
|
|
46
|
+
audioType: 'wav',
|
|
47
|
+
sampleBytes: '16',
|
|
48
|
+
sampleRate: '16000',
|
|
49
|
+
channel: '1',
|
|
50
|
+
language: 'cn',
|
|
51
|
+
authorization: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InNlcnZpY2VJZCI6IjE2NTU1NDAwMjI5ODQ3NzMiLCJlbmFibGVkIjp0cnVlLCJzZXJ2aWNlVHlwZSI6Miwic2VydmljZU5hbWUiOiLnu4Tku7bljJbmtYvor5XlubPlj7Bf5Yu_5YqoIiwic2VydmljZU5vIjoiMjAyMzA1MDUwMDEiLCJzaWduSW5UeXBlIjoic2VydmljZSIsImF1dGhvcml0eVR5cGUiOjIsIm1lZXRpbmdBY2Nlc3NJZCI6MTY0MTY5MjI3NDQ5MTQ2MSwidm9pY2VBY2Nlc3NJZCI6MTY1NTUzODM1NDQwNTQ0NSwiYXV0aG9yaXRpZXMiOm51bGx9LCJzY29wZSI6WyJzZXJ2aWNlIl0sImV4cCI6MTY4MzcyOTA0MSwianRpIjoiMjc1YjM2ZmMtY2FjNS00MjgyLWFlYzYtM2YxNWRlOTBkZjFkIiwiY2xpZW50X2lkIjoic2VydmljZTo5YzJiMTdjMGNmZjE0MDgzYmRiNmYyN2NhNzYzY2ZmOSJ9.FdWyBmWF-hmC16wNohViLbHJf4qiEzIqSk9shqGLCPs'
|
|
52
|
+
},
|
|
53
|
+
autoConnect: false,
|
|
54
|
+
transports: ['websocket']
|
|
55
|
+
});
|
|
56
|
+
}, []);
|
|
57
|
+
useEffect(function () {
|
|
58
|
+
sokect.on('connect', function () {
|
|
59
|
+
console.log('connect');
|
|
60
|
+
});
|
|
61
|
+
sokect.on('message', function (event) {
|
|
62
|
+
console.log(event);
|
|
63
|
+
});
|
|
64
|
+
}, []);
|
|
65
|
+
var onstart = /*#__PURE__*/function () {
|
|
66
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
67
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
_context.next = 2;
|
|
71
|
+
return recorder.start();
|
|
72
|
+
case 2:
|
|
73
|
+
setState(true);
|
|
74
|
+
case 3:
|
|
75
|
+
case "end":
|
|
76
|
+
return _context.stop();
|
|
77
|
+
}
|
|
78
|
+
}, _callee);
|
|
79
|
+
}));
|
|
80
|
+
return function onstart() {
|
|
81
|
+
return _ref.apply(this, arguments);
|
|
82
|
+
};
|
|
83
|
+
}();
|
|
84
|
+
var oncanect = function oncanect() {
|
|
85
|
+
if (!sokect.connected) {
|
|
86
|
+
sokect.connect();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var onstop = function onstop() {
|
|
90
|
+
recorder.stop();
|
|
91
|
+
setState(false);
|
|
92
|
+
if (sokect.connected) {
|
|
93
|
+
sokect.disconnect();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
useEffect(function () {
|
|
97
|
+
if (state) {
|
|
98
|
+
var timer = setInterval(function () {
|
|
99
|
+
var voice = recorder.getNextData();
|
|
100
|
+
if (!voice) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
sokect.emit('message', {
|
|
104
|
+
sendTime: Date.now(),
|
|
105
|
+
voice: voice
|
|
106
|
+
});
|
|
107
|
+
}, 40);
|
|
108
|
+
return function () {
|
|
109
|
+
return clearInterval(timer);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}, [state]);
|
|
113
|
+
var onstart2 = /*#__PURE__*/function () {
|
|
114
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
115
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
116
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
117
|
+
case 0:
|
|
118
|
+
_context2.next = 2;
|
|
119
|
+
return recorder2.start();
|
|
120
|
+
case 2:
|
|
121
|
+
setState(true);
|
|
122
|
+
case 3:
|
|
123
|
+
case "end":
|
|
124
|
+
return _context2.stop();
|
|
125
|
+
}
|
|
126
|
+
}, _callee2);
|
|
127
|
+
}));
|
|
128
|
+
return function onstart2() {
|
|
129
|
+
return _ref2.apply(this, arguments);
|
|
130
|
+
};
|
|
131
|
+
}();
|
|
132
|
+
var onstop2 = /*#__PURE__*/function () {
|
|
133
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
134
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
135
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
136
|
+
case 0:
|
|
137
|
+
recorder2.stop();
|
|
138
|
+
setState(true);
|
|
139
|
+
case 2:
|
|
140
|
+
case "end":
|
|
141
|
+
return _context3.stop();
|
|
142
|
+
}
|
|
143
|
+
}, _callee3);
|
|
144
|
+
}));
|
|
145
|
+
return function onstop2() {
|
|
146
|
+
return _ref3.apply(this, arguments);
|
|
147
|
+
};
|
|
148
|
+
}();
|
|
149
|
+
var onplay2 = /*#__PURE__*/function () {
|
|
150
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
151
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
152
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
153
|
+
case 0:
|
|
154
|
+
recorder2.play();
|
|
155
|
+
case 1:
|
|
156
|
+
case "end":
|
|
157
|
+
return _context4.stop();
|
|
158
|
+
}
|
|
159
|
+
}, _callee4);
|
|
160
|
+
}));
|
|
161
|
+
return function onplay2() {
|
|
162
|
+
return _ref4.apply(this, arguments);
|
|
163
|
+
};
|
|
164
|
+
}();
|
|
165
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
166
|
+
className: "App"
|
|
167
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "\u5B9E\u65F6\u8BED\u97F3\u8F6C\u5199"), /*#__PURE__*/React.createElement("button", {
|
|
168
|
+
onClick: oncanect
|
|
169
|
+
}, "\u8FDE\u63A5"), /*#__PURE__*/React.createElement("button", {
|
|
170
|
+
onClick: onstart
|
|
171
|
+
}, "\u5F00\u59CB"), /*#__PURE__*/React.createElement("button", {
|
|
172
|
+
onClick: onstop
|
|
173
|
+
}, "\u505C\u6B62")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h4", null, "\u97F3\u9891\u5F55\u5236"), /*#__PURE__*/React.createElement("button", {
|
|
174
|
+
onClick: onstart2
|
|
175
|
+
}, "\u5F00\u59CB"), /*#__PURE__*/React.createElement("button", {
|
|
176
|
+
onClick: onstop2
|
|
177
|
+
}, "\u505C\u6B62"), /*#__PURE__*/React.createElement("button", {
|
|
178
|
+
onClick: onplay2
|
|
179
|
+
}, "\u64AD\u653E")));
|
|
180
|
+
};
|
|
181
|
+
export default App;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
interface RecorderConfig {
|
|
2
|
+
sampleBits?: number;
|
|
3
|
+
sampleRate?: number;
|
|
4
|
+
numChannels?: number;
|
|
5
|
+
compiling?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare class Recorder {
|
|
8
|
+
private isrecording;
|
|
9
|
+
private isplaying;
|
|
10
|
+
private ispause;
|
|
11
|
+
private context;
|
|
12
|
+
private config;
|
|
13
|
+
private size;
|
|
14
|
+
private lBuffer;
|
|
15
|
+
private rBuffer;
|
|
16
|
+
private PCM;
|
|
17
|
+
private tempPCM;
|
|
18
|
+
private audioInput;
|
|
19
|
+
private inputSampleRate;
|
|
20
|
+
private source;
|
|
21
|
+
private recorder;
|
|
22
|
+
private outputSampleRate;
|
|
23
|
+
private oututSampleBits;
|
|
24
|
+
private analyser;
|
|
25
|
+
private littleEdian;
|
|
26
|
+
private prevDomainData;
|
|
27
|
+
private playStamp;
|
|
28
|
+
private playTime;
|
|
29
|
+
private totalPlayTime;
|
|
30
|
+
private offset;
|
|
31
|
+
private stream;
|
|
32
|
+
fileSize: number;
|
|
33
|
+
duration: number;
|
|
34
|
+
onprogress?: (payload: {
|
|
35
|
+
duration: number;
|
|
36
|
+
fileSize: number;
|
|
37
|
+
vol: number;
|
|
38
|
+
data: Array<DataView>;
|
|
39
|
+
}) => void | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* @param {Object} options 包含以下三个参数:
|
|
42
|
+
* sampleBits,采样位数,一般8,16,默认16
|
|
43
|
+
* sampleRate,采样率,一般 11025、16000、22050、24000、44100、48000,默认为浏览器自带的采样率
|
|
44
|
+
* numChannels,声道,1或2
|
|
45
|
+
*/
|
|
46
|
+
constructor(options?: RecorderConfig);
|
|
47
|
+
/**
|
|
48
|
+
* 初始化录音实例
|
|
49
|
+
*/
|
|
50
|
+
initRecorder(): void;
|
|
51
|
+
/**
|
|
52
|
+
* 开始录音
|
|
53
|
+
*
|
|
54
|
+
* @returns {Promise<{}>}
|
|
55
|
+
* @memberof Recorder
|
|
56
|
+
*/
|
|
57
|
+
start(): Promise<any>;
|
|
58
|
+
/**
|
|
59
|
+
* 暂停录音
|
|
60
|
+
*
|
|
61
|
+
* @memberof Recorder
|
|
62
|
+
*/
|
|
63
|
+
pause(): void;
|
|
64
|
+
/**
|
|
65
|
+
* 继续录音
|
|
66
|
+
*
|
|
67
|
+
* @memberof Recorder
|
|
68
|
+
*/
|
|
69
|
+
resume(): void;
|
|
70
|
+
/**
|
|
71
|
+
* 停止录音
|
|
72
|
+
*
|
|
73
|
+
* @memberof Recorder
|
|
74
|
+
*/
|
|
75
|
+
stop(): void;
|
|
76
|
+
/**
|
|
77
|
+
* 播放录音
|
|
78
|
+
*
|
|
79
|
+
* @memberof Recorder
|
|
80
|
+
*/
|
|
81
|
+
play(): void;
|
|
82
|
+
/**
|
|
83
|
+
* 获取音频文件已经播放了的时间
|
|
84
|
+
*
|
|
85
|
+
* @returns {number}
|
|
86
|
+
* @memberof Recorder
|
|
87
|
+
*/
|
|
88
|
+
getPlayTime(): number;
|
|
89
|
+
/**
|
|
90
|
+
* 暂停播放录音
|
|
91
|
+
*
|
|
92
|
+
* @memberof Recorder
|
|
93
|
+
*/
|
|
94
|
+
pausePlay(): void;
|
|
95
|
+
/**
|
|
96
|
+
* 恢复播放录音
|
|
97
|
+
*
|
|
98
|
+
* @memberof Recorder
|
|
99
|
+
*/
|
|
100
|
+
resumePlay(): void;
|
|
101
|
+
/**
|
|
102
|
+
* 停止播放
|
|
103
|
+
*
|
|
104
|
+
* @memberof Recorder
|
|
105
|
+
*/
|
|
106
|
+
stopPlay(): void;
|
|
107
|
+
/**
|
|
108
|
+
* 获取当前已经录音的PCM音频数据
|
|
109
|
+
*
|
|
110
|
+
* @returns[DataView]
|
|
111
|
+
* @memberof Recorder
|
|
112
|
+
*/
|
|
113
|
+
getWholeData(): DataView[];
|
|
114
|
+
/**
|
|
115
|
+
* 获取余下的新数据,不包括 getNextData 前一次获取的数据
|
|
116
|
+
*
|
|
117
|
+
* @returns [DataView]
|
|
118
|
+
* @memberof Recorder
|
|
119
|
+
*/
|
|
120
|
+
getNextData(): ArrayBufferLike;
|
|
121
|
+
/**
|
|
122
|
+
* 利用 decodeAudioData播放录音数据,每次播放都需创建,因为buffersource只能被使用一次
|
|
123
|
+
*
|
|
124
|
+
* @private
|
|
125
|
+
* @memberof Recorder
|
|
126
|
+
*/
|
|
127
|
+
private playAudioData;
|
|
128
|
+
/**
|
|
129
|
+
* 获取当前录音的波形数据,
|
|
130
|
+
* 调取频率由外部控制。
|
|
131
|
+
*
|
|
132
|
+
* @memberof Recorder
|
|
133
|
+
*/
|
|
134
|
+
getRecordAnalyseData(): any;
|
|
135
|
+
/**
|
|
136
|
+
* 获取录音播放时的波形数据,
|
|
137
|
+
*
|
|
138
|
+
* @memberof Recorder
|
|
139
|
+
*/
|
|
140
|
+
getPlayAnalyseData(): any;
|
|
141
|
+
/**
|
|
142
|
+
* 获取PCM编码的二进制数据(dataview)
|
|
143
|
+
*
|
|
144
|
+
* @returns {dataview} PCM二进制数据
|
|
145
|
+
* @memberof Recorder
|
|
146
|
+
*/
|
|
147
|
+
private getPCM;
|
|
148
|
+
/**
|
|
149
|
+
* 获取PCM格式的blob数据
|
|
150
|
+
*
|
|
151
|
+
* @returns { blob } PCM格式的blob数据
|
|
152
|
+
* @memberof Recorder
|
|
153
|
+
*/
|
|
154
|
+
getPCMBlob(): Blob;
|
|
155
|
+
/**
|
|
156
|
+
* 下载录音pcm数据
|
|
157
|
+
*
|
|
158
|
+
* @param {string} [name='recorder'] 重命名的名字
|
|
159
|
+
* @memberof Recorder
|
|
160
|
+
*/
|
|
161
|
+
downloadPCM(name?: string): void;
|
|
162
|
+
/**
|
|
163
|
+
* 获取WAV编码的二进制数据(dataview)
|
|
164
|
+
*
|
|
165
|
+
* @returns {dataview} WAV编码的二进制数据
|
|
166
|
+
* @memberof Recorder
|
|
167
|
+
*/
|
|
168
|
+
private getWAV;
|
|
169
|
+
/**
|
|
170
|
+
* 获取WAV音频的blob数据
|
|
171
|
+
*
|
|
172
|
+
* @returns { Blob } wav格式blob数据
|
|
173
|
+
* @memberof Recorder
|
|
174
|
+
*/
|
|
175
|
+
getWAVBlob(): Blob;
|
|
176
|
+
/**
|
|
177
|
+
* 下载录音的wav数据
|
|
178
|
+
*
|
|
179
|
+
* @param {string} [name='recorder'] 重命名的名字
|
|
180
|
+
* @memberof Recorder
|
|
181
|
+
*/
|
|
182
|
+
downloadWAV(name?: string): void;
|
|
183
|
+
/**
|
|
184
|
+
* 将获取到到左右声道的Float32Array数据编码转化
|
|
185
|
+
*
|
|
186
|
+
* @param {Float32Array} lData 左声道数据
|
|
187
|
+
* @param {Float32Array} rData 有声道数据
|
|
188
|
+
* @returns DataView
|
|
189
|
+
*/
|
|
190
|
+
private transformIntoPCM;
|
|
191
|
+
/**
|
|
192
|
+
* 销毁录音对象
|
|
193
|
+
* @memberof Recorder
|
|
194
|
+
*/
|
|
195
|
+
destroy(): Promise<any>;
|
|
196
|
+
/**
|
|
197
|
+
* 终止流(这可以让浏览器上正在录音的标志消失掉)
|
|
198
|
+
* @private
|
|
199
|
+
* @memberof Recorder
|
|
200
|
+
*/
|
|
201
|
+
private stopStream;
|
|
202
|
+
/**
|
|
203
|
+
* close兼容方案
|
|
204
|
+
* 如firefox 30 等低版本浏览器没有 close方法
|
|
205
|
+
*/
|
|
206
|
+
private closeAudioContext;
|
|
207
|
+
/**
|
|
208
|
+
* 下载录音文件
|
|
209
|
+
* @private
|
|
210
|
+
* @param {*} blob blob数据
|
|
211
|
+
* @param {string} name 下载的文件名
|
|
212
|
+
* @param {string} type 下载的文件后缀
|
|
213
|
+
* @memberof Recorder
|
|
214
|
+
*/
|
|
215
|
+
private download;
|
|
216
|
+
/**
|
|
217
|
+
* 清空状态,重新开始录音(变量初始化)
|
|
218
|
+
*
|
|
219
|
+
* @private
|
|
220
|
+
* @memberof Recorder
|
|
221
|
+
*/
|
|
222
|
+
private clear;
|
|
223
|
+
/**
|
|
224
|
+
* 将二维数组转一维
|
|
225
|
+
*
|
|
226
|
+
* @private
|
|
227
|
+
* @returns {float32array} 音频pcm二进制数据
|
|
228
|
+
* @memberof Recorder
|
|
229
|
+
*/
|
|
230
|
+
private flat;
|
|
231
|
+
/**
|
|
232
|
+
* 播放外部音乐文件
|
|
233
|
+
*
|
|
234
|
+
* @param {float32array} blob blob音频数据
|
|
235
|
+
* @memberof Recorder
|
|
236
|
+
*/
|
|
237
|
+
static playAudio(blob: Blob): void;
|
|
238
|
+
/**
|
|
239
|
+
* 数据合并压缩
|
|
240
|
+
* 根据输入和输出的采样率压缩数据,
|
|
241
|
+
* 比如输入的采样率是48k的,我们需要的是(输出)的是16k的,由于48k与16k是3倍关系,
|
|
242
|
+
* 所以输入数据中每隔3取1位
|
|
243
|
+
*
|
|
244
|
+
* @static
|
|
245
|
+
* @param {float32array} data [-1, 1]的pcm数据
|
|
246
|
+
* @param {number} inputSampleRate 输入采样率
|
|
247
|
+
* @param {number} outputSampleRate 输出采样率
|
|
248
|
+
* @returns {float32array} 压缩处理后的二进制数据
|
|
249
|
+
* @memberof Recorder
|
|
250
|
+
*/
|
|
251
|
+
static compress(data: {
|
|
252
|
+
left: Float32Array;
|
|
253
|
+
right: Float32Array;
|
|
254
|
+
}, inputSampleRate: number, outputSampleRate: number): Float32Array;
|
|
255
|
+
/**
|
|
256
|
+
* 转换到我们需要的对应格式的编码
|
|
257
|
+
*
|
|
258
|
+
* @static
|
|
259
|
+
* @param {Float32Array} bytes pcm二进制数据
|
|
260
|
+
* @param {number} sampleBits 采样位数
|
|
261
|
+
* @param {boolean} littleEdian 是否是小端字节序
|
|
262
|
+
* @returns {dataview} pcm二进制数据
|
|
263
|
+
* @memberof Recorder
|
|
264
|
+
*/
|
|
265
|
+
static encodePCM(bytes: Float32Array, sampleBits: number, littleEdian?: boolean): DataView;
|
|
266
|
+
/**
|
|
267
|
+
* 编码wav,一般wav格式是在pcm文件前增加44个字节的文件头,
|
|
268
|
+
* 所以,此处只需要在pcm数据前增加下就行了。
|
|
269
|
+
*
|
|
270
|
+
* @static
|
|
271
|
+
* @param {DataView} bytes pcm二进制数据
|
|
272
|
+
* @param {number} inputSampleRate 输入采样率
|
|
273
|
+
* @param {number} outputSampleRate 输出采样率
|
|
274
|
+
* @param {number} numChannels 声道数
|
|
275
|
+
* @param {number} oututSampleBits 输出采样位数
|
|
276
|
+
* @param {boolean} littleEdian 是否是小端字节序
|
|
277
|
+
* @returns {DataView} wav二进制数据
|
|
278
|
+
* @memberof Recorder
|
|
279
|
+
*/
|
|
280
|
+
static encodeWAV(bytes: DataView, inputSampleRate: number, outputSampleRate: number, numChannels: number, oututSampleBits: number, littleEdian?: boolean): DataView;
|
|
281
|
+
/**
|
|
282
|
+
* 异常处理
|
|
283
|
+
* @static
|
|
284
|
+
* @param {*} message 错误消息
|
|
285
|
+
* @memberof Recorder
|
|
286
|
+
*/
|
|
287
|
+
static throwError(message: any): void;
|
|
288
|
+
/**
|
|
289
|
+
* 在没有权限的时候,让弹出获取麦克风弹窗
|
|
290
|
+
*
|
|
291
|
+
*/
|
|
292
|
+
static getPermission(): Promise<void>;
|
|
293
|
+
}
|
|
294
|
+
export default Recorder;
|