@neurodyn/react-model-viewer 0.0.1 → 0.0.3
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/dist/index.d.ts +49 -5
- package/dist/index.js +780 -106
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -3,15 +3,33 @@ import { JSX } from 'react/jsx-runtime';
|
|
|
3
3
|
import type { default as React_2 } from 'react';
|
|
4
4
|
import * as React_3 from 'react';
|
|
5
5
|
|
|
6
|
+
/** What the host needs to open its own AR experience for the shown model. */
|
|
7
|
+
export declare interface ArLaunchTarget {
|
|
8
|
+
/** Material collection currently shown, which may differ from the entry url. */
|
|
9
|
+
hid?: string;
|
|
10
|
+
tinuuid: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
declare type DialogProps = React_3.ComponentProps<typeof DialogPrimitive.Root>
|
|
7
14
|
|
|
8
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Lets the host open its own AR experience instead of the native one.
|
|
17
|
+
*
|
|
18
|
+
* Returning `true` means the host took the launch over: the viewer then skips
|
|
19
|
+
* both the native handoff and its own `ar_launched`, so one tap stays one
|
|
20
|
+
* event. Anything else falls through to the usual behaviour.
|
|
21
|
+
*/
|
|
22
|
+
export declare type LaunchArOverride = (target: ArLaunchTarget) => boolean | Promise<boolean>;
|
|
23
|
+
|
|
24
|
+
export declare function ModelViewer({ tinuuid, apiKey, appClipBundleId, arExperience, hid, apiBaseUrl, legacyApiBaseUrl, mode, initialWidgetSessionToken, handoffUrl, launchAr, sizeType, layout, background, viewerSurface, className, ...props }: ModelViewerProps & React_2.ComponentProps<'div'>): JSX.Element;
|
|
25
|
+
|
|
26
|
+
export declare type ModelViewerArExperience = 'advanced' | 'standard';
|
|
9
27
|
|
|
10
28
|
declare type ModelViewerBackground = 'default' | 'transparent';
|
|
11
29
|
|
|
12
|
-
export declare function ModelViewerDialog({ tinuuid, apiKey, hid, ...props }: ModelViewerDialogProps): JSX.Element;
|
|
30
|
+
export declare function ModelViewerDialog({ tinuuid, apiKey, apiBaseUrl, legacyApiBaseUrl, initialWidgetSessionToken, handoffUrl, hid, sizeType, ...props }: ModelViewerDialogProps): JSX.Element;
|
|
13
31
|
|
|
14
|
-
declare interface ModelViewerDialogProps extends Pick<ModelViewerRootProps, '
|
|
32
|
+
declare interface ModelViewerDialogProps extends Pick<ModelViewerRootProps, 'apiBaseUrl' | 'apiKey' | 'handoffUrl' | 'hid' | 'initialWidgetSessionToken' | 'legacyApiBaseUrl' | 'sizeType' | 'tinuuid'>, Omit<DialogProps, 'children'> {
|
|
15
33
|
}
|
|
16
34
|
|
|
17
35
|
declare type ModelViewerLayout = 'default' | 'model';
|
|
@@ -22,16 +40,42 @@ export declare interface ModelViewerProps extends Omit<ModelViewerRootProps, 'sh
|
|
|
22
40
|
declare interface ModelViewerRootProps {
|
|
23
41
|
/** The unique identifier of a Vizbl object. */
|
|
24
42
|
tinuuid: string;
|
|
25
|
-
/** Public API key. */
|
|
26
|
-
apiKey
|
|
43
|
+
/** Public API key. Without it, the viewer uses the legacy `/obj/Fetch` API. */
|
|
44
|
+
apiKey?: string | null;
|
|
45
|
+
/** App Clip bundle used by automatic Advanced AR handoffs. */
|
|
46
|
+
appClipBundleId?: string;
|
|
47
|
+
/** Standard or Advanced launch behavior for the shared QR backend mode. */
|
|
48
|
+
arExperience?: ModelViewerArExperience;
|
|
27
49
|
/** The identifier of a material variant. */
|
|
28
50
|
hid?: string | null;
|
|
51
|
+
/** Node Public API base URL. */
|
|
52
|
+
apiBaseUrl?: string;
|
|
53
|
+
/** Legacy Go API base URL used only when `apiKey` is missing. */
|
|
54
|
+
legacyApiBaseUrl?: string;
|
|
55
|
+
/** Widget integration mode recorded by the backend session. */
|
|
56
|
+
mode?: ModelViewerWidgetMode;
|
|
57
|
+
/** Existing token used to preserve the same widget session across a handoff. */
|
|
58
|
+
initialWidgetSessionToken?: string;
|
|
59
|
+
/** Hosted viewer URL encoded into the desktop-to-mobile QR handoff. */
|
|
60
|
+
handoffUrl?: string;
|
|
61
|
+
/** Lets the host open its own AR experience instead of the native handoff. */
|
|
62
|
+
launchAr?: LaunchArOverride;
|
|
63
|
+
/** Display unit for model dimensions. */
|
|
64
|
+
sizeType?: SizeType;
|
|
29
65
|
/** Controls which viewer UI elements are shown. */
|
|
30
66
|
layout?: ModelViewerLayout;
|
|
31
67
|
/** Controls the viewer container background. */
|
|
32
68
|
background?: ModelViewerBackground;
|
|
33
69
|
/** Enables dialog-only close controls. */
|
|
34
70
|
showDialogCloseButton?: boolean;
|
|
71
|
+
/** Controls open-event semantics for inline, dialog, and hosted-page viewers. */
|
|
72
|
+
viewerSurface?: ModelViewerSurface;
|
|
35
73
|
}
|
|
36
74
|
|
|
75
|
+
declare type ModelViewerSurface = 'dialog' | 'inline' | 'page';
|
|
76
|
+
|
|
77
|
+
export declare type ModelViewerWidgetMode = 'advanced-ar-view' | 'ar-view' | 'embedded-3d-viewer' | 'ar-viewer' | 'qr-code';
|
|
78
|
+
|
|
79
|
+
declare type SizeType = 'cm' | 'inch';
|
|
80
|
+
|
|
37
81
|
export { }
|