gps-plus-slam-app-framework 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/LICENSE +201 -0
- package/README.md +222 -0
- package/dist/alignment-lerper-D9BeDwZX.d.ts +29 -0
- package/dist/app-selectors-DyMzxCEC.d.ts +140 -0
- package/dist/ar/camera-blit-capture.d.ts +2 -0
- package/dist/ar/camera-blit-capture.js +253 -0
- package/dist/ar/capture-failure-tracker.d.ts +2 -0
- package/dist/ar/capture-failure-tracker.js +45 -0
- package/dist/ar/chromium-camera-access-workaround.d.ts +2 -0
- package/dist/ar/chromium-camera-access-workaround.js +32 -0
- package/dist/ar/depth-sampler.d.ts +3 -0
- package/dist/ar/depth-sampler.js +147 -0
- package/dist/ar/image-capture.d.ts +2 -0
- package/dist/ar/image-capture.js +152 -0
- package/dist/ar/index.d.ts +12 -0
- package/dist/ar/index.js +12 -0
- package/dist/ar/replay-scene.d.ts +2 -0
- package/dist/ar/replay-scene.js +325 -0
- package/dist/ar/scene-node-names.d.ts +2 -0
- package/dist/ar/scene-node-names.js +16 -0
- package/dist/ar/tracking-state.d.ts +2 -0
- package/dist/ar/tracking-state.js +164 -0
- package/dist/ar/webxr-session.d.ts +4 -0
- package/dist/ar/webxr-session.js +890 -0
- package/dist/ar/xr-camera-texture.d.ts +2 -0
- package/dist/ar/xr-camera-texture.js +39 -0
- package/dist/ar/xr-error-handler.d.ts +2 -0
- package/dist/ar/xr-error-handler.js +37 -0
- package/dist/ar-types-B-ORgk6Z.d.ts +82 -0
- package/dist/camera-blit-capture-DHuyrrxr.d.ts +108 -0
- package/dist/camera-follower-BMqPddxx.d.ts +29 -0
- package/dist/capture-failure-tracker-2Q6oI2uQ.d.ts +52 -0
- package/dist/chromium-camera-access-workaround-CU5zSKNr.d.ts +61 -0
- package/dist/community-license-key-ChZLCJyO.d.ts +21 -0
- package/dist/concurrency-p6gB30fT.d.ts +24 -0
- package/dist/css3d-renderer-manager-rgLMVAvd.d.ts +23 -0
- package/dist/depth-sampler-BNCtnEoP.d.ts +108 -0
- package/dist/failure-tracker-1sQ_Cgyw.d.ts +49 -0
- package/dist/file-system-BsQgYCU3.d.ts +128 -0
- package/dist/file-system-utils-5cWO8Xyv.d.ts +24 -0
- package/dist/format-file-size-onGq0k1Q.d.ts +24 -0
- package/dist/fused-path-DtqCSqJh.d.ts +25 -0
- package/dist/geo-types-Xx-LVcnw.d.ts +29 -0
- package/dist/gps-Ddzr2KlX.d.ts +54 -0
- package/dist/gps-compass-cubes-C-6JEnpR.d.ts +22 -0
- package/dist/gps-error-handler-VPuNOuf8.d.ts +40 -0
- package/dist/gps-event-markers-DpEy2qRd.d.ts +67 -0
- package/dist/h3-ref-point-CFhayNSZ.d.ts +59 -0
- package/dist/image-capture-2pKjYUS6.d.ts +130 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +61 -0
- package/dist/leaflet-map-overlay-CvfQXTye.d.ts +114 -0
- package/dist/lerp-utils-87NWjUOD.d.ts +20 -0
- package/dist/licensing/community-license-key.d.ts +2 -0
- package/dist/licensing/community-license-key.js +21 -0
- package/dist/licensing/index.d.ts +2 -0
- package/dist/licensing/index.js +2 -0
- package/dist/list-formatter-DKQQVLcl.d.ts +14 -0
- package/dist/logger-B81iwxx0.d.ts +74 -0
- package/dist/map-overlay-DuiZuCTx.d.ts +153 -0
- package/dist/null-storage-backend-CsWvQwN8.d.ts +11 -0
- package/dist/opfs-storage-ChOzF_Wp.d.ts +181 -0
- package/dist/opfs-storage-backend-CVcmfJHN.d.ts +11 -0
- package/dist/permission-checker-jO2ziCWC.d.ts +146 -0
- package/dist/persistence-middleware-DrptY02i.d.ts +31 -0
- package/dist/recorder-slice-fcwAXrsh.d.ts +35 -0
- package/dist/recording-coordinator-DzflP07_.d.ts +81 -0
- package/dist/recording-options-BYUFX8iU.d.ts +166 -0
- package/dist/recording-replayer-oOzPITrd.d.ts +32 -0
- package/dist/ref-point-importer-B_wn5ABk.d.ts +62 -0
- package/dist/ref-point-loader-Pt1smgHS.d.ts +117 -0
- package/dist/ref-points/h3-ref-point.d.ts +2 -0
- package/dist/ref-points/h3-ref-point.js +74 -0
- package/dist/ref-points/index.d.ts +2 -0
- package/dist/ref-points/index.js +2 -0
- package/dist/ref-points-slice-tC-Wd6XJ.d.ts +48 -0
- package/dist/reference-points-CFWy8_wj.d.ts +68 -0
- package/dist/replay-engine-DuX316ae.d.ts +103 -0
- package/dist/replay-scene-DtUm6bsr.d.ts +109 -0
- package/dist/routing-slice-BlHTM8eh.d.ts +23 -0
- package/dist/scene-node-names-DPsaE2z3.d.ts +14 -0
- package/dist/sensors/gps-error-handler.d.ts +2 -0
- package/dist/sensors/gps-error-handler.js +53 -0
- package/dist/sensors/gps.d.ts +2 -0
- package/dist/sensors/gps.js +93 -0
- package/dist/sensors/index.d.ts +4 -0
- package/dist/sensors/index.js +4 -0
- package/dist/sensors/permission-checker.d.ts +2 -0
- package/dist/sensors/permission-checker.js +397 -0
- package/dist/state/app-selectors.d.ts +2 -0
- package/dist/state/app-selectors.js +35 -0
- package/dist/state/index.d.ts +17 -0
- package/dist/state/index.js +13 -0
- package/dist/state/persistence-middleware.d.ts +2 -0
- package/dist/state/persistence-middleware.js +71 -0
- package/dist/state/recorder-slice.d.ts +2 -0
- package/dist/state/recorder-slice.js +47 -0
- package/dist/state/recording-coordinator.d.ts +2 -0
- package/dist/state/recording-coordinator.js +150 -0
- package/dist/state/recording-options.d.ts +2 -0
- package/dist/state/recording-options.js +192 -0
- package/dist/state/recording-replayer.d.ts +2 -0
- package/dist/state/recording-replayer.js +39 -0
- package/dist/state/ref-points-slice.d.ts +2 -0
- package/dist/state/ref-points-slice.js +44 -0
- package/dist/state/replay-engine.d.ts +2 -0
- package/dist/state/replay-engine.js +230 -0
- package/dist/state/routing-slice.d.ts +2 -0
- package/dist/state/routing-slice.js +13 -0
- package/dist/state/store-subscribers.d.ts +3 -0
- package/dist/state/store-subscribers.js +97 -0
- package/dist/state/store.d.ts +9 -0
- package/dist/state/store.js +71 -0
- package/dist/state/subscribe-to-selector.d.ts +2 -0
- package/dist/state/subscribe-to-selector.js +26 -0
- package/dist/storage/file-system-utils.d.ts +2 -0
- package/dist/storage/file-system-utils.js +31 -0
- package/dist/storage/file-system.d.ts +2 -0
- package/dist/storage/file-system.js +229 -0
- package/dist/storage/index.d.ts +11 -0
- package/dist/storage/index.js +10 -0
- package/dist/storage/null-storage-backend.d.ts +2 -0
- package/dist/storage/null-storage-backend.js +8 -0
- package/dist/storage/opfs-storage-backend.d.ts +2 -0
- package/dist/storage/opfs-storage-backend.js +15 -0
- package/dist/storage/opfs-storage.d.ts +2 -0
- package/dist/storage/opfs-storage.js +242 -0
- package/dist/storage/ref-point-importer.d.ts +2 -0
- package/dist/storage/ref-point-importer.js +163 -0
- package/dist/storage/ref-point-loader.d.ts +2 -0
- package/dist/storage/ref-point-loader.js +248 -0
- package/dist/storage/ref-point-recovery.d.ts +28 -0
- package/dist/storage/ref-point-recovery.js +159 -0
- package/dist/storage/storage-backend.d.ts +2 -0
- package/dist/storage/storage-backend.js +1 -0
- package/dist/storage/zip-export.d.ts +2 -0
- package/dist/storage/zip-export.js +214 -0
- package/dist/storage/zip-reader.d.ts +2 -0
- package/dist/storage/zip-reader.js +190 -0
- package/dist/storage-backend-BcEItnFr.d.ts +20 -0
- package/dist/store-C7PKOj8S.d.ts +96 -0
- package/dist/store-subscribers-CuoIzB5T.d.ts +77 -0
- package/dist/subscribe-to-selector-UTZ0KkAc.d.ts +26 -0
- package/dist/test-utils/browser-mocks.d.ts +294 -0
- package/dist/test-utils/browser-mocks.js +568 -0
- package/dist/test-utils/zip-round-trip-helpers.d.ts +60 -0
- package/dist/test-utils/zip-round-trip-helpers.js +207 -0
- package/dist/three-dispose-CCBHjE_a.d.ts +30 -0
- package/dist/tracking-state-B9QfuZCg.d.ts +101 -0
- package/dist/types/ar-types.d.ts +2 -0
- package/dist/types/ar-types.js +1 -0
- package/dist/types/geo-types.d.ts +2 -0
- package/dist/types/geo-types.js +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/concurrency.d.ts +2 -0
- package/dist/utils/concurrency.js +40 -0
- package/dist/utils/failure-tracker.d.ts +2 -0
- package/dist/utils/failure-tracker.js +48 -0
- package/dist/utils/format-file-size.d.ts +2 -0
- package/dist/utils/format-file-size.js +41 -0
- package/dist/utils/fused-path.d.ts +2 -0
- package/dist/utils/fused-path.js +44 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/list-formatter.d.ts +2 -0
- package/dist/utils/list-formatter.js +17 -0
- package/dist/utils/logger.d.ts +2 -0
- package/dist/utils/logger.js +226 -0
- package/dist/vis-colors-Qi2vlRGt.d.ts +63 -0
- package/dist/visualization/alignment-lerper.d.ts +2 -0
- package/dist/visualization/alignment-lerper.js +68 -0
- package/dist/visualization/camera-follower.d.ts +2 -0
- package/dist/visualization/camera-follower.js +51 -0
- package/dist/visualization/css3d-renderer-manager.d.ts +2 -0
- package/dist/visualization/css3d-renderer-manager.js +41 -0
- package/dist/visualization/gps-compass-cubes.d.ts +2 -0
- package/dist/visualization/gps-compass-cubes.js +129 -0
- package/dist/visualization/gps-event-markers.d.ts +2 -0
- package/dist/visualization/gps-event-markers.js +159 -0
- package/dist/visualization/index.d.ts +12 -0
- package/dist/visualization/index.js +12 -0
- package/dist/visualization/leaflet-map-overlay.d.ts +2 -0
- package/dist/visualization/leaflet-map-overlay.js +313 -0
- package/dist/visualization/lerp-utils.d.ts +2 -0
- package/dist/visualization/lerp-utils.js +22 -0
- package/dist/visualization/map-overlay.d.ts +2 -0
- package/dist/visualization/map-overlay.js +241 -0
- package/dist/visualization/reference-points.d.ts +2 -0
- package/dist/visualization/reference-points.js +160 -0
- package/dist/visualization/three-dispose.d.ts +2 -0
- package/dist/visualization/three-dispose.js +55 -0
- package/dist/visualization/vis-colors.d.ts +2 -0
- package/dist/visualization/vis-colors.js +74 -0
- package/dist/webxr-session-COlSrXdL.d.ts +316 -0
- package/dist/xr-camera-texture-BbukNE79.d.ts +53 -0
- package/dist/xr-error-handler-DTHfmvrl.d.ts +24 -0
- package/dist/zip-export-Rtpi75JJ.d.ts +87 -0
- package/dist/zip-reader-D7pkpX8K.d.ts +97 -0
- package/package.json +104 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { i as DepthSample, t as ARPose } from "./ar-types-B-ORgk6Z.js";
|
|
2
|
+
import { i as ImageCaptureConfig, t as CapturedImage } from "./image-capture-2pKjYUS6.js";
|
|
3
|
+
import { t as Css3dRendererManager } from "./css3d-renderer-manager-rgLMVAvd.js";
|
|
4
|
+
import { n as ResetTransformData } from "./tracking-state-B9QfuZCg.js";
|
|
5
|
+
import { t as ArCrashIsolationOptions } from "./recording-options-BYUFX8iU.js";
|
|
6
|
+
import { r as XRCameraLike } from "./xr-camera-texture-BbukNE79.js";
|
|
7
|
+
import * as THREE from "three";
|
|
8
|
+
import { OdometryTrackingRestartedPayload } from "gps-plus-slam-js";
|
|
9
|
+
|
|
10
|
+
//#region ../src/ar/webxr-session.d.ts
|
|
11
|
+
declare function isXRCameraLike(value: unknown): value is XRCameraLike;
|
|
12
|
+
/**
|
|
13
|
+
* Extract a validated XRCameraLike from an XRViewerPose.
|
|
14
|
+
*
|
|
15
|
+
* Returns null in every case where the per-frame texture acquisition must be
|
|
16
|
+
* skipped — i.e. whenever the caller should treat any previously cached
|
|
17
|
+
* texture as stale and clear it. Centralising the preconditions here makes
|
|
18
|
+
* it impossible to accidentally fall through without clearing the cache.
|
|
19
|
+
*
|
|
20
|
+
* Cases that return null:
|
|
21
|
+
* - pose is null (tracking lost)
|
|
22
|
+
* - pose has no views
|
|
23
|
+
* - the first view has no `camera` property (camera-access not granted)
|
|
24
|
+
* - the camera property is not a valid XRCameraLike (zero/NaN dimensions)
|
|
25
|
+
*
|
|
26
|
+
* @see docs/2026-02-06-bug-camera-frames-black.md
|
|
27
|
+
*/
|
|
28
|
+
declare function getXrCameraFromPose(pose: XRViewerPose | null): XRCameraLike | null;
|
|
29
|
+
/**
|
|
30
|
+
* Decide whether the one-time camera-access grant diagnostic should fire
|
|
31
|
+
* on the current XR frame.
|
|
32
|
+
*
|
|
33
|
+
* The diagnostic is only meaningful when we actually have a valid pose:
|
|
34
|
+
* if `pose` is null (e.g. session starts with tracking lost), then the
|
|
35
|
+
* derived `xrCamera` is null regardless of permission state, and logging
|
|
36
|
+
* "NOT GRANTED" would be a false negative that permanently suppresses the
|
|
37
|
+
* correct status because `cameraAccessLoggedOnce` would latch to true.
|
|
38
|
+
*
|
|
39
|
+
* Additional conditions:
|
|
40
|
+
* - `alreadyLogged` prevents spamming the log every frame.
|
|
41
|
+
* - `captureActive` ensures we only care when an image capture session
|
|
42
|
+
* is running (otherwise the diagnostic has no audience).
|
|
43
|
+
*
|
|
44
|
+
* This predicate is extracted as a pure function so the guard against the
|
|
45
|
+
* "first frame has no pose" false-negative regression is directly testable.
|
|
46
|
+
*/
|
|
47
|
+
declare function shouldLogCameraAccessDiagnostic(pose: XRViewerPose | null, alreadyLogged: boolean, captureActive: boolean): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Reset WebXR module state - exported for testing only.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
declare function resetWebXRState(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Extract the reset transform from an XRReferenceSpaceEvent-like object.
|
|
55
|
+
*
|
|
56
|
+
* Distinguishes three cases per OdometryTrackingRestartedPayload semantics:
|
|
57
|
+
* - Transform property missing (older browsers) → returns `undefined`
|
|
58
|
+
* - Transform property present but null (runtime can't determine delta) → returns `null`
|
|
59
|
+
* - Transform property present with data → returns `ResetTransformData`
|
|
60
|
+
*
|
|
61
|
+
* This is a pure function extracted for testability.
|
|
62
|
+
*
|
|
63
|
+
* @param event - The event object, cast to a record with an optional transform property
|
|
64
|
+
* @returns ResetTransformData, null, or undefined
|
|
65
|
+
*/
|
|
66
|
+
declare function extractResetTransformData(event: Record<string, unknown>): ResetTransformData | null | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Extract pose data from an XRViewerPose.
|
|
69
|
+
* Returns null if pose or views are unavailable.
|
|
70
|
+
*
|
|
71
|
+
* This is a pure function extracted for testability.
|
|
72
|
+
*
|
|
73
|
+
* @param pose - The XRViewerPose from frame.getViewerPose()
|
|
74
|
+
* @returns ARPose with position and orientation, or null
|
|
75
|
+
*/
|
|
76
|
+
declare function extractPoseFromViewer(pose: XRViewerPose | null): ARPose | null;
|
|
77
|
+
/**
|
|
78
|
+
* Get the current raw AR pose from the latest XR frame.
|
|
79
|
+
* This is updated every frame and should be called when GPS arrives
|
|
80
|
+
* to get the AR pose at that moment.
|
|
81
|
+
*
|
|
82
|
+
* IMPORTANT: This returns the RAW pose from WebXR, NOT transformed
|
|
83
|
+
* by any alignment matrix. This is what we record to the store.
|
|
84
|
+
*
|
|
85
|
+
* @returns The latest AR pose, or null if no pose available yet
|
|
86
|
+
*/
|
|
87
|
+
declare function getCurrentArPose(): ARPose | null;
|
|
88
|
+
/**
|
|
89
|
+
* Build XR session init options.
|
|
90
|
+
* Extracted as a pure function for testability.
|
|
91
|
+
*
|
|
92
|
+
* @param rootElement - The DOM element for DOM overlay
|
|
93
|
+
* @returns XRSessionInit options
|
|
94
|
+
* @throws Error if rootElement is null
|
|
95
|
+
*/
|
|
96
|
+
declare function buildSessionOptions(rootElement: Element | null, isolationOptions?: Partial<ArCrashIsolationOptions>): XRSessionInit;
|
|
97
|
+
/**
|
|
98
|
+
* Check if WebXR immersive-ar is supported
|
|
99
|
+
*/
|
|
100
|
+
declare function isWebXRSupported(): Promise<boolean>;
|
|
101
|
+
/**
|
|
102
|
+
* Create the scene hierarchy with proper AR/GPS frame separation.
|
|
103
|
+
* This is a pure function for testability.
|
|
104
|
+
*
|
|
105
|
+
* Hierarchy:
|
|
106
|
+
* scene (GPS world frame — NUE: X=North, Y=Up, Z=East)
|
|
107
|
+
* ├── ambientLight
|
|
108
|
+
* ├── directionalLight
|
|
109
|
+
* └── arWorldGroup (local space = NUE; receives alignment matrix)
|
|
110
|
+
* └── basisChangeNode ('webxr-to-nue', constant WEBXR_TO_NUE matrix)
|
|
111
|
+
* └── arpose (Object3D — AR pose; local space = WebXR)
|
|
112
|
+
* └── camera (PerspectiveCamera)
|
|
113
|
+
*
|
|
114
|
+
* basisChangeNode is a static scene-graph node that holds the WEBXR_TO_NUE
|
|
115
|
+
* basis-change matrix permanently (matrixAutoUpdate=false). Moving it here
|
|
116
|
+
* instead of composing it in applyAlignmentMatrix() keeps arWorldGroup's
|
|
117
|
+
* local space as NUE: objects added directly to arWorldGroup can be placed
|
|
118
|
+
* at [1,0,0]=North, [0,0,1]=East without any WebXR↔NUE conversion.
|
|
119
|
+
*
|
|
120
|
+
* - Recording: arpose stays at identity; WebXRManager writes to camera.
|
|
121
|
+
* - Replay: arpose receives recorded odomPosition/odomRotation;
|
|
122
|
+
* camera is owned by user controls (OrbitControls / FPS).
|
|
123
|
+
*
|
|
124
|
+
* @returns Object containing scene, arWorldGroup, arpose, and camera
|
|
125
|
+
*/
|
|
126
|
+
declare function createSceneHierarchy(): {
|
|
127
|
+
scene: THREE.Scene;
|
|
128
|
+
arWorldGroup: THREE.Group;
|
|
129
|
+
arpose: THREE.Object3D;
|
|
130
|
+
camera: THREE.PerspectiveCamera;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Initialize the AR session and Three.js renderer.
|
|
134
|
+
* @param container - DOM element to host the AR canvas and CSS3D overlay.
|
|
135
|
+
*/
|
|
136
|
+
declare function initAR(container: HTMLElement, isolationOptions?: Partial<ArCrashIsolationOptions>): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Get the current Three.js scene (for adding objects like map)
|
|
139
|
+
*/
|
|
140
|
+
declare function getScene(): THREE.Scene | null;
|
|
141
|
+
/**
|
|
142
|
+
* Get the AR world group (for adding AR-tracked content)
|
|
143
|
+
* Content added here will be transformed by the alignment matrix.
|
|
144
|
+
*/
|
|
145
|
+
declare function getArWorldGroup(): THREE.Group | null;
|
|
146
|
+
/**
|
|
147
|
+
* Get the current camera
|
|
148
|
+
*/
|
|
149
|
+
declare function getCamera(): THREE.PerspectiveCamera | null;
|
|
150
|
+
/**
|
|
151
|
+
* Set the scene externally (for replay mode).
|
|
152
|
+
* Allows non-WebXR code paths to register a scene so that modules
|
|
153
|
+
* calling getScene() receive it.
|
|
154
|
+
* @see docs/2026-02-19-replay-mode.md Risk R1
|
|
155
|
+
*/
|
|
156
|
+
declare function setScene(s: THREE.Scene | null): void;
|
|
157
|
+
/**
|
|
158
|
+
* Set the AR world group externally (for replay mode).
|
|
159
|
+
* Allows non-WebXR code paths to register an arWorldGroup so that
|
|
160
|
+
* applyAlignmentMatrix() and visualizers work correctly.
|
|
161
|
+
* @see docs/2026-02-19-replay-mode.md Risk R1
|
|
162
|
+
*/
|
|
163
|
+
declare function setArWorldGroup(g: THREE.Group | null): void;
|
|
164
|
+
/**
|
|
165
|
+
* Set the camera externally (for replay mode).
|
|
166
|
+
* Allows non-WebXR code paths to register a camera so that modules
|
|
167
|
+
* calling getCamera() receive it.
|
|
168
|
+
* @see docs/2026-02-19-replay-mode.md Risk R1
|
|
169
|
+
*/
|
|
170
|
+
declare function setCamera(c: THREE.PerspectiveCamera | null): void;
|
|
171
|
+
/**
|
|
172
|
+
* Get the arpose Object3D (intermediate node between arWorldGroup and camera).
|
|
173
|
+
* Returns null before scene initialization.
|
|
174
|
+
*/
|
|
175
|
+
declare function getArPose(): THREE.Object3D | null;
|
|
176
|
+
/**
|
|
177
|
+
* Set the arpose Object3D externally (for replay mode).
|
|
178
|
+
* Allows non-WebXR code paths to register an arpose so that
|
|
179
|
+
* store subscribers can update it with recorded odom data.
|
|
180
|
+
*/
|
|
181
|
+
declare function setArPose(a: THREE.Object3D | null): void;
|
|
182
|
+
/**
|
|
183
|
+
* Apply an alignment matrix to the AR world group.
|
|
184
|
+
*
|
|
185
|
+
* The alignment matrix maps odometry positions in NUE space
|
|
186
|
+
* to GPS world space (also NUE). It is applied directly to arWorldGroup
|
|
187
|
+
* whose local space is NUE.
|
|
188
|
+
*
|
|
189
|
+
* The WebXR→NUE basis change lives permanently in basisChangeNode (a
|
|
190
|
+
* child of arWorldGroup), so the full camera world transform is:
|
|
191
|
+
*
|
|
192
|
+
* camera_world = arWorldGroup × basisChangeNode × arpose × camera_local
|
|
193
|
+
* = alignment × WEBXR_TO_NUE × arpose × camera_local
|
|
194
|
+
*
|
|
195
|
+
* This is mathematically identical to the previous composition
|
|
196
|
+
* (alignment × WEBXR_TO_NUE applied directly to arWorldGroup.matrix),
|
|
197
|
+
* but arWorldGroup's local space is now NUE: objects placed as children
|
|
198
|
+
* of arWorldGroup use NUE coordinates directly ([1,0,0]=North, [0,0,1]=East).
|
|
199
|
+
*
|
|
200
|
+
* Replay note: arpose still lives in WebXR space (below basisChangeNode),
|
|
201
|
+
* so nuePositionToWebXR() is still required when setting arpose.position.
|
|
202
|
+
*
|
|
203
|
+
* @param matrix - 16-element column-major matrix (gl-matrix mat4 format)
|
|
204
|
+
*/
|
|
205
|
+
declare function applyAlignmentMatrix(matrix: readonly number[]): void;
|
|
206
|
+
/**
|
|
207
|
+
* Convert a position from internal NUE convention (X=North, Y=Up, Z=East)
|
|
208
|
+
* to WebXR local-floor convention (X=East, Y=Up, Z=South).
|
|
209
|
+
*
|
|
210
|
+
* Delegates to the canonical library implementation (nueToWebXR).
|
|
211
|
+
* Accepts `readonly number[]` for call-site convenience.
|
|
212
|
+
*
|
|
213
|
+
* NUE [n, u, e] → WebXR [e, u, -n]
|
|
214
|
+
*/
|
|
215
|
+
declare function nuePositionToWebXR(nue: readonly number[]): readonly [number, number, number];
|
|
216
|
+
/**
|
|
217
|
+
* Convert a quaternion from internal NUE convention to WebXR local-floor convention.
|
|
218
|
+
*
|
|
219
|
+
* Delegates to the canonical library implementation (nueQuaternionToWebXR).
|
|
220
|
+
* Accepts `readonly number[]` for call-site convenience.
|
|
221
|
+
*
|
|
222
|
+
* NUE [x, y, z, w] → WebXR [z, y, -x, w]
|
|
223
|
+
*/
|
|
224
|
+
declare function nueQuaternionToWebXR$1(nue: readonly number[]): readonly [number, number, number, number];
|
|
225
|
+
/**
|
|
226
|
+
* End the current XR session and clean up all resources.
|
|
227
|
+
*
|
|
228
|
+
* Stops the animation loop, disposes the WebGL renderer, removes the
|
|
229
|
+
* canvas from the DOM, and tears down the CSS3D overlay. This is the
|
|
230
|
+
* production cleanup path — call it when the AR experience is finished.
|
|
231
|
+
*/
|
|
232
|
+
declare function endARSession(): Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Set up image capture callbacks.
|
|
235
|
+
* Call this before starting image capture to wire up the callback handlers.
|
|
236
|
+
*
|
|
237
|
+
* @param onCaptured - Called when an image is successfully captured
|
|
238
|
+
* @param screenRotationGetter - Returns current device screen rotation (0, 90, 180, 270)
|
|
239
|
+
* @param onFailed - Optional callback for when image capture fails (e.g., low memory)
|
|
240
|
+
* @param onSuspicious - Optional callback for when a captured image appears black/empty
|
|
241
|
+
*/
|
|
242
|
+
declare function setImageCaptureCallback(onCaptured: (image: CapturedImage) => void, screenRotationGetter: () => number, onFailed?: () => void, onSuspicious?: (blobSize: number, frameIndex: number) => void): void;
|
|
243
|
+
/**
|
|
244
|
+
* Start capturing images during recording.
|
|
245
|
+
* Must call setImageCaptureCallback first.
|
|
246
|
+
* @param config - Optional capture configuration (intervalMs, quality)
|
|
247
|
+
* @param resolutionDivisor - Resolution divisor: 1 = full, 2 = half, 4 = quarter (default: 1)
|
|
248
|
+
*/
|
|
249
|
+
declare function startImageCapture(config?: Partial<ImageCaptureConfig>, resolutionDivisor?: number): void;
|
|
250
|
+
/**
|
|
251
|
+
* Stop capturing images.
|
|
252
|
+
*/
|
|
253
|
+
declare function stopImageCapture(): void;
|
|
254
|
+
/**
|
|
255
|
+
* Get the current image capture frame count.
|
|
256
|
+
*/
|
|
257
|
+
declare function getImageCaptureFrameCount(): number;
|
|
258
|
+
/**
|
|
259
|
+
* Set up tracking state callbacks.
|
|
260
|
+
* Call this BEFORE initAR() to enable tracking restart detection.
|
|
261
|
+
*
|
|
262
|
+
* @param onRestarted - Called when tracking restarts after being lost
|
|
263
|
+
*/
|
|
264
|
+
declare function setTrackingCallbacks(onRestarted: (payload: OdometryTrackingRestartedPayload) => void): void;
|
|
265
|
+
/**
|
|
266
|
+
* Set a callback for when AR tracking is lost.
|
|
267
|
+
* Call this BEFORE initAR() to enable tracking loss notifications.
|
|
268
|
+
* Field Test Readiness Issue #3: Provide user feedback when tracking is lost.
|
|
269
|
+
*
|
|
270
|
+
* @param callback - Called when tracking is lost (pose becomes null)
|
|
271
|
+
*/
|
|
272
|
+
declare function setTrackingLostCallback(callback: () => void): void;
|
|
273
|
+
/**
|
|
274
|
+
* Set a callback for when AR tracking recovers seamlessly (Case 1: same coordinate frame).
|
|
275
|
+
* Call this BEFORE initAR() to enable seamless recovery notifications.
|
|
276
|
+
*
|
|
277
|
+
* @param callback - Called when tracking recovers without origin reset
|
|
278
|
+
*/
|
|
279
|
+
declare function setTrackingRecoveredCallback(callback: () => void): void;
|
|
280
|
+
/**
|
|
281
|
+
* Set up depth capture callback.
|
|
282
|
+
* Call this BEFORE initAR() to enable depth sampling.
|
|
283
|
+
*
|
|
284
|
+
* @param onCaptured - Called when a depth sample is captured
|
|
285
|
+
* @param onUnavailable - Called once if depth is unavailable after threshold
|
|
286
|
+
*/
|
|
287
|
+
declare function setDepthCaptureCallback(onCaptured: (sample: DepthSample) => void, onUnavailable?: () => void): void;
|
|
288
|
+
/**
|
|
289
|
+
* Start depth sampling during recording.
|
|
290
|
+
* Must call setDepthCaptureCallback before initAR.
|
|
291
|
+
*/
|
|
292
|
+
declare function startDepthCapture(): void;
|
|
293
|
+
/**
|
|
294
|
+
* Stop depth sampling.
|
|
295
|
+
*/
|
|
296
|
+
declare function stopDepthCapture(): void;
|
|
297
|
+
/**
|
|
298
|
+
* Get the current depth sample count.
|
|
299
|
+
*/
|
|
300
|
+
declare function getDepthSampleCount(): number;
|
|
301
|
+
/**
|
|
302
|
+
* Set a per-frame callback for custom updates.
|
|
303
|
+
* The callback is invoked every XR frame after pose updates but before render.
|
|
304
|
+
* Useful for updating elements that need to follow the camera smoothly
|
|
305
|
+
* (e.g., map overlay position).
|
|
306
|
+
*
|
|
307
|
+
* @param callback - Function to call each frame, or null to clear
|
|
308
|
+
*/
|
|
309
|
+
declare function setFrameCallback(callback: (() => void) | null): void;
|
|
310
|
+
/**
|
|
311
|
+
* Get the CSS3D renderer manager for live AR mode.
|
|
312
|
+
* Returns null if no AR session is active or CSS3D was not created.
|
|
313
|
+
*/
|
|
314
|
+
declare function getLiveCss3dManager(): Css3dRendererManager | null;
|
|
315
|
+
//#endregion
|
|
316
|
+
export { setTrackingLostCallback as A, setArWorldGroup as C, setImageCaptureCallback as D, setFrameCallback as E, stopDepthCapture as F, stopImageCapture as I, shouldLogCameraAccessDiagnostic as M, startDepthCapture as N, setScene as O, startImageCapture as P, setArPose as S, setDepthCaptureCallback as T, isWebXRSupported as _, extractPoseFromViewer as a, nueQuaternionToWebXR$1 as b, getArWorldGroup as c, getDepthSampleCount as d, getImageCaptureFrameCount as f, initAR as g, getXrCameraFromPose as h, endARSession as i, setTrackingRecoveredCallback as j, setTrackingCallbacks as k, getCamera as l, getScene as m, buildSessionOptions as n, extractResetTransformData as o, getLiveCss3dManager as p, createSceneHierarchy as r, getArPose as s, applyAlignmentMatrix as t, getCurrentArPose as u, isXRCameraLike as v, setCamera as w, resetWebXRState as x, nuePositionToWebXR as y };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
//#region ../src/ar/xr-camera-texture.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Result from acquireCameraTexture containing the Three.js texture
|
|
6
|
+
* (ExternalTexture returned by Three.js) plus the native camera dimensions.
|
|
7
|
+
*/
|
|
8
|
+
interface CameraTextureResult {
|
|
9
|
+
/** Three.js ExternalTexture from renderer.xr.getCameraTexture() */
|
|
10
|
+
texture: THREE.Texture;
|
|
11
|
+
/** Native camera frame width in pixels */
|
|
12
|
+
width: number;
|
|
13
|
+
/** Native camera frame height in pixels */
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Minimal interface for XRCamera — only the properties we use.
|
|
18
|
+
*/
|
|
19
|
+
interface XRCameraLike {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Minimal interface for the parts of THREE.WebGLRenderer we need.
|
|
25
|
+
* Avoids importing the full renderer type in tests.
|
|
26
|
+
*/
|
|
27
|
+
interface RendererLike {
|
|
28
|
+
xr: {
|
|
29
|
+
getCameraTexture(xrCamera: unknown): THREE.Texture | undefined;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Acquire the camera texture for the current XR frame using Three.js's
|
|
34
|
+
* built-in getCameraTexture() API, paired with native camera dimensions.
|
|
35
|
+
*
|
|
36
|
+
* Three.js internally:
|
|
37
|
+
* 1. Creates XRWebGLBinding (lazy, one per session)
|
|
38
|
+
* 2. Calls glBinding.getCameraImage(camera) each frame
|
|
39
|
+
* 3. Wraps in ExternalTexture (sourceTexture = native WebGLTexture)
|
|
40
|
+
* 4. Caches per xrCamera in cameraAccessTextures map
|
|
41
|
+
*
|
|
42
|
+
* This function adds the native camera dimensions (width/height) needed
|
|
43
|
+
* for dynamic render target sizing in the blit capture pipeline.
|
|
44
|
+
*
|
|
45
|
+
* Must be called within the XR animation frame callback.
|
|
46
|
+
*
|
|
47
|
+
* @param renderer - The Three.js WebGLRenderer
|
|
48
|
+
* @param xrCamera - The XRCamera from XRView.camera, or null if unavailable
|
|
49
|
+
* @returns CameraTextureResult, or null if acquisition fails
|
|
50
|
+
*/
|
|
51
|
+
declare function acquireCameraTexture(renderer: RendererLike, xrCamera: XRCameraLike | null): CameraTextureResult | null;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { acquireCameraTexture as i, RendererLike as n, XRCameraLike as r, CameraTextureResult as t };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region ../src/ar/xr-error-handler.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* WebXR Error Handler
|
|
4
|
+
*
|
|
5
|
+
* Provides user-facing error messages for WebXR session failures.
|
|
6
|
+
* Separates error handling logic from AR module for testability.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Known WebXR error types and their user-friendly messages.
|
|
10
|
+
*/
|
|
11
|
+
declare const XR_ERROR_MESSAGES: Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Default message for unknown error types.
|
|
14
|
+
*/
|
|
15
|
+
declare const XR_ERROR_MESSAGE_UNKNOWN = "Failed to start AR session. Check device compatibility and permissions.";
|
|
16
|
+
/**
|
|
17
|
+
* Get a user-friendly error message from a WebXR session error.
|
|
18
|
+
*
|
|
19
|
+
* @param error - The error thrown by navigator.xr.requestSession
|
|
20
|
+
* @returns A user-friendly error message
|
|
21
|
+
*/
|
|
22
|
+
declare function getXrErrorMessage(error: unknown): string;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { XR_ERROR_MESSAGE_UNKNOWN as n, getXrErrorMessage as r, XR_ERROR_MESSAGES as t };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//#region ../src/storage/zip-export.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* ZIP Export Module
|
|
4
|
+
*
|
|
5
|
+
* Exports OPFS session data as ZIP files for download.
|
|
6
|
+
* Uses @zip.js/zip.js library for streaming ZIP creation and reading.
|
|
7
|
+
*
|
|
8
|
+
* The ZIP uses "store" mode (no compression) because:
|
|
9
|
+
* 1. Images are already compressed (JPEG)
|
|
10
|
+
* 2. Faster packaging
|
|
11
|
+
* 3. Simpler implementation
|
|
12
|
+
*
|
|
13
|
+
* @zip.js/zip.js was chosen over fflate because:
|
|
14
|
+
* - Supports streaming reads and writes (needed for periodic sync to external file)
|
|
15
|
+
* - Can append to existing ZIP files via prependZip
|
|
16
|
+
* - Actively maintained with good TypeScript support
|
|
17
|
+
* - Built-in Web Worker support for non-blocking compression
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Result of a ZIP export operation.
|
|
21
|
+
* Provides the blob and metadata for share + summary display.
|
|
22
|
+
*
|
|
23
|
+
* @see 2026-02-06 User Feedback Issue #2 (Share) and Issue #3 (ZIP Stats)
|
|
24
|
+
*/
|
|
25
|
+
interface ZipExportResult {
|
|
26
|
+
/** The ZIP blob ready for download or sharing */
|
|
27
|
+
readonly blob: Blob;
|
|
28
|
+
/** Number of files packaged in the ZIP */
|
|
29
|
+
readonly fileCount: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Export a session from OPFS as a ZIP blob.
|
|
33
|
+
*
|
|
34
|
+
* The ZIP structure mirrors the OPFS session structure:
|
|
35
|
+
* - session.json (at root)
|
|
36
|
+
* - actions/000001.json, actions/000002.json, ...
|
|
37
|
+
* - frames/frame-000001.jpg, frames/frame-000002.jpg, ...
|
|
38
|
+
* - refPoints/{h3}.json (only observations from this session)
|
|
39
|
+
*
|
|
40
|
+
* Uses "store" mode (compression level 0) for fast packaging.
|
|
41
|
+
*
|
|
42
|
+
* @param scenarioName - Name of the scenario
|
|
43
|
+
* @param sessionName - Name of the session folder
|
|
44
|
+
* @returns ZIP export result with blob and file count
|
|
45
|
+
* @throws Error if scenario or session not found
|
|
46
|
+
*/
|
|
47
|
+
declare function exportSessionAsZip(scenarioName: string, sessionName: string): Promise<ZipExportResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Sync current OPFS session data to an external file handle.
|
|
50
|
+
*
|
|
51
|
+
* This is used for periodic sync during recording to save data to the user's
|
|
52
|
+
* chosen location (obtained via showSaveFilePicker). The function:
|
|
53
|
+
* 1. Reads all current session data from OPFS
|
|
54
|
+
* 2. Creates a ZIP in memory
|
|
55
|
+
* 3. Writes the ZIP to the external file handle
|
|
56
|
+
*
|
|
57
|
+
* This provides crash safety combined with OPFS - even if the app crashes,
|
|
58
|
+
* the last synced ZIP contains all data up to that point.
|
|
59
|
+
*
|
|
60
|
+
* @param fileHandle - File handle from showSaveFilePicker
|
|
61
|
+
* @param scenarioName - Name of the scenario
|
|
62
|
+
* @param sessionName - Name of the session folder
|
|
63
|
+
* @returns ZIP export result with blob and file count
|
|
64
|
+
* @throws Error if scenario or session not found
|
|
65
|
+
*/
|
|
66
|
+
declare function syncToExternalZip(fileHandle: FileSystemFileHandle, scenarioName: string, sessionName: string): Promise<ZipExportResult>;
|
|
67
|
+
/**
|
|
68
|
+
* Trigger a file download in the browser.
|
|
69
|
+
*
|
|
70
|
+
* Uses showSaveFilePicker if available (for better UX on desktop),
|
|
71
|
+
* falls back to <a download> for broader compatibility.
|
|
72
|
+
*
|
|
73
|
+
* @param blob - The blob to download
|
|
74
|
+
* @param filename - Suggested filename
|
|
75
|
+
*/
|
|
76
|
+
declare function downloadZip(blob: Blob, filename: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Export and download a session in one step.
|
|
79
|
+
*
|
|
80
|
+
* Convenience function combining exportSessionAsZip and downloadZip.
|
|
81
|
+
*
|
|
82
|
+
* @param scenarioName - Name of the scenario
|
|
83
|
+
* @param sessionName - Name of the session folder
|
|
84
|
+
*/
|
|
85
|
+
declare function exportAndDownloadSession(scenarioName: string, sessionName: string): Promise<void>;
|
|
86
|
+
//#endregion
|
|
87
|
+
export { syncToExternalZip as a, exportSessionAsZip as i, downloadZip as n, exportAndDownloadSession as r, ZipExportResult as t };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Entry, Entry as Entry$1 } from "@zip.js/zip.js";
|
|
2
|
+
|
|
3
|
+
//#region ../src/storage/zip-reader.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Maximum allowed uncompressed size (in bytes) for a single action or
|
|
6
|
+
* metadata JSON file inside a recording zip. Entries exceeding this limit
|
|
7
|
+
* are rejected before decompression to prevent out-of-memory conditions
|
|
8
|
+
* from malicious or corrupted zip files.
|
|
9
|
+
*
|
|
10
|
+
* 1 MB — generous for Redux action JSON; typical actions are a few KB.
|
|
11
|
+
*/
|
|
12
|
+
declare const MAX_ACTION_FILE_SIZE = 1048576;
|
|
13
|
+
/** Shape of a single recorded Redux action (type + optional payload). */
|
|
14
|
+
type RecordedAction = {
|
|
15
|
+
type: string;
|
|
16
|
+
payload?: unknown;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* A parsed action entry from a recording zip file.
|
|
20
|
+
*/
|
|
21
|
+
interface ZipActionEntry {
|
|
22
|
+
/** 1-based index extracted from the filename (e.g., 1 from "000001.json") */
|
|
23
|
+
index: number;
|
|
24
|
+
/** Original filename within the zip (e.g., "actions/000001.json") */
|
|
25
|
+
filename: string;
|
|
26
|
+
/** Parsed Redux action with type and optional payload */
|
|
27
|
+
action: RecordedAction;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read all entries from a zip file.
|
|
31
|
+
*
|
|
32
|
+
* @param data - The zip file content as a Uint8Array
|
|
33
|
+
* @returns Array of zip entries (directories and files)
|
|
34
|
+
*/
|
|
35
|
+
declare function readZipEntries(data: Uint8Array): Promise<Entry[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Load all recorded Redux actions from a zip file.
|
|
38
|
+
*
|
|
39
|
+
* Filters for JSON files in the actions/ directory, parses them, and returns
|
|
40
|
+
* them sorted by their filename index (chronological order for replay).
|
|
41
|
+
*
|
|
42
|
+
* @param data - The zip file content as a Uint8Array
|
|
43
|
+
* @param maxFileSize - Maximum allowed uncompressed size per entry (defaults to MAX_ACTION_FILE_SIZE)
|
|
44
|
+
* @returns Array of action entries sorted by index
|
|
45
|
+
*/
|
|
46
|
+
declare function loadActionsFromZip(data: Uint8Array, maxFileSize?: number): Promise<ZipActionEntry[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Load session metadata from session.json in the zip file.
|
|
49
|
+
*
|
|
50
|
+
* Returns null if session.json is absent (graceful degradation for
|
|
51
|
+
* recordings created before the metadata writing bug was fixed).
|
|
52
|
+
*
|
|
53
|
+
* @param data - The zip file content as a Uint8Array
|
|
54
|
+
* @param maxFileSize - Maximum allowed uncompressed size per entry (defaults to MAX_ACTION_FILE_SIZE)
|
|
55
|
+
* @returns Parsed session metadata, or null if not found
|
|
56
|
+
*/
|
|
57
|
+
declare function loadSessionMetadata(data: Uint8Array, maxFileSize?: number): Promise<Record<string, unknown> | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Load session metadata from session.json in a zip file provided as a Blob.
|
|
60
|
+
*
|
|
61
|
+
* Unlike `loadSessionMetadata(Uint8Array)`, this variant uses zip.js's
|
|
62
|
+
* BlobReader which reads only the central directory and the target entry
|
|
63
|
+
* from the Blob — not the entire file contents. This is critical for
|
|
64
|
+
* memory-efficient scanning of many large recording zips (e.g., during
|
|
65
|
+
* `discoverScenariosFromZipMetadata`).
|
|
66
|
+
*
|
|
67
|
+
* Since `File` extends `Blob`, this works directly with file handles:
|
|
68
|
+
* const file = await handle.getFile();
|
|
69
|
+
* const meta = await loadSessionMetadataFromBlob(file);
|
|
70
|
+
*
|
|
71
|
+
* @param blob - A Blob or File containing the zip data
|
|
72
|
+
* @param maxFileSize - Maximum allowed uncompressed size per entry (defaults to MAX_ACTION_FILE_SIZE)
|
|
73
|
+
* @returns Parsed session metadata, or null if session.json is not found
|
|
74
|
+
*/
|
|
75
|
+
declare function loadSessionMetadataFromBlob(blob: Blob, maxFileSize?: number): Promise<Record<string, unknown> | null>;
|
|
76
|
+
/** A lightweight GPS coordinate pair (Leaflet convention: lat/lng). */
|
|
77
|
+
interface GpsPathCoord {
|
|
78
|
+
readonly lat: number;
|
|
79
|
+
readonly lng: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Extract GPS coordinates from a recording zip provided as a Blob.
|
|
83
|
+
*
|
|
84
|
+
* Uses BlobReader for memory-efficient reading. Reads all action JSON files,
|
|
85
|
+
* identifies `gpsData/recordGpsEvent` actions, and returns only the lightweight
|
|
86
|
+
* `{ lat, lng }` pairs — all other action data is discarded immediately.
|
|
87
|
+
*
|
|
88
|
+
* Returns coordinates in chronological order (sorted by action filename).
|
|
89
|
+
* Returns an empty array if the zip is invalid or contains no GPS actions.
|
|
90
|
+
*
|
|
91
|
+
* @param blob - A Blob or File containing the zip data
|
|
92
|
+
* @param maxFileSize - Maximum allowed uncompressed size per action entry
|
|
93
|
+
* @returns Array of GPS coordinates in chronological order
|
|
94
|
+
*/
|
|
95
|
+
declare function loadGpsPathFromBlob(blob: Blob, maxFileSize?: number): Promise<GpsPathCoord[]>;
|
|
96
|
+
//#endregion
|
|
97
|
+
export { ZipActionEntry as a, loadSessionMetadata as c, RecordedAction as i, loadSessionMetadataFromBlob as l, GpsPathCoord as n, loadActionsFromZip as o, MAX_ACTION_FILE_SIZE as r, loadGpsPathFromBlob as s, Entry$1 as t, readZipEntries as u };
|
package/package.json
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gps-plus-slam-app-framework",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Reusable AR+GPS app framework layer — WebXR session management, Three.js visualization, GPS sensors, storage abstractions, replay engine, and store wiring for gps-plus-slam-js.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.js",
|
|
11
|
+
"./ar": "./dist/ar/index.js",
|
|
12
|
+
"./ar/*": "./dist/ar/*.js",
|
|
13
|
+
"./sensors": "./dist/sensors/index.js",
|
|
14
|
+
"./sensors/*": "./dist/sensors/*.js",
|
|
15
|
+
"./state": "./dist/state/index.js",
|
|
16
|
+
"./state/*": "./dist/state/*.js",
|
|
17
|
+
"./storage": "./dist/storage/index.js",
|
|
18
|
+
"./storage/*": "./dist/storage/*.js",
|
|
19
|
+
"./ref-points": "./dist/ref-points/index.js",
|
|
20
|
+
"./ref-points/*": "./dist/ref-points/*.js",
|
|
21
|
+
"./visualization": "./dist/visualization/index.js",
|
|
22
|
+
"./visualization/*": "./dist/visualization/*.js",
|
|
23
|
+
"./utils": "./dist/utils/index.js",
|
|
24
|
+
"./utils/*": "./dist/utils/*.js",
|
|
25
|
+
"./types": "./dist/types/index.js",
|
|
26
|
+
"./types/*": "./dist/types/*.js",
|
|
27
|
+
"./licensing": "./dist/licensing/index.js",
|
|
28
|
+
"./licensing/*": "./dist/licensing/*.js",
|
|
29
|
+
"./test-utils/*": "./dist/test-utils/*.js"
|
|
30
|
+
},
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=20.19.0"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@reduxjs/toolkit": "^2.11.2",
|
|
37
|
+
"gl-matrix": "3.4.4",
|
|
38
|
+
"gps-plus-slam-js": "^1.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@sentry/browser": ">=10.0.0",
|
|
42
|
+
"@zip.js/zip.js": ">=2.7.0",
|
|
43
|
+
"h3-js": ">=4.0.0",
|
|
44
|
+
"leaflet": ">=1.9.0",
|
|
45
|
+
"three": ">=0.170.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"leaflet": {
|
|
49
|
+
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"@sentry/browser": {
|
|
52
|
+
"optional": true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@eslint/js": "^10.0.1",
|
|
57
|
+
"@sentry/browser": "^10.49.0",
|
|
58
|
+
"@types/leaflet": "^1.9.21",
|
|
59
|
+
"@types/node": "^25.6.0",
|
|
60
|
+
"@types/three": "^0.184.0",
|
|
61
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
62
|
+
"@vitest/eslint-plugin": "^1.6.16",
|
|
63
|
+
"@zip.js/zip.js": "^2.8.26",
|
|
64
|
+
"dpdm": "^4.0.1",
|
|
65
|
+
"eslint": "^10.2.1",
|
|
66
|
+
"eslint-config-prettier": "^10.1.8",
|
|
67
|
+
"fast-check": "^4.7.0",
|
|
68
|
+
"globals": "^17.5.0",
|
|
69
|
+
"h3-js": "^4.4.0",
|
|
70
|
+
"jsdom": "^29.0.2",
|
|
71
|
+
"leaflet": "^1.9.4",
|
|
72
|
+
"prettier": "^3.8.3",
|
|
73
|
+
"three": "^0.184.0",
|
|
74
|
+
"tsdown": "^0.21.9",
|
|
75
|
+
"typescript": "^6.0.3",
|
|
76
|
+
"typescript-eslint": "^8.59.0",
|
|
77
|
+
"vitest": "^4.1.5"
|
|
78
|
+
},
|
|
79
|
+
"keywords": [
|
|
80
|
+
"ar",
|
|
81
|
+
"gps",
|
|
82
|
+
"slam",
|
|
83
|
+
"webxr",
|
|
84
|
+
"three.js",
|
|
85
|
+
"framework"
|
|
86
|
+
],
|
|
87
|
+
"author": "cs-util-com",
|
|
88
|
+
"license": "Apache-2.0",
|
|
89
|
+
"scripts": {
|
|
90
|
+
"test": "pnpm run test:core",
|
|
91
|
+
"test:core": "pnpm run format && pnpm run lint && pnpm run typecheck && pnpm run typecheck:tests && pnpm run test:unit",
|
|
92
|
+
"format": "prettier --log-level warn --write --ignore-unknown --no-error-on-unmatched-pattern \"src\" \"config\" package.json README.md",
|
|
93
|
+
"format:check": "prettier --check --ignore-unknown .",
|
|
94
|
+
"build": "tsdown --config config/tsdown.config.ts",
|
|
95
|
+
"verify:pack": "pnpm pack --dry-run",
|
|
96
|
+
"test:unit": "vitest run --coverage --config config/vitest.config.ts",
|
|
97
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
98
|
+
"typecheck:tests": "tsc -p tsconfig.vitest.json --noEmit",
|
|
99
|
+
"lint": "eslint . --config config/eslint.config.mjs",
|
|
100
|
+
"test:watch": "vitest --config config/vitest.config.ts",
|
|
101
|
+
"check:cycles": "dpdm -T --exit-code circular:1 --no-warning --no-tree ./src/index.ts",
|
|
102
|
+
"setup": "bash ./scripts/setup.sh"
|
|
103
|
+
}
|
|
104
|
+
}
|