@ndmspc/ndmvr 0.20240427.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,443 +1,12 @@
1
- # ndmvr
1
+ # React + Vite
2
2
 
3
- [![NPM](https://img.shields.io/npm/v/@ndmspc/ndmvr.svg)](https://www.npmjs.com/package/@ndmspc/ndmvr)
4
- [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
5
4
 
6
- > NDimensional VR library
5
+ Currently, two official plugins are available:
7
6
 
8
- **NDMVR** is a package of the components that are used in the visualization of the histograms of the type such as TH in virtual reality.
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
9
 
10
- Library for displaying TH histograms in virtual reality.
10
+ ## Expanding the ESLint configuration
11
11
 
12
- > ### Library provides:
13
- >
14
- > - ndmVrHistogramScene
15
- > - ndmVrStorage
16
- > - jsrootHistogram
17
- >
18
-
19
- ---
20
-
21
- ## Install
22
-
23
- ```bash
24
- npm install --save @ndmspc/ndmvr
25
- ```
26
-
27
- After installation, you have 3 components which you can import and use.
28
-
29
- <code>import { ndmVrStorage, NdmVrScene, JSrootHistogram } from '@ndmspc/ndmvr'</code>
30
-
31
-
32
- To display the controls and background, you need to provide a file that contains the necessary resources, such as images. The user can then add their own backgrounds to the scene to the file structure and then use them to integrate the component. It is also possible to customize the controls according to the nature of the client application by editing textures.
33
-
34
- Otherwise, the user will have functional components that do not contain the appropriate textures.
35
-
36
- File structure:
37
-
38
- ``` sh
39
- ndmvr
40
- ├── backgrounds
41
- │ └── background1.png
42
- │ └── background2.jpg
43
- │ └── ...
44
- ├── keybordControls
45
- │ └── keyboard.png
46
- │ └── keuboard1.png
47
- │ └── keyboard2.png
48
- │ └── keuboard3.png
49
- ├── oculusControls
50
- │ └── oculus.png
51
- │ └── oculus1.png
52
- │ └── oculus2.png
53
- │ └── oculus3.png
54
- └── ...
55
- ```
56
-
57
- The file must be placed in the `public` directory in the client application to ensure access to resources in the project.
58
-
59
- To load all the default textures and resources for control and interaction, you must obtain the default file by downloading project resources:
60
-
61
- >
62
- >- [zip](https://gitlab.com/ndmspc/ndmvr/-/archive/v0.1.0/ndmvr-v0.1.0.zip)
63
- >- [tar.gz](https://gitlab.com/ndmspc/ndmvr/-/archive/v0.1.0/ndmvr-v0.1.0.tar.gz)
64
- >- [tar.bz2](https://gitlab.com/ndmspc/ndmvr/-/archive/v0.1.0/ndmvr-v0.1.0.tar.bz2)
65
- >- [tar](https://gitlab.com/ndmspc/ndmvr/-/archive/v0.1.0/ndmvr-v0.1.0.tar)
66
- >
67
-
68
- After obtaining the resources, it is necessary to move the `etc / ndmvr` directory to the` public` directory in the client application.
69
-
70
- Subsequently, everything is ready to use the package in the client application.
71
-
72
-
73
- ### Prepare environment
74
-
75
- For the use of this technology, it is necessary to have an appropriate environment for development, which depends on [Node >= 10.16](https://nodejs.org/en/) and the package manager such as [npm](https://www.npmjs.com/package/@ndmspc/ndmvr). The components have been developed using library [React](https://reactjs.org/docs/getting-started.html#try-react). From that reason, it is possible to integrate only in applications with the react.
76
-
77
- ---
78
-
79
- ## Components
80
-
81
- ---
82
-
83
- ### JsrootHistogram
84
-
85
- The component displays JSROOT projections.
86
-
87
- The example shows a projection from the root structure. In this case,`projIndex` is important and determines projection in the array.
88
- ```jsx
89
- <JSrootHistogram histogram={histogram} projectionAxes={['X','Y']} projections={projections} projIndex={0}/>
90
- ```
91
-
92
- The example shows a creating projection on axes X and Y. In this case, `projIndex` is useless.
93
-
94
- ```jsx
95
- <JSrootHistogram histogram={histogram} projectionAxes={['X','Y']} projections={null} projIndex={0}
96
- ```
97
-
98
- #### attribute ***histogram***
99
-
100
- This object defines main histogram TH.
101
- We get this object from ROOT file.
102
- More info about th histograms and objects are [here]()
103
-
104
- | Property | Type | Description | Default | Optional |
105
- | ------ | ------ | ------ | ------ | ------ |
106
- | **histogram** | Object | Main object defines histogram for displaying | `null` | `False` |
107
-
108
- #### attribute ***projections***
109
-
110
- File structure contains organised directories and projections for each bin of the main histogram.
111
-
112
- | Property | Type | Description | Default | Optional |
113
- | ------ | ------ | ------ | ------ | ------ |
114
- | **projections** | Object | File structure with projection | `null` | `True` |
115
-
116
- Structure of the files can look like that:
117
-
118
- ``` sh
119
- .
120
- ├── 1
121
- │ └── 1
122
- │ │ └── projectionArray
123
- │ └── 2
124
- │ └── 3
125
- │ └── 4
126
- │ └── ...
127
- ├── 2
128
- │ └── 1
129
- │ └── 2
130
- │ └── ...
131
- └── ...
132
- ```
133
-
134
- Displayed file structure describes the template where each bin has her own projection array addressed in directories with path, which determines the bin's coordinates.
135
- As we can see, the bin with x coordinate 1 and y coordinate 1 has a projection stored in a directory with path `root/1/1/projArray[0]`.
136
-
137
- #### attribute ***projectionAxes***
138
-
139
- To create 2-dimensional projection we define attribute as an array with names of the axes.
140
-
141
- This attribute is optional.
142
-
143
- | Property | Type | Description | Default | Optional |
144
- | ------ | ------ | ------ | ------ | ------ |
145
- | **projectionAxes** | Array | Array of projection objects | `null` | `True` |
146
-
147
- #### attribute ***projIndex***
148
-
149
- Choose the right projection from the projection array of the root directory.
150
-
151
- | Property | Type | Description | Default | Optional |
152
- | ------ | ------ | ------ | ------ | ------ |
153
- | **projIndex** | number | index of the projection in array | `0` | `True` |
154
-
155
-
156
- ### NdmVRHistogramScene
157
-
158
- The component is primary maintained for displaying VR scene with TH histogram. It contains 2 properties such as data and info.
159
-
160
- ```jsx
161
- <NdmVrScene data={data} info={info} />
162
- ```
163
-
164
- Properties are defined as an object with the necessary data.
165
-
166
- - **data** - primary data such as histogram object, projections...
167
- - **info** - secondary data for define schemes, background attributes...
168
-
169
- #### attribute ***data***
170
-
171
- | Property | Type | Description | Default | Optional |
172
- | ------ | ------ | ------ | ------ | ------ |
173
- | **histogram** | Object | Main object defines histogram for displaying | `null` | `False` |
174
- | **projections** | Object | File structure with projection | `null` | `True` |
175
- | **section** | Object | Data about offsets and histogram type | -- | `True` |
176
-
177
- ##### object ***histogram***
178
-
179
- This object defines main histogram TH.
180
- We get this object from ROOT file.
181
- More info about th histograms and objects are [here]()
182
-
183
- ##### object ***projections***
184
-
185
- File structure contains organised directories and projections for each bin of the main histogram.
186
- Structure of the files can look like that:
187
-
188
- ``` sh
189
- .
190
- ├── 1
191
- │ └── 1
192
- │ │ └── projectionArray
193
- │ └── 2
194
- │ └── 3
195
- │ └── 4
196
- │ └── ...
197
- ├── 2
198
- │ └── 1
199
- │ └── 2
200
- │ └── ...
201
- └── ...
202
- ```
203
-
204
- Displayed file structure describes the template where each bin has her own projection array addressed in directories with path, which determines the bin's coordinates.
205
- As we can see, the bin with x coordinate 1 and y coordinate 1 has a projection stored in a directory with path `root/1/1/projArray[0]`.
206
-
207
- ##### object ***section***
208
-
209
- The object defines data for displaying the right amount of data. The face of the object represents attributes for offset throughout axes, range and the typename of the histogram. The parameter is optional.
210
-
211
- Range defines how many bins will be displayed on an axis. In overall in Th3 histogram will be displayed (range+1 * range+1 * range+1) bins.
212
-
213
- The object should look like that:
214
-
215
- ``` js
216
- {
217
- name: 'TH3',
218
- xOffset: 1,
219
- yOffset: 1,
220
- zOffset: 1,
221
- range: 20
222
- }
223
- ```
224
-
225
- #### attribute ***info***
226
-
227
- This parameter is used for defining general information about histograms and themes.
228
-
229
- The object defines the scale and url of the image background, a user could use his or her own background image so that the user could save these images in the `public` directory of the client application.
230
-
231
- Main properties of the object info:
232
-
233
- | Property | Type | Description | Default | Optional |
234
- | ------ | ------ | ------ | ------ | ------ |
235
- | **name** | String | Unique name of the histogram | `null` | `True` |
236
- | **theme** | String | String defines theme | `def` | `False` |
237
- | **background** | Object | Object defines background properties | `null` | `True` |
238
-
239
- Main properties of the object background:
240
-
241
- | Property | Type | Description | Default | Optional |
242
- | ------ | ------ | ------ | ------ | ------ |
243
- | **url** | String | defines url of the background image | `./ndmvr/backgrounds/background1.jpg` | `False` |
244
- | **radius** | number | background radius | `3000` | `False` |
245
- | **height** | number | height of the background image | `2048` | `False` |
246
- | **width** | number | width of the background image | `2048` | `False` |
247
-
248
- ``` js
249
- {
250
- name: 'histogram unique name',
251
- theme: 'string characterizing the theme',
252
- background: {
253
- url: 'image url',
254
- radius: 'radius of the background in VR',
255
- height: 'height',
256
- width: 'height'
257
- }
258
- }
259
- ```
260
-
261
- ### NdmVRStorage
262
-
263
- Service manages offsets and ranges. Data are saved in localstorage for manipulation in next time.
264
-
265
- - Service provide function for storing offsets:
266
-
267
- ```js
268
- const section = {
269
- name: 'TH3',
270
- xOffset: 1,
271
- yOffset: 1,
272
- zOffset: 1,
273
- range: 8
274
- }
275
- storeOffsets(section)
276
- ```
277
- - Service provide function for loading offsets:
278
-
279
- ```js
280
- loadOffsets('TH3')
281
- ```
282
-
283
- If the localstorage has stored data, we get returned value represented an object which determines the section.
284
-
285
- ---
286
-
287
- ## Usage
288
-
289
- ```jsx
290
- import React, { Component } from 'react'
291
-
292
- import MyComponent from '@ndmspc/ndmvr'
293
- import '@ndmspc/ndmvr/dist/index.css'
294
-
295
- class Example extends Component {
296
- render() {
297
- return <MyComponent />
298
- }
299
- }
300
- ```
301
-
302
- ---
303
-
304
- ## Example
305
-
306
- The first step is to get the necessary objects that will need to be visualized using the **ndmVrHistogramScene** component. For this purpose, we can use the JSROOT object to create a histogram but also to obtain objects from **ROOT files**.
307
-
308
- ### get object from ***ROOT file***
309
-
310
-
311
- In this case, the url address of the root file is required. We should get all the objects needed for visualization from the file.
312
-
313
- To load an object, assume that we have a reference to the JSROOT object stored in the jsroot variable, which contains all the necessary functions.
314
-
315
- ```js
316
- // url root suboru
317
- let filename = 'https://eos.ndmspc.io/eos/ndmspc/scratch/test/gitlab-hist.root'
318
- // JSROOT funkcia pre otvorenie súboru, ako návratovú hodnotu ziskavame Promise.
319
- JSROOT.openFile(filename)
320
- // ak funkcia otvorí súbor následne dôjde k prečítaniu objektu "main" a vracia sa prečítaný objekt
321
- .then(file => file.readObject('main'))
322
- .then(obj => {
323
- /*
324
- * V tomto bloku spracujeme samotný objekt
325
- * Objekt získame ako parameter obj a vieme s ním pracovať
326
- * Vhodné je uloženie objektu do premennej a nastavenie stavu indikujúceho prístupnosť objektu
327
- */
328
- })
329
- .catch(error => {
330
- /*
331
- * V prípade ak dôjde k chybe vykoná sa tento blok
332
- */
333
- });
334
- ```
335
-
336
-
337
- ### Create histogram
338
-
339
-
340
- The JSROOT object also contains functions for creating histograms, this procedure is less recommended due to the fact that creating complex histograms can be difficult for the browser on the client side.
341
-
342
- Therefore, it is most recommended to create statistics in the ROOT application on a special device and distribute to the client already finished objects in the ROOT file, which are then only loaded and visualized by the client's browser.
343
-
344
- ```js
345
- // Fragment, ktorý vytvorí histogram TH2I s rozmermi 20x20 a vyplní obsahy binov
346
- const histo = jsroot.createHistogram('TH2I', 20, 20)
347
- // Počítadlo
348
- let cnt = 0;
349
- // Cykly na zabezpečenie prechodu všetkých binov vytvoreného histogramu
350
- for (var iy=1;iy<=20;iy++)
351
- for (var ix=1;ix<=20;ix++) {
352
- // Získanie konkrétneho objektu binu na základe jeho súradnic v histograme
353
- var bin = histo.getBin(ix, iy), val = 0;
354
- val=cnt;
355
- // Nastavenie hodnoty binu
356
- histo.setBinContent(bin, val);
357
- cnt+=0.1;
358
- }
359
- // Nastavenie globálnych údajov histogramu
360
- histo.fXaxis.fTitle = 'x Axis'
361
- histo.fYaxis.fTitle = 'y Axis'
362
- histo.fName = "You don't have a valid file path"
363
- histo.fTitle = "This is a TH2 histogram demo"
364
- histo.fMaximum = cnt
365
- ```
366
-
367
- #### Create visualization
368
-
369
-
370
- Ak už sú načítané potrebné objekty v aplikácii, tak je možné histogramy vizualizovať pomocou komponentov **NDMVR**.
371
-
372
- If the required objects in the application have already been loaded, the histograms can be visualized using the **NDMVR** components.
373
-
374
- ```jsx
375
- <NdmVrScene data={data} info={info} />
376
-
377
- ...
378
-
379
- <JSrootHistogram histogram={histograms.physics} projectionAxes={['X','Y']} projections={histograms.projections} projIndex={0}/>
380
- ```
381
-
382
- Components create everything you need. The parameters must be provided to the components as they were in the NDMVR documentation.
383
-
384
- ---
385
-
386
- ## VR Headset Specific Topics
387
-
388
- ### Oculus console log on the VR headset
389
- source: https://developer.oculus.com/documentation/web/browser-remote-debugging/
390
- The guide is for the Chrome browser.
391
-
392
-
393
- #### Software needed
394
- **The easiest way is to Download Meta Quest Developer Hub**
395
- - link for the windows: https://developer.oculus.com/downloads/package/oculus-developer-hub-win/
396
- - link for the mac: https://developer.oculus.com/downloads/package/oculus-developer-hub-mac/
397
-
398
- #### Setting up the console
399
-
400
- The first steps are done in MQDH:
401
-
402
- 1. Open the MQDH app
403
- 2. Choose the right path to ADB (Android Debug Bridge)
404
- 3. Sing in with the developer account (Ndm Spc)
405
- 4. Make sure your account is verified (Developer mode)
406
-
407
- Then we continue on the Headset:
408
-
409
- 5. Connect the headset to the computer using a USB-C cable
410
- 6. Click Allow when prompted to allow access to data.
411
-
412
- And now back in MQDH:
413
-
414
- 7. Add a new device in the MQDH
415
- 8. Choose your device (Ndm Spc)
416
- 9. Make sure developer mode is on
417
-
418
- Next, we have two options to continue:
419
- - via USB connection
420
- - via WiFi connection
421
-
422
-
423
- #### ADB over USB (Faster):
424
- 10. In chrome browser: Open on your computer: chrome://inspect/#devices
425
- 11. In chrome browser: Choose: Discover USB devices
426
- 12. In chrome browser: Choose the default option
427
-
428
- #### ADB over Wifi:
429
- 10. Turn on ADB over Wifi in the MQDH
430
- 11. Add new ADB command (adb shell ip route)in the MQDH or cmd
431
- 12. In chrome browser: Open: chrome://inspect/#devices
432
- 13. In chrome browser: Choose: Discover network targets
433
- 14. In chrome browser: Type the IP address from the created ADB command, a default port: 5555
434
-
435
-
436
- #### Note
437
- To open web developer tools for the opened browser windows in the VR headset on the address chrome://inspect/#devices, click on the browser window you want to see and click inspect
438
-
439
- ---
440
-
441
- ## License
442
-
443
- MIT © [NDMSPC](https://gitlab.com/ndmspc/ndmvr)
12
+ If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
package/dist/ndmvr.css ADDED
@@ -0,0 +1 @@
1
+ .main-div{width:calc(100vw - 250px);height:100%;display:flex;flex-direction:column}
@@ -0,0 +1,244 @@
1
+ import { binInfoSubjectGet } from '@ndmspc/ndmvr-core';
2
+ import { brokerManagerGet } from '@ndmspc/ndmvr-core';
3
+ import { canvasSubjectGet } from '@ndmspc/ndmvr-core';
4
+ import { ComponentType } from 'react';
5
+ import { configSubjectGet } from '@ndmspc/ndmvr-core';
6
+ import { Context } from 'react';
7
+ import { DefaultXRControllerOptions } from '@pmndrs/xr';
8
+ import { DefaultXRGazeOptions } from '@pmndrs/xr';
9
+ import { DefaultXRHandOptions } from '@pmndrs/xr';
10
+ import { DefaultXRScreenInputOptions } from '@pmndrs/xr';
11
+ import { DefaultXRTransientPointerOptions } from '@pmndrs/xr';
12
+ import { functionSubjectGet } from '@ndmspc/ndmvr-core';
13
+ import { histogramSubjectGet } from '@ndmspc/ndmvr-core';
14
+ import { JSX } from 'react/jsx-runtime';
15
+ import { NdmvrRaycaster } from '@ndmspc/ndmvr-core';
16
+ import { Position } from '@ndmspc/ndmvr-core';
17
+ import { Rotation } from '@ndmspc/ndmvr-core';
18
+ import { Scale } from '@ndmspc/ndmvr-core';
19
+ import { stateSubjectGet } from '@ndmspc/ndmvr-core';
20
+ import * as THREE from 'three';
21
+ import { XRStore } from '@pmndrs/xr';
22
+
23
+ export declare function BinInfo({ originRef, precision, offset, }: BinInfoProps): JSX.Element;
24
+
25
+ export declare interface BinInfoProps {
26
+ originRef: React.RefObject<THREE.Group>;
27
+ precision?: number;
28
+ offset?: {
29
+ x: number;
30
+ y: number;
31
+ z: number;
32
+ };
33
+ }
34
+
35
+ export { binInfoSubjectGet }
36
+
37
+ export { brokerManagerGet }
38
+
39
+ export declare function CameraSync({ cameraRef, originRef }: CameraSyncProps): any;
40
+
41
+ export declare interface CameraSyncProps {
42
+ cameraRef: React.RefObject<THREE.Camera>;
43
+ originRef: React.RefObject<THREE.Group>;
44
+ }
45
+
46
+ export declare function CanvasComponent({ id, location, position, rotation, scale, }: CanvasComponentProps): JSX.Element;
47
+
48
+ export declare interface CanvasComponentProps {
49
+ id?: string;
50
+ location?: CanvasLocation;
51
+ position?: Position;
52
+ rotation?: Rotation;
53
+ scale?: Scale;
54
+ }
55
+
56
+ export declare interface CanvasLocation {
57
+ position?: Position;
58
+ scale?: Scale;
59
+ rotation?: Rotation;
60
+ }
61
+
62
+ export { canvasSubjectGet }
63
+
64
+ export { configSubjectGet }
65
+
66
+ export declare function Controllers({ originRef, cameraRef, setShowMenu, setShowHelp, desktopSpeed, vrSpeed, }: ControllersProps): JSX.Element;
67
+
68
+ export declare interface ControllersProps {
69
+ originRef: React.RefObject<THREE.Group>;
70
+ cameraRef: React.RefObject<THREE.Camera>;
71
+ setShowMenu: React.Dispatch<React.SetStateAction<boolean>>;
72
+ setShowHelp: React.Dispatch<React.SetStateAction<boolean>>;
73
+ desktopSpeed?: number;
74
+ vrSpeed?: number;
75
+ }
76
+
77
+ export declare function ControlsHelp(): JSX.Element;
78
+
79
+ export declare function DesktopController({ originRef, cameraRef, speed, onToggleMenu, onToggleHelp, }: DesktopControllerProps): any;
80
+
81
+ export declare interface DesktopControllerProps {
82
+ originRef: React.RefObject<THREE.Group>;
83
+ cameraRef: React.RefObject<THREE.Camera>;
84
+ speed?: number;
85
+ onToggleMenu?: () => void;
86
+ onToggleHelp?: () => void;
87
+ }
88
+
89
+ export { functionSubjectGet }
90
+
91
+ export declare const HistogramContext: Context<any>;
92
+
93
+ export { histogramSubjectGet }
94
+
95
+ export declare function HistogramWrapper({ id }: HistogramWrapperProps): JSX.Element;
96
+
97
+ export declare interface HistogramWrapperProps {
98
+ id: string;
99
+ }
100
+
101
+ export declare const IframeCernboxService: ({ targetOrigin, onConfigLoad }: IframeServiceProps_2) => any;
102
+
103
+ declare interface IframeMessage {
104
+ data: {
105
+ action: string;
106
+ content: string;
107
+ };
108
+ }
109
+
110
+ export declare const IframeService: ({ targetOrigin, onMessage }: IframeServiceProps) => any;
111
+
112
+ declare interface IframeServiceProps {
113
+ targetOrigin?: string;
114
+ onMessage?: (message: IframeMessage) => void;
115
+ }
116
+
117
+ declare interface IframeServiceProps_2 {
118
+ targetOrigin?: string;
119
+ onConfigLoad?: (config: unknown) => void;
120
+ }
121
+
122
+ export declare function JsrootEnv(): JSX.Element;
123
+
124
+ export declare function Menu({ originRef, offset, onClose, currentConfig, onConfigChange, openHelp, }: MenuProps): JSX.Element;
125
+
126
+ export declare interface MenuProps {
127
+ originRef: React.RefObject<THREE.Group>;
128
+ offset?: {
129
+ x: number;
130
+ y: number;
131
+ z: number;
132
+ };
133
+ onClose?: () => void;
134
+ currentConfig?: NdmvrConfig | null;
135
+ onConfigChange?: ((config: Record<string, unknown>) => void) | null;
136
+ openHelp?: () => void;
137
+ help?: boolean;
138
+ }
139
+
140
+ export declare interface NdmspcConfig {
141
+ type: string;
142
+ file?: string;
143
+ }
144
+
145
+ export declare function NdmspcDefaultBrowserEnv({ children, config, onConfigChange, menu, help, renderer, vr, file, item, opt, title, layout, defaultDrawOpt, }: NdmspcDefaultBrowserEnvProps): JSX.Element;
146
+
147
+ export declare interface NdmspcDefaultBrowserEnvProps {
148
+ children?: React.ReactNode;
149
+ config?: NdmvrConfig | null;
150
+ onConfigChange?: ((config: NdmspcConfig) => void) | null;
151
+ controlsHelp?: boolean;
152
+ renderer?: "jsroot" | "ndmvr";
153
+ vr?: boolean;
154
+ menu?: boolean;
155
+ help?: boolean;
156
+ file?: string | null;
157
+ item?: string | null;
158
+ opt?: string | null;
159
+ title?: string | null;
160
+ layout?: string | null;
161
+ defaultDrawOpt?: Record<string, string> | null;
162
+ }
163
+
164
+ export declare function NdmspcEnv({ children, config, onConfigChange, help, menu, }: NdmspcEnvProps): JSX.Element;
165
+
166
+ export declare interface NdmspcEnvProps {
167
+ children?: React.ReactNode;
168
+ config?: NdmvrConfig | null;
169
+ onConfigChange?: ((config: Record<string, unknown>) => void) | null;
170
+ controlsHelp?: boolean;
171
+ menu?: boolean;
172
+ help?: boolean;
173
+ }
174
+
175
+ export declare function NdmspcNavigator({ children, menu, help, ndmspcConfig, ndmvrConfig, }: NdmspcNavigatorProps): JSX.Element;
176
+
177
+ declare interface NdmspcNavigatorProps {
178
+ children?: React.ReactNode;
179
+ menu?: boolean;
180
+ help?: boolean;
181
+ ndmspcConfig?: NdmspcConfig | null;
182
+ ndmvrConfig?: NdmvrConfig | null;
183
+ }
184
+
185
+ export declare interface NdmvrConfig {
186
+ config?: object;
187
+ }
188
+
189
+ export declare function NdmvrEnv({ children, currentConfig, onConfigChange, menu, help, showUIExternal, onUIStateChange, }: NdmvrEnvProps): JSX.Element;
190
+
191
+ export declare interface NdmvrEnvProps {
192
+ children?: React.ReactNode;
193
+ controlsHelp?: boolean;
194
+ currentConfig?: NdmvrConfig;
195
+ onConfigChange?: ((config: NdmvrConfig) => void) | null;
196
+ menu?: boolean;
197
+ help?: boolean;
198
+ showUIExternal?: boolean;
199
+ onUIStateChange?: (isVisible: boolean) => void;
200
+ }
201
+
202
+ export declare function NdmvrScene({ originRef }: NdmvrSceneProps): JSX.Element;
203
+
204
+ export declare interface NdmvrSceneProps {
205
+ originRef: React.RefObject<THREE.Group>;
206
+ }
207
+
208
+ export declare function RaycasterBridge({ rc, originRef, doubleClickMs, handedness, }: RaycasterBridgeProps): any;
209
+
210
+ export declare interface RaycasterBridgeProps {
211
+ rc: NdmvrRaycaster | null;
212
+ originRef: React.RefObject<THREE.Group> | null;
213
+ doubleClickMs?: number;
214
+ handedness?: "left" | "right" | "none";
215
+ }
216
+
217
+ export { stateSubjectGet }
218
+
219
+ export declare const store: XRStore< {
220
+ hand: ComponentType | boolean | DefaultXRHandOptions;
221
+ controller: ComponentType | boolean | DefaultXRControllerOptions;
222
+ transientPointer: ComponentType | boolean | DefaultXRTransientPointerOptions;
223
+ gaze: ComponentType | boolean | DefaultXRGazeOptions;
224
+ screenInput: ComponentType | boolean | DefaultXRScreenInputOptions;
225
+ detectedMesh: ComponentType | false;
226
+ detectedPlane: ComponentType | false;
227
+ }>;
228
+
229
+ export declare const useNdmspcConfig: (config: NdmspcConfig) => any;
230
+
231
+ export declare const useNdmspcWebsocket: (url?: string, timeout?: number) => any;
232
+
233
+ export declare function VRController({ originRef, speed, snapAngle, snapDelay, onToggleMenu, onToggleHelp, }: VRControllerProps): any;
234
+
235
+ export declare interface VRControllerProps {
236
+ originRef: React.RefObject<THREE.Group>;
237
+ speed?: number;
238
+ snapAngle?: number;
239
+ snapDelay?: number;
240
+ onToggleMenu?: () => void;
241
+ onToggleHelp?: () => void;
242
+ }
243
+
244
+ export { }