@realsee/dnalogel 0.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.
Files changed (271) hide show
  1. package/README.md +94 -0
  2. package/TERMS.txt +56 -0
  3. package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +44 -0
  4. package/components/ARVideoFigure/ARVideoFigureMesh.js +347 -0
  5. package/components/ARVideoFigure/ARVideoFigureScene.d.ts +11 -0
  6. package/components/ARVideoFigure/ARVideoFigureScene.js +74 -0
  7. package/components/ARVideoFigure/ImgBgTransparent.d.ts +16 -0
  8. package/components/ARVideoFigure/ImgBgTransparent.js +49 -0
  9. package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +30 -0
  10. package/components/ARVideoFigure/ImgBgTransparentMesh.js +173 -0
  11. package/components/ARVideoFigure/fragmentShader.d.ts +5 -0
  12. package/components/ARVideoFigure/fragmentShader.js +16 -0
  13. package/components/ARVideoFigure/index.d.ts +15 -0
  14. package/components/ARVideoFigure/index.js +64 -0
  15. package/components/ARVideoFigure/vertexShader.d.ts +1 -0
  16. package/components/ARVideoFigure/vertexShader.js +8 -0
  17. package/components/GlassFilters/index.d.ts +32 -0
  18. package/components/GlassFilters/index.js +54 -0
  19. package/components/ModelView/ModelViewController.d.ts +18 -0
  20. package/components/ModelView/ModelViewController.js +147 -0
  21. package/components/ModelView/index.d.ts +10 -0
  22. package/components/ModelView/index.js +22 -0
  23. package/components/PBRView/index.d.ts +14 -0
  24. package/components/PBRView/index.js +31 -0
  25. package/components/PaintBrush/index.d.ts +16 -0
  26. package/components/PaintBrush/index.js +33 -0
  27. package/components/PanoTag/index.d.ts +4 -0
  28. package/components/PanoTag/index.js +11 -0
  29. package/custom.d.js +3 -0
  30. package/data/1aGKl9JmrlXMXx8d.d.ts +104 -0
  31. package/data/1aGKl9JmrlXMXx8d.js +535 -0
  32. package/data/6gyq3v1verxD7JO1.d.ts +104 -0
  33. package/data/6gyq3v1verxD7JO1.js +460 -0
  34. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +84 -0
  35. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +598 -0
  36. package/data/PrXel3aqGbp34JQn.d.ts +389 -0
  37. package/data/PrXel3aqGbp34JQn.js +4639 -0
  38. package/data/YdoNP9K4rwQDwjJr.d.ts +83 -0
  39. package/data/YdoNP9K4rwQDwjJr.js +1451 -0
  40. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +86 -0
  41. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +709 -0
  42. package/data/oPzy3ApbjjpD8YdR.d.ts +83 -0
  43. package/data/oPzy3ApbjjpD8YdR.js +281 -0
  44. package/data/qjAxMG4XbPn96wKG.d.ts +104 -0
  45. package/data/qjAxMG4XbPn96wKG.js +635 -0
  46. package/data/rXel3aPQRRBD4JQn.d.ts +86 -0
  47. package/data/rXel3aPQRRBD4JQn.js +620 -0
  48. package/data/vLykj3NWrllMrG06.d.ts +89 -0
  49. package/data/vLykj3NWrllMrG06.js +2532 -0
  50. package/data/wYnRjQ4KZoV1yPoG.d.ts +114 -0
  51. package/data/wYnRjQ4KZoV1yPoG.js +512 -0
  52. package/data/wz0QV9KA4ugyo9ME.d.ts +39 -0
  53. package/data/wz0QV9KA4ugyo9ME.js +134 -0
  54. package/examples/FiveStateController/index.js +140 -0
  55. package/examples/VRHouse/Mobile.js +22 -0
  56. package/examples/VRHouse/PC.js +22 -0
  57. package/examples/VRHouse/index.js +22 -0
  58. package/index.d.ts +15 -0
  59. package/index.js +43 -0
  60. package/package.json +19 -0
  61. package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +12 -0
  62. package/plugins/CSS3DRenderPlugin/components/Marker/index.js +113 -0
  63. package/plugins/CSS3DRenderPlugin/index.d.ts +49 -0
  64. package/plugins/CSS3DRenderPlugin/index.js +220 -0
  65. package/plugins/CameraMovementPlugin/index.d.ts +7 -0
  66. package/plugins/CameraMovementPlugin/index.js +338 -0
  67. package/plugins/CameraMovementPlugin/typing.d.ts +68 -0
  68. package/plugins/CameraMovementPlugin/typing.js +35 -0
  69. package/plugins/ModelChassisCompassPlugin/index.d.ts +15 -0
  70. package/plugins/ModelChassisCompassPlugin/index.js +156 -0
  71. package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +10 -0
  72. package/plugins/ModelEntryDoorGuidePlugin/index.js +16 -0
  73. package/plugins/ModelTVVideoPlugin/index.d.ts +21 -0
  74. package/plugins/ModelTVVideoPlugin/index.js +313 -0
  75. package/plugins/ModelViewPlugin/index.d.ts +17 -0
  76. package/plugins/ModelViewPlugin/index.js +199 -0
  77. package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +48 -0
  78. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +9 -0
  79. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +113 -0
  80. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +11 -0
  81. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +25 -0
  82. package/plugins/PanoCursorRaycasterPlugin/index.d.ts +49 -0
  83. package/plugins/PanoCursorRaycasterPlugin/index.js +119 -0
  84. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +5 -0
  85. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +25 -0
  86. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +3 -0
  87. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +34 -0
  88. package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.d.ts +7 -0
  89. package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.js +18 -0
  90. package/plugins/PanoDoorLabelPlugin/index.d.ts +4 -0
  91. package/plugins/PanoDoorLabelPlugin/index.js +12 -0
  92. package/plugins/PanoIRobotPlugin/index.d.ts +10 -0
  93. package/plugins/PanoIRobotPlugin/index.js +16 -0
  94. package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +3 -0
  95. package/plugins/PanoRulerPlugin/data/roomInfo.js +49 -0
  96. package/plugins/PanoRulerPlugin/data/roomRules.d.ts +3 -0
  97. package/plugins/PanoRulerPlugin/data/roomRules.js +233 -0
  98. package/plugins/PanoRulerPlugin/index.d.ts +27 -0
  99. package/plugins/PanoRulerPlugin/index.js +589 -0
  100. package/plugins/PanoRulerPlugin/typings.d.ts +21 -0
  101. package/plugins/PanoRulerPlugin/typings.js +5 -0
  102. package/plugins/PanoTVVideoPlugin/index.d.ts +24 -0
  103. package/plugins/PanoTVVideoPlugin/index.js +351 -0
  104. package/plugins/TreasurePlugin/Controller.d.ts +32 -0
  105. package/plugins/TreasurePlugin/Controller.js +175 -0
  106. package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +23 -0
  107. package/plugins/TreasurePlugin/TreasureFaceAnime.js +128 -0
  108. package/plugins/TreasurePlugin/TreasureObject.d.ts +35 -0
  109. package/plugins/TreasurePlugin/TreasureObject.js +186 -0
  110. package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +23 -0
  111. package/plugins/TreasurePlugin/TreasureOpenAnime.js +103 -0
  112. package/plugins/TreasurePlugin/constants.d.ts +12 -0
  113. package/plugins/TreasurePlugin/constants.js +30 -0
  114. package/plugins/TreasurePlugin/index.d.ts +11 -0
  115. package/plugins/TreasurePlugin/index.js +16 -0
  116. package/plugins/TreasurePlugin/treasureDataMap.d.ts +7 -0
  117. package/plugins/TreasurePlugin/treasureDataMap.js +20 -0
  118. package/plugins/TreasurePlugin/typings.d.ts +2 -0
  119. package/plugins/TreasurePlugin/typings.js +5 -0
  120. package/plugins/TreasurePlugin/utils/loadTreasureTextures.d.ts +7 -0
  121. package/plugins/TreasurePlugin/utils/loadTreasureTextures.js +115 -0
  122. package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
  123. package/plugins/floorplan/Assets/floorplanExtraObject.js +8 -0
  124. package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +100 -0
  125. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +643 -0
  126. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +13 -0
  127. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +58 -0
  128. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +5 -0
  129. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +69 -0
  130. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +10 -0
  131. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +105 -0
  132. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +13 -0
  133. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +95 -0
  134. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +13 -0
  135. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +48 -0
  136. package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +20 -0
  137. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +66 -0
  138. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +1 -0
  139. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +14 -0
  140. package/plugins/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
  141. package/plugins/floorplan/ModelFloorplanPlugin/index.js +18 -0
  142. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
  143. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +5 -0
  144. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
  145. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +31 -0
  146. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
  147. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +162 -0
  148. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +13 -0
  149. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +91 -0
  150. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +3 -0
  151. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +35 -0
  152. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +5 -0
  153. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +50 -0
  154. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +9 -0
  155. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +102 -0
  156. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +11 -0
  157. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +42 -0
  158. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +17 -0
  159. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +75 -0
  160. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +2 -0
  161. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +13 -0
  162. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +33 -0
  163. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +214 -0
  164. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
  165. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +18 -0
  166. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +55 -0
  167. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +267 -0
  168. package/plugins/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
  169. package/plugins/floorplan/TopviewFloorplanPlugin/index.js +16 -0
  170. package/plugins/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
  171. package/plugins/floorplan/TopviewFloorplanPlugin/style.js +14 -0
  172. package/plugins/floorplan/components/FloorplanImage.d.ts +7 -0
  173. package/plugins/floorplan/components/FloorplanImage.js +76 -0
  174. package/plugins/floorplan/typings/floorplanData.d.ts +127 -0
  175. package/plugins/floorplan/typings/floorplanData.js +5 -0
  176. package/plugins/floorplan/typings/floorplanServerData.d.ts +125 -0
  177. package/plugins/floorplan/typings/floorplanServerData.js +380 -0
  178. package/plugins/floorplan/utils/formatData.d.ts +5 -0
  179. package/plugins/floorplan/utils/formatData.js +220 -0
  180. package/plugins/floorplan/utils/formatPosition.d.ts +37 -0
  181. package/plugins/floorplan/utils/formatPosition.js +87 -0
  182. package/shared-utils/Preloader.d.ts +6 -0
  183. package/shared-utils/Preloader.js +51 -0
  184. package/shared-utils/Subscribe.d.ts +45 -0
  185. package/shared-utils/Subscribe.js +210 -0
  186. package/shared-utils/animationFrame/BetterTween.d.ts +11 -0
  187. package/shared-utils/animationFrame/BetterTween.js +102 -0
  188. package/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
  189. package/shared-utils/animationFrame/calculateProgress.js +38 -0
  190. package/shared-utils/animationFrame/formatRad.d.ts +15 -0
  191. package/shared-utils/animationFrame/formatRad.js +34 -0
  192. package/shared-utils/animationFrame/index.d.ts +15 -0
  193. package/shared-utils/animationFrame/index.js +69 -0
  194. package/shared-utils/animationFrame/tween.d.ts +75 -0
  195. package/shared-utils/animationFrame/tween.js +76 -0
  196. package/shared-utils/changeModelCanvansOpacity.d.ts +2 -0
  197. package/shared-utils/changeModelCanvansOpacity.js +24 -0
  198. package/shared-utils/createFiveContainer.d.ts +10 -0
  199. package/shared-utils/createFiveContainer.js +165 -0
  200. package/shared-utils/createLine/index.d.ts +3 -0
  201. package/shared-utils/createLine/index.js +29 -0
  202. package/shared-utils/debounce.d.ts +6 -0
  203. package/shared-utils/debounce.js +26 -0
  204. package/shared-utils/equal.d.ts +11 -0
  205. package/shared-utils/equal.js +96 -0
  206. package/shared-utils/filter.d.ts +27 -0
  207. package/shared-utils/filter.js +93 -0
  208. package/shared-utils/five/changeMode.d.ts +2 -0
  209. package/shared-utils/five/changeMode.js +86 -0
  210. package/shared-utils/five/useFivePlugin.d.ts +1 -0
  211. package/shared-utils/five/useFivePlugin.js +15 -0
  212. package/shared-utils/formatRad.d.ts +7 -0
  213. package/shared-utils/formatRad.js +16 -0
  214. package/shared-utils/getPxmm.d.ts +6 -0
  215. package/shared-utils/getPxmm.js +37 -0
  216. package/shared-utils/getRandomColor.d.ts +1 -0
  217. package/shared-utils/getRandomColor.js +13 -0
  218. package/shared-utils/isTruelyObject.d.ts +18 -0
  219. package/shared-utils/isTruelyObject.js +27 -0
  220. package/shared-utils/math/evenNumber.d.ts +1 -0
  221. package/shared-utils/math/evenNumber.js +11 -0
  222. package/shared-utils/math/planimetry.d.ts +116 -0
  223. package/shared-utils/math/planimetry.js +342 -0
  224. package/shared-utils/math/rad2Deg.d.ts +1 -0
  225. package/shared-utils/math/rad2Deg.js +10 -0
  226. package/shared-utils/nearlyEqual.d.ts +7 -0
  227. package/shared-utils/nearlyEqual.js +17 -0
  228. package/shared-utils/nextFrame.d.ts +1 -0
  229. package/shared-utils/nextFrame.js +13 -0
  230. package/shared-utils/noop.d.ts +5 -0
  231. package/shared-utils/noop.js +17 -0
  232. package/shared-utils/object3d2LocalMatrix.d.ts +12 -0
  233. package/shared-utils/object3d2LocalMatrix.js +73 -0
  234. package/shared-utils/px2rem.d.ts +1 -0
  235. package/shared-utils/px2rem.js +12 -0
  236. package/shared-utils/tap.d.ts +8 -0
  237. package/shared-utils/tap.js +19 -0
  238. package/shared-utils/three/centerPoint.d.ts +2 -0
  239. package/shared-utils/three/centerPoint.js +12 -0
  240. package/shared-utils/three/getNormal.d.ts +2 -0
  241. package/shared-utils/three/getNormal.js +13 -0
  242. package/shared-utils/three/loadFbxObj.d.ts +3 -0
  243. package/shared-utils/three/loadFbxObj.js +42 -0
  244. package/shared-utils/three/loadTexture.d.ts +2 -0
  245. package/shared-utils/three/loadTexture.js +38 -0
  246. package/shared-utils/three/vecror3.d.ts +7 -0
  247. package/shared-utils/three/vecror3.js +18 -0
  248. package/shared-utils/throttle.d.ts +7 -0
  249. package/shared-utils/throttle.js +25 -0
  250. package/shared-utils/to.d.ts +9 -0
  251. package/shared-utils/to.js +25 -0
  252. package/shared-utils/useDebounce.d.ts +8 -0
  253. package/shared-utils/useDebounce.js +43 -0
  254. package/shared-utils/useThrottle.d.ts +8 -0
  255. package/shared-utils/useThrottle.js +41 -0
  256. package/shared-utils/uuid.d.ts +4 -0
  257. package/shared-utils/uuid.js +20 -0
  258. package/shared-utils/vectorTocoordinates.d.ts +7 -0
  259. package/shared-utils/vectorTocoordinates.js +16 -0
  260. package/typedoc/components.d.ts +6 -0
  261. package/typedoc/components.js +5 -0
  262. package/typedoc/plugins.d.ts +17 -0
  263. package/typedoc/plugins.js +113 -0
  264. package/typedoc/shared-utils.d.ts +3 -0
  265. package/typedoc/shared-utils.js +5 -0
  266. package/typedoc/typings.d.ts +3 -0
  267. package/typedoc/typings.js +5 -0
  268. package/typings/math.type.d.ts +44 -0
  269. package/typings/math.type.js +5 -0
  270. package/typings/utils.type.d.ts +2 -0
  271. package/typings/utils.type.js +5 -0
@@ -0,0 +1,5 @@
1
+ import { Five } from '@realsee/five';
2
+ import { FloorplanData, FloorplanExtraObject, FloorplanExtraObject3D } from '../typings/floorplanData';
3
+ import { FloorplanServerData } from '../typings/floorplanServerData';
4
+ export default function formatData(data: FloorplanServerData): Promise<FloorplanData>;
5
+ export declare function formatExtraObjects(data: FloorplanExtraObject3D[], five: Five, floorplanData: FloorplanData): FloorplanExtraObject[];
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = formatData;
7
+ exports.formatExtraObjects = formatExtraObjects;
8
+
9
+ var _floorplanExtraObject = require("../Assets/floorplanExtraObject");
10
+
11
+ var _formatPosition = require("./formatPosition");
12
+
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+
15
+ 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."); }
16
+
17
+ 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); }
18
+
19
+ 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; }
20
+
21
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
22
+
23
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
+
25
+ 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); } }
26
+
27
+ 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); }); }; }
28
+
29
+ function formatOutlines(_x) {
30
+ return _formatOutlines.apply(this, arguments);
31
+ }
32
+
33
+ function _formatOutlines() {
34
+ _formatOutlines = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(outlines) {
35
+ var headers, getOutlineItem, svgOutlineItems;
36
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
37
+ while (1) {
38
+ switch (_context2.prev = _context2.next) {
39
+ case 0:
40
+ headers = new Headers({
41
+ 'Content-Type': 'text/plain'
42
+ });
43
+
44
+ getOutlineItem = /*#__PURE__*/function () {
45
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(item) {
46
+ var outlineItem, svgContent;
47
+ return regeneratorRuntime.wrap(function _callee$(_context) {
48
+ while (1) {
49
+ switch (_context.prev = _context.next) {
50
+ case 0:
51
+ outlineItem = {
52
+ index: item.index,
53
+ url: item.url,
54
+ svgUrl: item.svg_url
55
+ };
56
+
57
+ if (!item.svg_url) {
58
+ _context.next = 6;
59
+ break;
60
+ }
61
+
62
+ _context.next = 4;
63
+ return fetch(item.svg_url, {
64
+ headers: headers
65
+ }).then(function (res) {
66
+ return res.text();
67
+ });
68
+
69
+ case 4:
70
+ svgContent = _context.sent;
71
+ outlineItem.svgContent = svgContent;
72
+
73
+ case 6:
74
+ return _context.abrupt("return", outlineItem);
75
+
76
+ case 7:
77
+ case "end":
78
+ return _context.stop();
79
+ }
80
+ }
81
+ }, _callee);
82
+ }));
83
+
84
+ return function getOutlineItem(_x3) {
85
+ return _ref.apply(this, arguments);
86
+ };
87
+ }();
88
+
89
+ _context2.next = 4;
90
+ return Promise.all(outlines.map(getOutlineItem));
91
+
92
+ case 4:
93
+ svgOutlineItems = _context2.sent;
94
+ return _context2.abrupt("return", svgOutlineItems);
95
+
96
+ case 6:
97
+ case "end":
98
+ return _context2.stop();
99
+ }
100
+ }
101
+ }, _callee2);
102
+ }));
103
+ return _formatOutlines.apply(this, arguments);
104
+ }
105
+
106
+ function formatRoom(data) {
107
+ var floorplanRoomItem = {
108
+ id: data.id,
109
+ size: data.size,
110
+ name: data.name,
111
+ path: data.path,
112
+ roomType: data.room_type,
113
+ floorType: data.floor_type,
114
+ roomLabel: {
115
+ position: data.room_label.position,
116
+ positionInImage: data.room_label.position_in_image
117
+ },
118
+ observerIndexs: data.observer_indexs
119
+ };
120
+ return floorplanRoomItem;
121
+ }
122
+
123
+ function formatFloorData(_data) {
124
+ return {
125
+ floorName: _data.floor_name,
126
+ floorIndex: _data.floor_index,
127
+ rooms: _data.rooms.map(formatRoom)
128
+ };
129
+ }
130
+
131
+ function formateFloorplanObserver(data) {
132
+ var floorplanObserver = {
133
+ index: data.index,
134
+ floorIndex: data.floor_index,
135
+ position: data.position,
136
+ positionInImage: data.position_in_image
137
+ };
138
+ return floorplanObserver;
139
+ }
140
+
141
+ function formatFloorplanEntrance(data) {
142
+ var floorplanEntrance = {
143
+ rad: data.rad,
144
+ position: data.position,
145
+ positionInImage: data.position_in_image,
146
+ northRad: data.north_rad,
147
+ roomId: data.room_id,
148
+ floorIndex: data.floor_index
149
+ };
150
+ return floorplanEntrance;
151
+ }
152
+
153
+ function formatData(_x2) {
154
+ return _formatData.apply(this, arguments);
155
+ }
156
+
157
+ function _formatData() {
158
+ _formatData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(data) {
159
+ var outlines, bounding, floorDatas, entrance, floorplanData;
160
+ return regeneratorRuntime.wrap(function _callee3$(_context3) {
161
+ while (1) {
162
+ switch (_context3.prev = _context3.next) {
163
+ case 0:
164
+ _context3.next = 2;
165
+ return formatOutlines(data.outlines);
166
+
167
+ case 2:
168
+ outlines = _context3.sent;
169
+ bounding = data.computed_data.bounding;
170
+ floorDatas = data.computed_data.floor_datas.map(formatFloorData);
171
+ entrance = data.computed_data.entrance ? formatFloorplanEntrance(data.computed_data.entrance) : null;
172
+ floorplanData = {
173
+ outlines: outlines,
174
+ entrance: entrance,
175
+ bounding: bounding,
176
+ floorDatas: floorDatas,
177
+ observers: data.computed_data.observers.map(formateFloorplanObserver)
178
+ };
179
+ return _context3.abrupt("return", floorplanData);
180
+
181
+ case 8:
182
+ case "end":
183
+ return _context3.stop();
184
+ }
185
+ }
186
+ }, _callee3);
187
+ }));
188
+ return _formatData.apply(this, arguments);
189
+ }
190
+
191
+ function formatExtraObjects(data, five, floorplanData) {
192
+ var extraObjects = data.map(function (object) {
193
+ var _object$position = _slicedToArray(object.position, 3),
194
+ x = _object$position[0],
195
+ y = _object$position[1],
196
+ z = _object$position[2];
197
+
198
+ var position = {
199
+ x: x,
200
+ y: y,
201
+ z: z
202
+ };
203
+ var icon = object.icon ? object.icon : {
204
+ url: _floorplanExtraObject.FLOORPLANE_EXTRA_OBJECT_IMAGE,
205
+ width: 45,
206
+ height: 48
207
+ };
208
+ var floorIndex = (0, _formatPosition.getFloorIndexFromModelPosition)(position, five);
209
+ var floorplanPosition = (0, _formatPosition.modelPosition2FloorplanPosition)(position, floorplanData);
210
+ var floorplanImagePosition = (0, _formatPosition.floorplanPosition2ImagePosition)(floorplanPosition, floorplanData);
211
+ return {
212
+ floorIndex: floorIndex,
213
+ icon: icon,
214
+ id: object.id,
215
+ position: floorplanPosition,
216
+ positionInImage: floorplanImagePosition
217
+ };
218
+ });
219
+ return extraObjects;
220
+ }
@@ -0,0 +1,37 @@
1
+ import { Five } from '@realsee/five';
2
+ import { Vector2 } from '../../../typings/math.type';
3
+ import { FloorplanData } from '../typings/floorplanData';
4
+ import { FloorplanBounding } from '../typings/floorplanData';
5
+ export declare function pathD(points: Vector2[], options?: {
6
+ needZ?: boolean;
7
+ needA?: Record<number, string>;
8
+ format?: (vector: Vector2) => Vector2;
9
+ }): string;
10
+ /** 把户型图上点点位转换到 SVG 上的点位 */
11
+ export default function formatFloorplanPoint({ x, y }: Vector2, pxmm: number, bounding: FloorplanBounding): {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ /** 模型坐标转户型图坐标 */
16
+ export declare function modelPosition2FloorplanPosition(position: {
17
+ x: number;
18
+ y: number;
19
+ z: number;
20
+ }, floorplanData: FloorplanData): {
21
+ x: number;
22
+ y: number;
23
+ };
24
+ /** 户型图点位转在图片上的相对坐标 */
25
+ export declare function floorplanPosition2ImagePosition(position: {
26
+ x: number;
27
+ y: number;
28
+ }, floorplanData: FloorplanData): {
29
+ x: number;
30
+ y: number;
31
+ };
32
+ /** 求三维坐标点所在的楼层 */
33
+ export declare function getFloorIndexFromModelPosition(position: {
34
+ x: number;
35
+ y: number;
36
+ z: number;
37
+ }, five: Five): number;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = formatFloorplanPoint;
7
+ exports.floorplanPosition2ImagePosition = floorplanPosition2ImagePosition;
8
+ exports.getFloorIndexFromModelPosition = getFloorIndexFromModelPosition;
9
+ exports.modelPosition2FloorplanPosition = modelPosition2FloorplanPosition;
10
+ exports.pathD = pathD;
11
+
12
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
13
+
14
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+
16
+ 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); }
17
+
18
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
19
+
20
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
21
+
22
+ 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; }
23
+
24
+ function pathD(points) {
25
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
26
+ var d = '';
27
+ var needZ = options.needZ,
28
+ needA = options.needA;
29
+ if (needZ) points = points.concat(points[0]);
30
+ points.forEach(function (_point, index) {
31
+ var _ref = options.format ? options.format(_point) : _point,
32
+ x = _ref.x,
33
+ y = _ref.y;
34
+
35
+ var point = x + ',' + y;
36
+ if (index == 0) return d += 'M' + point;
37
+ if (needA && needA[index]) return d += 'A' + needA[index] + ',' + point;
38
+ return d += 'L' + point;
39
+ });
40
+ return d + (needZ ? 'Z' : '');
41
+ }
42
+ /** 把户型图上点点位转换到 SVG 上的点位 */
43
+
44
+
45
+ function formatFloorplanPoint(_ref2, pxmm, bounding) {
46
+ var x = _ref2.x,
47
+ y = _ref2.y;
48
+ var max = bounding.max,
49
+ min = bounding.min;
50
+ return {
51
+ x: (x - min.x) * pxmm,
52
+ y: (max.y - y) * pxmm
53
+ };
54
+ }
55
+ /** 模型坐标转户型图坐标 */
56
+
57
+
58
+ function modelPosition2FloorplanPosition(position, floorplanData) {
59
+ var x = position.x * 1000 + floorplanData.bounding.origin.x;
60
+ var y = -position.z * 1000 + floorplanData.bounding.origin.y;
61
+ return {
62
+ x: x,
63
+ y: y
64
+ };
65
+ }
66
+ /** 户型图点位转在图片上的相对坐标 */
67
+
68
+
69
+ function floorplanPosition2ImagePosition(position, floorplanData) {
70
+ var bounding = floorplanData.bounding;
71
+ var boundingWidth = bounding.max.x - bounding.min.x;
72
+ var boundingHeight = bounding.max.y - bounding.min.y;
73
+ return {
74
+ x: (position.x - bounding.min.x) / boundingWidth,
75
+ y: (bounding.max.y - position.y) / boundingHeight
76
+ };
77
+ }
78
+ /** 求三维坐标点所在的楼层 */
79
+
80
+
81
+ function getFloorIndexFromModelPosition(position, five) {
82
+ var floorIndex = Math.max.apply(Math, _toConsumableArray(five.work.observers.map(function (observer) {
83
+ if (position.z >= observer.standingPosition.z) return observer.floorIndex;
84
+ return 0;
85
+ })));
86
+ return floorIndex;
87
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 预载器
3
+ */
4
+ export declare const Preloader: {
5
+ blob: (url: string) => Promise<string>;
6
+ };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Preloader = void 0;
7
+
8
+ /**
9
+ * 预载器
10
+ */
11
+ var Preloader = {
12
+ blob: function blob(url) {
13
+ var noop = function noop() {
14
+ return null;
15
+ };
16
+
17
+ return new Promise(function (resolve, reject) {
18
+ var xhr = new XMLHttpRequest();
19
+
20
+ var clear = function clear() {
21
+ xhr.ontimeout = noop;
22
+ xhr.onreadystatechange = noop;
23
+ xhr.onprogress = noop;
24
+ xhr.onabort = noop;
25
+ };
26
+
27
+ xhr.ontimeout = function () {
28
+ reject(new Error('timeout'));
29
+ clear();
30
+ };
31
+
32
+ xhr.onreadystatechange = function () {
33
+ if (xhr.readyState !== 4) return;
34
+ if (xhr.status === 0 && !xhr.response) return;
35
+
36
+ if (xhr.status === 200 || xhr.status === 0) {
37
+ resolve(xhr.response);
38
+ clear();
39
+ } else {
40
+ reject(new Error('status:' + xhr.status));
41
+ clear();
42
+ }
43
+ };
44
+
45
+ xhr.open('GET', url, true);
46
+ xhr.responseType = 'blob';
47
+ xhr.send(null);
48
+ });
49
+ }
50
+ };
51
+ exports.Preloader = Preloader;
@@ -0,0 +1,45 @@
1
+ declare const __EVENT__ = "__events__";
2
+ /**
3
+ * 订阅类。
4
+ * 观察者模式(供前端使用),Node端推荐<a href="https://nodejs.org/api/events.html#events_class_eventemitter">EventEmitter</a>。
5
+ */
6
+ export default class Subscribe {
7
+ private [__EVENT__];
8
+ constructor();
9
+ /**
10
+ * 判断是否注册时事件
11
+ * @param {string|[string]} name 事件类型
12
+ */
13
+ hasListener(name: string): any;
14
+ /**
15
+ * 注册事件
16
+ * @param {string|[string]} names 事件类型
17
+ * @param {function} callback 事件回调函数
18
+ * @param {any} context 事件回调函数调用的上下文
19
+ * @param {boolean} once 是否只执行一次
20
+ */
21
+ on(names: string | string[], callback: (...args: any[]) => void, context?: any, once?: boolean): () => this | undefined;
22
+ /**
23
+ * 注册事件(是否只执行一次)
24
+ * @param {string|[string]} names 事件类型
25
+ * @param {function} callback 事件回调函数
26
+ * @param {any} context 事件回调函数调用的上下文
27
+ */
28
+ once(names: string | string[], callback: (...args: any[]) => void, context?: any): () => this | undefined;
29
+ /**
30
+ * 解除事件
31
+ * @param {string|[string]} names 事件类型
32
+ * @param {function} callback 事件回调函数
33
+ *
34
+ * 如果 name 不传的话解除对应所有事件
35
+ * 如果 name, callback 不传的话解除所有name的所有事件
36
+ */
37
+ off(names?: string | string[], callback?: (...args: any[]) => void): this | undefined;
38
+ /**
39
+ * 触发事件
40
+ * @param {string|[string]} name 事件类型
41
+ * @param {...any} data 触发事件的数据
42
+ */
43
+ emit(name: string, ...data: any[]): boolean;
44
+ }
45
+ export {};
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
9
+
10
+ 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."); }
11
+
12
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
13
+
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+
16
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
17
+
18
+ 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); }
19
+
20
+ 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; }
21
+
22
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
+
24
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
25
+
26
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
27
+
28
+ /* eslint-disable @typescript-eslint/no-explicit-any */
29
+ var __EVENT__ = '__events__';
30
+ /**
31
+ * 订阅类。
32
+ * 观察者模式(供前端使用),Node端推荐<a href="https://nodejs.org/api/events.html#events_class_eventemitter">EventEmitter</a>。
33
+ */
34
+
35
+ var Subscribe = /*#__PURE__*/function () {
36
+ function Subscribe() {
37
+ _classCallCheck(this, Subscribe);
38
+
39
+ this[__EVENT__] = {};
40
+ }
41
+ /**
42
+ * 判断是否注册时事件
43
+ * @param {string|[string]} name 事件类型
44
+ */
45
+
46
+
47
+ _createClass(Subscribe, [{
48
+ key: "hasListener",
49
+ value: function hasListener(name) {
50
+ var events = this[__EVENT__];
51
+ return events && events[name] && events[name].length;
52
+ }
53
+ /**
54
+ * 注册事件
55
+ * @param {string|[string]} names 事件类型
56
+ * @param {function} callback 事件回调函数
57
+ * @param {any} context 事件回调函数调用的上下文
58
+ * @param {boolean} once 是否只执行一次
59
+ */
60
+
61
+ }, {
62
+ key: "on",
63
+ value: function on(names, callback, context) {
64
+ var _this = this;
65
+
66
+ var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
67
+
68
+ var _iterator = _createForOfIteratorHelper([].concat(names)),
69
+ _step;
70
+
71
+ try {
72
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
73
+ var name = _step.value;
74
+ if (!this[__EVENT__][name]) this[__EVENT__][name] = [];
75
+
76
+ this[__EVENT__][name].push([callback, context, once]);
77
+ }
78
+ } catch (err) {
79
+ _iterator.e(err);
80
+ } finally {
81
+ _iterator.f();
82
+ }
83
+
84
+ return function () {
85
+ return _this.off(names, callback);
86
+ };
87
+ }
88
+ /**
89
+ * 注册事件(是否只执行一次)
90
+ * @param {string|[string]} names 事件类型
91
+ * @param {function} callback 事件回调函数
92
+ * @param {any} context 事件回调函数调用的上下文
93
+ */
94
+
95
+ }, {
96
+ key: "once",
97
+ value: function once(names, callback, context) {
98
+ return this.on(names, callback, context, true);
99
+ }
100
+ /**
101
+ * 解除事件
102
+ * @param {string|[string]} names 事件类型
103
+ * @param {function} callback 事件回调函数
104
+ *
105
+ * 如果 name 不传的话解除对应所有事件
106
+ * 如果 name, callback 不传的话解除所有name的所有事件
107
+ */
108
+
109
+ }, {
110
+ key: "off",
111
+ value: function off(names, callback) {
112
+ if (arguments.length === 0) {
113
+ this[__EVENT__] = {};
114
+ return;
115
+ }
116
+
117
+ var hasNames = function hasNames(names) {
118
+ return names;
119
+ };
120
+
121
+ if (hasNames(names)) {
122
+ var events = this[__EVENT__];
123
+
124
+ var _iterator2 = _createForOfIteratorHelper([].concat(names)),
125
+ _step2;
126
+
127
+ try {
128
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
129
+ var name = _step2.value;
130
+ if (events[name] === undefined) continue;
131
+
132
+ if (callback === undefined) {
133
+ events[name].length = 0;
134
+ continue;
135
+ }
136
+
137
+ events[name] = events[name].filter(function (one) {
138
+ return one[0] !== callback;
139
+ });
140
+ }
141
+ } catch (err) {
142
+ _iterator2.e(err);
143
+ } finally {
144
+ _iterator2.f();
145
+ }
146
+ }
147
+
148
+ return this;
149
+ }
150
+ /**
151
+ * 触发事件
152
+ * @param {string|[string]} name 事件类型
153
+ * @param {...any} data 触发事件的数据
154
+ */
155
+
156
+ }, {
157
+ key: "emit",
158
+ value: function emit(name) {
159
+ var canceled = false;
160
+ var event = this[__EVENT__][name] || [];
161
+
162
+ if (event.length === 0) {
163
+ console.warn(" \uD83D\uDC80 \"".concat(name, "\" \u27F6 Unregistered event. "));
164
+ }
165
+
166
+ for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
167
+ data[_key - 1] = arguments[_key];
168
+ }
169
+
170
+ var _iterator3 = _createForOfIteratorHelper(event),
171
+ _step3;
172
+
173
+ try {
174
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
175
+ var one = _step3.value;
176
+
177
+ try {
178
+ var _one = _slicedToArray(one, 3),
179
+ callback = _one[0],
180
+ _one$ = _one[1],
181
+ context = _one$ === void 0 ? this : _one$,
182
+ _one$2 = _one[2],
183
+ once = _one$2 === void 0 ? false : _one$2;
184
+
185
+ var result = callback.apply(context, data);
186
+ if (once) this.off(name, callback);
187
+
188
+ if (result === false) {
189
+ // 如果回调的返回结果是false,则中断后续的调用链
190
+ canceled = true;
191
+ return canceled;
192
+ }
193
+ } catch (error) {
194
+ console.warn(error);
195
+ }
196
+ }
197
+ } catch (err) {
198
+ _iterator3.e(err);
199
+ } finally {
200
+ _iterator3.f();
201
+ }
202
+
203
+ return canceled;
204
+ }
205
+ }]);
206
+
207
+ return Subscribe;
208
+ }();
209
+
210
+ exports["default"] = Subscribe;
@@ -0,0 +1,11 @@
1
+ import TWEEN from '@tweenjs/tween.js';
2
+ export declare class BetterTween<G> extends TWEEN.Tween<G> {
3
+ private disposeMethods;
4
+ private animationFrameDisposer?;
5
+ onDispose: (callback: () => void) => this;
6
+ play: () => this;
7
+ dispose: () => void;
8
+ }
9
+ export declare function tweenProgress(duration?: number, easing?: (amount: number) => number): BetterTween<{
10
+ progress: number;
11
+ }>;