@realsee/five 5.0.0-alpha.13 → 5.0.0-alpha.130

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 (203) hide show
  1. package/README.md +21 -11
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/highlight.css +134 -0
  4. package/docs/assets/icons.css +1043 -0
  5. package/docs/assets/{images/icons.png → icons.png} +0 -0
  6. package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  7. package/docs/assets/main.js +52 -0
  8. package/docs/assets/search.js +1 -0
  9. package/docs/assets/style.css +1413 -0
  10. package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  11. package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  12. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  13. package/docs/classes/five.BVH.html +10 -0
  14. package/docs/classes/five.BVHIntersect.html +1 -0
  15. package/docs/classes/five.BVHNode.html +7 -0
  16. package/docs/classes/five.BVHVector3.html +1 -0
  17. package/docs/classes/five.Camera.html +11 -0
  18. package/docs/classes/five.Five.html +303 -0
  19. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  20. package/docs/classes/five.IntersectMesh.html +1 -0
  21. package/docs/classes/five.LegacyPanoCircleMesh.html +5 -0
  22. package/docs/classes/five.Model.html +87 -0
  23. package/docs/classes/five.NetworkSubscribe.html +50 -0
  24. package/docs/classes/five.PBMContainer.html +17 -0
  25. package/docs/classes/five.PBMGroup.html +19 -0
  26. package/docs/classes/five.PBMMaterial.html +17 -0
  27. package/docs/classes/five.PBMMesh.html +7 -0
  28. package/docs/classes/five.PanoCircleMesh.html +7 -0
  29. package/docs/classes/five.Scene.html +3 -0
  30. package/docs/classes/five.Subscribe.html +56 -0
  31. package/docs/classes/five.Tile3DModel.html +15 -0
  32. package/docs/classes/five.Work.html +30 -0
  33. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  34. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  35. package/docs/classes/line.Line.html +1 -0
  36. package/docs/classes/line.LineGeometry.html +1 -0
  37. package/docs/classes/line.LineMaterial.html +1 -0
  38. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  39. package/docs/classes/line.THREE_Line2.html +1 -0
  40. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  41. package/docs/classes/react.Store.html +29 -0
  42. package/docs/classes/server.BVH.html +10 -0
  43. package/docs/classes/server.BVHIntersect.html +1 -0
  44. package/docs/classes/server.BVHNode.html +7 -0
  45. package/docs/classes/server.BVHVector3.html +1 -0
  46. package/docs/classes/server.Model.html +63 -0
  47. package/docs/classes/server.PBMGroup.html +9 -0
  48. package/docs/classes/server.PBMMesh.html +7 -0
  49. package/docs/classes/sticker.Sticker.html +32 -0
  50. package/docs/index.html +166 -422
  51. package/docs/interfaces/five.AddableObject.html +1 -0
  52. package/docs/interfaces/five.AnimationFrame.html +1 -0
  53. package/docs/interfaces/five.CameraPose.html +1 -0
  54. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  55. package/docs/interfaces/five.EventCallback.html +391 -0
  56. package/docs/interfaces/five.FiveInitArgs.html +100 -0
  57. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +15 -0
  58. package/docs/interfaces/five.ImageOptions.html +18 -0
  59. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  60. package/docs/interfaces/five.ImageURLOptions.html +17 -0
  61. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  62. package/docs/interfaces/five.Intersection.html +7 -0
  63. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  64. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  65. package/docs/interfaces/five.ModelEventCallback.html +22 -0
  66. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  67. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  68. package/docs/interfaces/five.PBMParameters.html +17 -0
  69. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  70. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +28 -0
  71. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  72. package/docs/interfaces/five.Pose.html +37 -0
  73. package/docs/interfaces/five.Scissor.html +14 -0
  74. package/docs/interfaces/five.State.html +21 -0
  75. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  76. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  77. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  78. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  79. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  80. package/docs/interfaces/five.TextureOptions.html +20 -0
  81. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -0
  82. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +24 -0
  83. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  84. package/docs/interfaces/five.WorkImage.html +21 -0
  85. package/docs/interfaces/five.WorkInitial.html +13 -0
  86. package/docs/interfaces/five.WorkModel.html +11 -0
  87. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  88. package/docs/interfaces/five.WorkObserver.html +25 -0
  89. package/docs/interfaces/five.WorkTile.html +1 -0
  90. package/docs/interfaces/five.WorkVideo.html +9 -0
  91. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  92. package/docs/interfaces/react.FiveActionReactCallbacks.html +62 -0
  93. package/docs/interfaces/react.FiveInjectionTypes.html +191 -0
  94. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  95. package/docs/interfaces/server.Intersection.html +7 -0
  96. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  97. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  98. package/docs/interfaces/vue.FiveActionVueCallbacks.html +62 -0
  99. package/docs/modules/five.SubscribeMixinType.html +1 -0
  100. package/docs/modules/five.html +482 -0
  101. package/docs/modules/gltf_loader.html +1 -0
  102. package/docs/modules/line.html +1 -0
  103. package/docs/modules/react.html +130 -1178
  104. package/docs/modules/server.html +18 -0
  105. package/docs/modules/sticker.html +1 -0
  106. package/docs/modules/vue.html +112 -0
  107. package/docs/modules.html +1 -120
  108. package/exporters/staticify.js +210 -0
  109. package/{index.d.ts → five/index.d.ts} +1178 -322
  110. package/five/index.js +372 -0
  111. package/gltf-loader/index.d.ts +75 -0
  112. package/gltf-loader/index.js +260 -0
  113. package/line/index.d.ts +68 -0
  114. package/line/index.js +260 -0
  115. package/package.json +25 -17
  116. package/react/index.d.ts +160 -92
  117. package/react/index.js +260 -1
  118. package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  119. package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  120. package/resource/gltf/draco_decoder.js +31 -0
  121. package/resource/gltf/draco_decoder.wasm +0 -0
  122. package/resource/gltf/draco_wasm_wrapper.js +119 -0
  123. package/scripts/five-staticify.js +26 -0
  124. package/server/index.d.ts +194 -25
  125. package/server/index.js +367 -1
  126. package/sticker/index.d.ts +70 -0
  127. package/sticker/index.js +260 -0
  128. package/templates/quick-start/README.md +1 -1
  129. package/templates/quick-start/package.json +1 -1
  130. package/templates/react-component/lib/index.tsx +3 -3
  131. package/umd/five-gltf-loader.js +2 -0
  132. package/umd/five-gltf-loader.js.LICENSE.txt +14 -0
  133. package/umd/five-line.js +2 -0
  134. package/umd/five-line.js.LICENSE.txt +14 -0
  135. package/umd/five-react.js +2 -0
  136. package/umd/five-react.js.LICENSE.txt +14 -0
  137. package/umd/five-sticker.js +2 -0
  138. package/umd/five-sticker.js.LICENSE.txt +14 -0
  139. package/umd/five-vue.js +1 -0
  140. package/umd/five.js +2 -0
  141. package/umd/five.js.LICENSE.txt +116 -0
  142. package/vue/index.d.ts +433 -0
  143. package/vue/index.js +260 -0
  144. package/bundles/five.js +0 -2
  145. package/bundles/five.js.LICENSE.txt +0 -160
  146. package/docs/assets/css/main.css +0 -2660
  147. package/docs/assets/js/main.js +0 -248
  148. package/docs/assets/js/search.js +0 -1
  149. package/docs/classes/index.five.html +0 -2498
  150. package/docs/classes/index.fivecamera.html +0 -311
  151. package/docs/classes/index.fivehashcubetexture.html +0 -240
  152. package/docs/classes/index.fiveline.html +0 -342
  153. package/docs/classes/index.fivelinegeometry.html +0 -500
  154. package/docs/classes/index.fivelinematerial.html +0 -276
  155. package/docs/classes/index.fivelinesegmentsgeometry.html +0 -447
  156. package/docs/classes/index.fivescene.html +0 -186
  157. package/docs/classes/index.internalwebglrenderer.html +0 -200
  158. package/docs/classes/index.model.html +0 -883
  159. package/docs/classes/index.pbmgroup.html +0 -415
  160. package/docs/classes/index.pbmmaterial.html +0 -521
  161. package/docs/classes/index.pbmmesh.html +0 -242
  162. package/docs/classes/index.subscribe.html +0 -556
  163. package/docs/classes/react.store.html +0 -584
  164. package/docs/interfaces/index.depthpanoramacontrollercustominitargs.html +0 -408
  165. package/docs/interfaces/index.eventcallback.html +0 -2452
  166. package/docs/interfaces/index.fiveinitargs.html +0 -695
  167. package/docs/interfaces/index.floorplancontrollercustominitargs.html +0 -283
  168. package/docs/interfaces/index.imageoptions.html +0 -320
  169. package/docs/interfaces/index.intersection.html +0 -215
  170. package/docs/interfaces/index.intersectmeshinterface.html +0 -176
  171. package/docs/interfaces/index.modelcontrollercustominitargs.html +0 -354
  172. package/docs/interfaces/index.modeleventcallback.html +0 -316
  173. package/docs/interfaces/index.movepanooptions.html +0 -457
  174. package/docs/interfaces/index.panocirclemeshinterface.html +0 -349
  175. package/docs/interfaces/index.panoramacontrollercustominitargs.html +0 -433
  176. package/docs/interfaces/index.panoramalikecontrollercustominitargs.html +0 -352
  177. package/docs/interfaces/index.pbmparameters.html +0 -462
  178. package/docs/interfaces/index.pose.html +0 -258
  179. package/docs/interfaces/index.scissor.html +0 -240
  180. package/docs/interfaces/index.state.html +0 -288
  181. package/docs/interfaces/index.subscribemixintype.emit.html +0 -180
  182. package/docs/interfaces/index.subscribemixintype.haslistener.html +0 -171
  183. package/docs/interfaces/index.subscribemixintype.off.html +0 -198
  184. package/docs/interfaces/index.subscribemixintype.on.html +0 -213
  185. package/docs/interfaces/index.subscribemixintype.once.html +0 -210
  186. package/docs/interfaces/index.topviewcontrollercustominitargs.html +0 -214
  187. package/docs/interfaces/index.vrpanoramacontrollercustominitargs.html +0 -420
  188. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -559
  189. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1473
  190. package/docs/interfaces/react.injectfivetoprops.html +0 -259
  191. package/docs/modules/index.html +0 -3027
  192. package/docs/modules/index.subscribemixintype.html +0 -143
  193. package/five.js.LICENSE.txt +0 -160
  194. package/index.js +0 -1
  195. package/scripts/export-five-resource/chfs.exe +0 -0
  196. package/scripts/export-five-resource/fileify.js +0 -192
  197. package/scripts/export-five-resource/format-work.js +0 -71
  198. package/scripts/export-five-resource/staticify.js +0 -327
  199. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  200. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  201. package/scripts/transcode-model/MTLLoader.js +0 -602
  202. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  203. package/scripts/transcode-model/obj2pbm.js +0 -65
package/react/index.d.ts CHANGED
@@ -1,16 +1,18 @@
1
1
  import { EventCallback } from '@realsee/five';
2
2
  import { Five } from '@realsee/five';
3
3
  import { FiveInitArgs } from '@realsee/five';
4
- import { FiveScene } from '@realsee/five';
5
4
  import { Intersection } from '@realsee/five';
6
5
  import { Model } from '@realsee/five';
7
6
  import { Pose } from '@realsee/five';
8
7
  import * as React_2 from 'react';
8
+ import { Scene } from '@realsee/five';
9
9
  import { State } from '@realsee/five';
10
10
  import * as THREE_2 from 'three';
11
11
  import { Vector2 } from 'three';
12
12
  import { Work } from '@realsee/five';
13
13
 
14
+ export declare function createFiveFeature<T extends FiveInjectionFeature>(...features: T[]): T[];
15
+
14
16
  /**
15
17
  * 创建一个 FiveProvider
16
18
  * 在 React 的体系下,使用 Provider 的方式来组织组件结构。
@@ -29,17 +31,20 @@ import { Work } from '@realsee/five';
29
31
  * ReactDOM.render(<App/>, document.getElementById("app"));
30
32
  * ```
31
33
  */
32
- export declare function createFiveProvider(fiveInitArgs: Omit<FiveInitArgs, "renderer" | "scissor">): {
34
+ export declare function createFiveProvider(fiveInitArgs?: Omit<FiveInitArgs, "renderer" | "scissor">): {
33
35
  new (props: FiveProviderPropTypes): {
34
36
  /**
35
37
  * five 实例,可以通过 FiveProvider 的 ref.five 获取得到
36
38
  * 在一些外部调用方面可以尝试使用
37
39
  */
38
40
  five?: Five;
39
- loadWork(work: Work, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number): void;
41
+ loadWork(work: Work, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean): Promise<void>;
40
42
  shouldComponentUpdate(nextProps: FiveProviderPropTypes): boolean;
41
43
  componentWillUnmount(): void;
42
- render(): JSX.Element;
44
+ render(): React_2.FunctionComponentElement<React_2.ProviderProps<{
45
+ five: Five;
46
+ loadWork: (work: Work, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean) => Promise<void>;
47
+ }>>;
43
48
  context: any;
44
49
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<FiveProviderPropTypes>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
45
50
  forceUpdate(callback?: () => void): void;
@@ -65,93 +70,99 @@ export declare function createFiveProvider(fiveInitArgs: Omit<FiveInitArgs, "ren
65
70
  };
66
71
 
67
72
  export declare function createStore<T extends StoreValueMapType, A extends StoreActionMapType = {}>(actionHandler: StoreActionMapHanlder<T, keyof T, A>): {
68
- new (props: {
69
- initialValue: T;
70
- onValuesChange?: (value: T, prevValue: T) => void;
71
- children: React_2.ReactNode;
72
- }): {
73
- store: Store<T>;
74
- shouldComponentUpdate(nextProps: {
75
- initialValue: T;
76
- onValuesChange?: (value: T, prevValue: T) => void;
77
- children: React_2.ReactNode;
78
- }): boolean;
79
- render(): JSX.Element;
80
- context: any;
81
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{
82
- initialValue: T;
83
- onValuesChange?: (value: T, prevValue: T) => void;
84
- children: React_2.ReactNode;
85
- }>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
86
- forceUpdate(callback?: () => void): void;
87
- readonly props: Readonly<{
88
- initialValue: T;
89
- onValuesChange?: (value: T, prevValue: T) => void;
90
- children: React_2.ReactNode;
91
- }> & Readonly<{
92
- children?: React_2.ReactNode;
93
- }>;
94
- state: Readonly<{}>;
95
- refs: {
96
- [key: string]: React_2.ReactInstance;
97
- };
98
- componentDidMount?(): void;
99
- componentWillUnmount?(): void;
100
- componentDidCatch?(error: Error, errorInfo: React_2.ErrorInfo): void;
101
- getSnapshotBeforeUpdate?(prevProps: Readonly<{
102
- initialValue: T;
103
- onValuesChange?: (value: T, prevValue: T) => void;
104
- children: React_2.ReactNode;
105
- }>, prevState: Readonly<{}>): any;
106
- componentDidUpdate?(prevProps: Readonly<{
107
- initialValue: T;
108
- onValuesChange?: (value: T, prevValue: T) => void;
109
- children: React_2.ReactNode;
110
- }>, prevState: Readonly<{}>, snapshot?: any): void;
111
- componentWillMount?(): void;
112
- UNSAFE_componentWillMount?(): void;
113
- componentWillReceiveProps?(nextProps: Readonly<{
114
- initialValue: T;
115
- onValuesChange?: (value: T, prevValue: T) => void;
116
- children: React_2.ReactNode;
117
- }>, nextContext: any): void;
118
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{
119
- initialValue: T;
120
- onValuesChange?: (value: T, prevValue: T) => void;
121
- children: React_2.ReactNode;
122
- }>, nextContext: any): void;
123
- componentWillUpdate?(nextProps: Readonly<{
124
- initialValue: T;
125
- onValuesChange?: (value: T, prevValue: T) => void;
126
- children: React_2.ReactNode;
127
- }>, nextState: Readonly<{}>, nextContext: any): void;
128
- UNSAFE_componentWillUpdate?(nextProps: Readonly<{
129
- initialValue: T;
130
- onValuesChange?: (value: T, prevValue: T) => void;
131
- children: React_2.ReactNode;
132
- }>, nextState: Readonly<{}>, nextContext: any): void;
133
- };
134
73
  /**
135
74
  * 使用 Store
136
75
  * @param names - 获取的 Store 字段
137
76
  * @returns [值, 修改值方法]
138
77
  */
139
- useStore<K_1 extends keyof T>(names: K_1[]): [values: Pick<T, K_1>, setValues: (values: Pick<T, K_1>) => void];
78
+ useStore<K extends keyof T>(names: K[]): [values: Pick<T, K>, setValues: (values: Pick<T, K>) => void];
140
79
  /**
141
80
  * 使用 Store (仅设置值)
142
81
  * @param names - 获取的 Store 字段
143
82
  * @returns 修改值方法
144
83
  */
145
- useStoreSetter<K_2 extends keyof T>(names: K_2[]): (values: Pick<T, K_2>) => void;
84
+ useStoreSetter<K_1 extends keyof T>(names: K_1[]): (values: Pick<T, K_1>) => void;
146
85
  /**
147
86
  * 监听 Store 变化
148
87
  * @param names - Store 字段
149
88
  * @param callback - 监听变化的回调函数
150
89
  * @param deps - 依赖对象
151
90
  */
152
- watchStore<K_3 extends keyof T>(names: K_3[], callback: (values: Pick<T, K_3>, prevValues: Pick<T, K_3>) => void, deps?: React_2.DependencyList | undefined): void;
91
+ watchStore<K_2 extends keyof T>(names: K_2[], callback: (values: Pick<T, K_2>, prevValues: Pick<T, K_2>) => void, deps?: React_2.DependencyList | undefined): void;
153
92
  useStoreAction<N extends keyof A, F extends A[N]>(actionName: N): F;
154
- contextType?: React_2.Context<any>;
93
+ /**
94
+ * Store Provider.
95
+ * 内部组件均可和 store 交互
96
+ */
97
+ StoreProvider: {
98
+ new (props: {
99
+ initialValue: T;
100
+ onValuesChange?: (value: T, prevValue: T) => void;
101
+ children: React_2.ReactNode;
102
+ }): {
103
+ store: Store<T>;
104
+ shouldComponentUpdate(nextProps: {
105
+ initialValue: T;
106
+ onValuesChange?: (value: T, prevValue: T) => void;
107
+ children: React_2.ReactNode;
108
+ }): boolean;
109
+ render(): React_2.FunctionComponentElement<React_2.ProviderProps<Store<T>>>;
110
+ context: any;
111
+ setState<K_3 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{
112
+ initialValue: T;
113
+ onValuesChange?: (value: T, prevValue: T) => void;
114
+ children: React_2.ReactNode;
115
+ }>) => {} | Pick<{}, K_3>) | Pick<{}, K_3>, callback?: () => void): void;
116
+ forceUpdate(callback?: () => void): void;
117
+ readonly props: Readonly<{
118
+ initialValue: T;
119
+ onValuesChange?: (value: T, prevValue: T) => void;
120
+ children: React_2.ReactNode;
121
+ }> & Readonly<{
122
+ children?: React_2.ReactNode;
123
+ }>;
124
+ state: Readonly<{}>;
125
+ refs: {
126
+ [key: string]: React_2.ReactInstance;
127
+ };
128
+ componentDidMount?(): void;
129
+ componentWillUnmount?(): void;
130
+ componentDidCatch?(error: Error, errorInfo: React_2.ErrorInfo): void;
131
+ getSnapshotBeforeUpdate?(prevProps: Readonly<{
132
+ initialValue: T;
133
+ onValuesChange?: (value: T, prevValue: T) => void;
134
+ children: React_2.ReactNode;
135
+ }>, prevState: Readonly<{}>): any;
136
+ componentDidUpdate?(prevProps: Readonly<{
137
+ initialValue: T;
138
+ onValuesChange?: (value: T, prevValue: T) => void;
139
+ children: React_2.ReactNode;
140
+ }>, prevState: Readonly<{}>, snapshot?: any): void;
141
+ componentWillMount?(): void;
142
+ UNSAFE_componentWillMount?(): void;
143
+ componentWillReceiveProps?(nextProps: Readonly<{
144
+ initialValue: T;
145
+ onValuesChange?: (value: T, prevValue: T) => void;
146
+ children: React_2.ReactNode;
147
+ }>, nextContext: any): void;
148
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{
149
+ initialValue: T;
150
+ onValuesChange?: (value: T, prevValue: T) => void;
151
+ children: React_2.ReactNode;
152
+ }>, nextContext: any): void;
153
+ componentWillUpdate?(nextProps: Readonly<{
154
+ initialValue: T;
155
+ onValuesChange?: (value: T, prevValue: T) => void;
156
+ children: React_2.ReactNode;
157
+ }>, nextState: Readonly<{}>, nextContext: any): void;
158
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<{
159
+ initialValue: T;
160
+ onValuesChange?: (value: T, prevValue: T) => void;
161
+ children: React_2.ReactNode;
162
+ }>, nextState: Readonly<{}>, nextContext: any): void;
163
+ };
164
+ contextType?: React_2.Context<any>;
165
+ };
155
166
  };
156
167
 
157
168
  /**
@@ -247,9 +258,9 @@ export declare const FiveCanvas: React_2.FC<{
247
258
  height: number;
248
259
  }>;
249
260
 
250
- export declare type FiveInjectionActionFeature = "loadWork" | "setState" | "on" | "off" | "intersectRaycaster" | "project2d" | "updateCamera" | "initBasisLoader" | "getPixels" | "render" | "needsRender" | "preloadPano";
261
+ export declare type FiveInjectionActionFeature = "loadWork" | "setState" | "on" | "off" | "intersectRaycaster" | "project2d" | "updateCamera" | "initBasisLoader" | "getPixels" | "render" | "needsRender" | "preloadPano" | "showFloor" | "toggleHelperVisible";
251
262
 
252
- export declare type FiveInjectionDataFeature = "unsafe__fiveInstance" | "currentState" | "state" | "work" | "scene" | "cameraDirection" | "cameraRaycaster" | "modelReadyState";
263
+ export declare type FiveInjectionDataFeature = "unsafe__fiveInstance" | "currentState" | "currentObserver" | "state" | "work" | "model" | "scene" | "cameraDirection" | "cameraRaycaster" | "modelReadyState" | "shownFloor" | "totalFloorLength" | "helperVisible";
253
264
 
254
265
  export declare type FiveInjectionFeature = FiveInjectionDataFeature | FiveInjectionActionFeature;
255
266
 
@@ -452,26 +463,38 @@ export declare interface FiveInjectionTypes extends Record<FiveInjectionFeature,
452
463
  * @returns 加载完成的 Promise 参数同 callback
453
464
  */
454
465
  preloadPano: Five["preloadPano"];
466
+ /**
467
+ * 显示楼层
468
+ * @param floorIndex - 楼层,如果不传则都显示
469
+ */
470
+ showFloor: (floorIndex?: number) => void;
471
+ /**
472
+ * 帮助元素的隐藏/显示
473
+ * @param visible - 隐藏/显示
474
+ */
475
+ toggleHelperVisible: (visible: boolean) => void;
455
476
  }
456
477
 
457
478
  export declare type FiveProviderPropTypes = {
458
479
  work?: Work;
459
- initialWork?: Work;
480
+ initialWork?: Work | Promise<Work>;
460
481
  initialState?: "inherit" | "initial" | Partial<Omit<State, "offset">>;
482
+ initialUserAction?: boolean;
461
483
  onWorkChange?: (work: Work) => void;
462
484
  onStateChange?: (state: State, userAction: boolean) => void;
463
485
  onCurrentStateChange?: (state: State, userAction: boolean) => void;
486
+ onError?: (error: Error) => void;
464
487
  children: React_2.ReactNode;
465
488
  };
466
489
 
467
490
  export declare type FiveProviderType = ReturnType<typeof createFiveProvider>;
468
491
 
469
- export declare interface InjectFiveToProps<F extends FiveInjectionFeature> {
470
- [INJECTION_PROPNAME]: Pick<FiveInjectionTypes, F>;
471
- }
472
-
473
492
  export declare const INJECTION_PROPNAME = "$five";
474
493
 
494
+ export declare interface PropTypeOfFiveFeatures<F extends FiveInjectionFeature[]> {
495
+ [INJECTION_PROPNAME]: Pick<FiveInjectionTypes, F[number]>;
496
+ }
497
+
475
498
  /**
476
499
  * 监听者模式
477
500
  * @template T - 预设的监听回调类型
@@ -520,7 +543,7 @@ export declare type StoreActionMapType = {
520
543
  [name: string]: (...args: any[]) => any;
521
544
  };
522
545
 
523
- export declare type StoreProviderType = ReturnType<typeof createStore>;
546
+ export declare type StoreProviderType = ReturnType<typeof createStore>["StoreProvider"];
524
547
 
525
548
  export declare type StoreValueMapType = Record<string, any>;
526
549
 
@@ -623,6 +646,16 @@ export declare function useFiveCameraDirection(): THREE_2.Vector3;
623
646
  */
624
647
  export declare function useFiveCameraRaycaster(): THREE_2.Raycaster;
625
648
 
649
+ /**
650
+ * Five React Hooks: Five 的当前观测点
651
+ * @returns Work.observers[number] 当前观测点, 如果 work 未加载则为 null
652
+ * @example
653
+ * ```
654
+ * const observer = useFiveCurrentObserver();
655
+ * ```
656
+ */
657
+ export declare function useFiveCurrentObserver(): Work["observers"][number] | null;
658
+
626
659
  /**
627
660
  * Five React Hooks: Five 的实时状态
628
661
  * @returns
@@ -634,7 +667,7 @@ export declare function useFiveCameraRaycaster(): THREE_2.Raycaster;
634
667
  */
635
668
  export declare function useFiveCurrentState(): [
636
669
  currentState: State,
637
- setState: (state: Partial<State>, immediately?: boolean) => void
670
+ setState: (state: Partial<State> | ((prevState: State) => Partial<State>), immediately?: boolean, userAction?: boolean) => void
638
671
  ];
639
672
 
640
673
  /**
@@ -645,7 +678,36 @@ setState: (state: Partial<State>, immediately?: boolean) => void
645
678
  * useFiveEvent("cameraUpdate", pose => {});
646
679
  * ```
647
680
  */
648
- export declare function useFiveEvent<T extends keyof EventCallback>(name: T, callback: EventCallback[T], deps?: React_2.DependencyList | undefined): void;
681
+ export declare function useFiveEventCallback<T extends keyof EventCallback>(name: T, callback: EventCallback[T], deps?: React_2.DependencyList | undefined): void;
682
+
683
+ /**
684
+ * Five React Hooks: Five 楼层
685
+ * @returns
686
+ * [ shownFloor: Five 当前显示的楼层, null 为都显示, showFloor: 设置显示楼层,不传参数为都显示 ]
687
+ * @example
688
+ * ```
689
+ * const [ shownFloor, showFloor ] = useFiveFloor;
690
+ * ```
691
+ */
692
+ export declare function useFiveFloor(): [
693
+ shownFloor: number | null,
694
+ totalFloorLength: number,
695
+ showFloor: (floorIndex?: number) => void
696
+ ];
697
+
698
+ /**
699
+ * Five React Hooks: Five 帮助元素的隐藏/显示
700
+ * @returns
701
+ * [ helperVisible: Five 帮助元素是否显示显示, toggleHelperVisible: 设置 帮助元素的隐藏/显示 ]
702
+ * @example
703
+ * ```
704
+ * const [ helperVisible, toggleHelperVisible ] = useFiveHelper;
705
+ * ```
706
+ */
707
+ export declare function useFiveHelper(): [
708
+ helperVisible: boolean,
709
+ toggleHelperVisible: (visible: boolean) => void
710
+ ];
649
711
 
650
712
  /**
651
713
  * Five React Hooks: 获取当前模型碰撞检测方法
@@ -668,7 +730,7 @@ export declare function useFiveEvent<T extends keyof EventCallback>(name: T, cal
668
730
  export declare function useFiveModelIntersectRaycaster(): (raycaster: THREE_2.Raycaster) => Intersection[];
669
731
 
670
732
  /**
671
- * Five React Hooks: 获取当前模型碰加载状态
733
+ * Five React Hooks: 获取当前模型加载状态
672
734
  * @returns
673
735
  * "Loaded": 加载完成
674
736
  * "Empty" 加载未完成
@@ -695,23 +757,29 @@ export declare function useFiveModelReadyState(): "Loaded" | "Empty";
695
757
  */
696
758
  export declare function useFiveProject2d(): (vector: THREE.Vector3, testModel: boolean) => Vector2;
697
759
 
760
+ /**
761
+ * @deprecated
762
+ * 请使用 `useFiveSceneEffect` 替代
763
+ */
764
+ export declare const useFiveScene: typeof useFiveSceneEffect;
765
+
698
766
  /**
699
767
  * Five React Hooks: 操作 Five 的 Scene
700
768
  * @param callback - 获取 Five 的 Scene 的回调函数
701
769
  * @example
702
770
  * ```
703
- * useFiveScene(scene => {
771
+ * useFiveSceneEffect(scene => {
704
772
  * // object is a THREE.Object3D
705
773
  * scene.add(object);
706
- * return () => scene.remove(object);
774
+ * return () => scene.remove(object); // 析构函数
707
775
  * });
708
776
  * ```
709
777
  */
710
- export declare function useFiveScene(callback: (scene: FiveScene) => void | (() => void), deps?: React_2.DependencyList | undefined): void;
778
+ export declare function useFiveSceneEffect(callback: (scene: Scene) => void | (() => void), deps?: React_2.DependencyList | undefined): void;
711
779
 
712
780
  export declare function useFiveState(): [
713
781
  state: State,
714
- setState: (state: Partial<State>, immediately?: boolean) => void
782
+ setState: (state: Partial<State> | ((prevState: State) => Partial<State>), immediately?: boolean, userAction?: boolean) => void
715
783
  ];
716
784
 
717
785
  /**
@@ -738,10 +806,10 @@ setState: (state: Partial<State>, immediately?: boolean) => void
738
806
  * ```
739
807
  */
740
808
  export declare function useFiveWork(): [
741
- work: Work,
742
- loadWork: (work: Work, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number) => void
809
+ work: Work | undefined,
810
+ loadWork: (work: Work, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number, userAction?: boolean) => Promise<void>
743
811
  ];
744
812
 
745
- export declare function withFive<F extends FiveInjectionFeature>(...features: F[]): <P extends InjectFiveToProps<F>, C extends React_2.ComponentClass<P, any>>(Component: C & React_2.ComponentClass<P, any>) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<Omit<P, "$five">> & React_2.RefAttributes<Omit<InstanceType<C>, "state" | "setState" | "render" | "componentDidMount" | "shouldComponentUpdate" | "componentWillUnmount" | "componentDidCatch" | "getSnapshotBeforeUpdate" | "componentDidUpdate" | "componentWillMount" | "UNSAFE_componentWillMount" | "componentWillReceiveProps" | "UNSAFE_componentWillReceiveProps" | "componentWillUpdate" | "UNSAFE_componentWillUpdate" | "context" | "forceUpdate" | "props" | "refs">>>;
813
+ export declare function withFive<F extends FiveInjectionFeature[]>(features: F): <P extends PropTypeOfFiveFeatures<F>, C extends React_2.ComponentClass<P, any>>(Component: C & React_2.ComponentClass<P, any>) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<Omit<P, "$five">> & React_2.RefAttributes<Omit<InstanceType<C>, "state" | "setState" | "render" | "componentDidMount" | "shouldComponentUpdate" | "componentWillUnmount" | "componentDidCatch" | "getSnapshotBeforeUpdate" | "componentDidUpdate" | "componentWillMount" | "UNSAFE_componentWillMount" | "componentWillReceiveProps" | "UNSAFE_componentWillReceiveProps" | "componentWillUpdate" | "UNSAFE_componentWillUpdate" | "context" | "forceUpdate" | "props" | "refs">>>;
746
814
 
747
815
  export { }