@expofp/renderer 3.2.5 → 3.27.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 +111 -0
- package/dist/Renderer.d.ts +88 -0
- package/dist/Renderer.js +53 -0
- package/dist/controls/CameraControls.d.ts +102 -0
- package/dist/controls/CameraControls.js +239 -0
- package/dist/controls/camera-api.d.ts +206 -0
- package/dist/controls/camera-api.js +181 -0
- package/dist/controls/camera-move.d.ts +13 -0
- package/dist/controls/camera-move.js +18 -0
- package/dist/controls/camera-state.d.ts +40 -0
- package/dist/controls/camera-state.js +65 -0
- package/dist/controls/gestures.d.ts +70 -0
- package/dist/controls/gestures.js +84 -0
- package/dist/controls/handlers/Inertia.d.ts +111 -0
- package/dist/controls/handlers/Inertia.js +215 -0
- package/dist/controls/handlers/Pan.d.ts +23 -0
- package/dist/controls/handlers/Pan.js +32 -0
- package/dist/controls/handlers/Pitch.d.ts +94 -0
- package/dist/controls/handlers/Pitch.js +191 -0
- package/dist/controls/handlers/Roll.d.ts +103 -0
- package/dist/controls/handlers/Roll.js +182 -0
- package/dist/controls/handlers/Zoom.d.ts +15 -0
- package/dist/controls/handlers/Zoom.js +26 -0
- package/dist/controls/index.d.ts +56 -0
- package/dist/controls/index.js +58 -0
- package/dist/controls/zoom-to.d.ts +89 -0
- package/dist/controls/zoom-to.js +91 -0
- package/dist/core/InstanceUniforms.d.ts +93 -0
- package/dist/core/InstanceUniforms.js +266 -0
- package/dist/core/SquareDataTexture.d.ts +277 -0
- package/dist/core/SquareDataTexture.js +476 -0
- package/dist/core/batch/BatchedMesh.d.ts +74 -0
- package/dist/core/batch/BatchedMesh.js +149 -0
- package/dist/core/instanced/FrustumCulling.d.ts +141 -0
- package/dist/core/instanced/FrustumCulling.js +246 -0
- package/dist/core/instanced/InstancedMesh.d.ts +302 -0
- package/dist/core/instanced/InstancedMesh.js +497 -0
- package/dist/core/instanced/Instances.d.ts +119 -0
- package/dist/core/instanced/Instances.js +230 -0
- package/dist/core/instanced/Raycasting.d.ts +118 -0
- package/dist/core/instanced/Raycasting.js +134 -0
- package/dist/core/instanced/instanced-material.d.ts +77 -0
- package/dist/core/instanced/instanced-material.js +224 -0
- package/dist/core/lines/BatchedLines.d.ts +135 -0
- package/dist/core/lines/BatchedLines.js +213 -0
- package/dist/core/lines/FrustumCulling.d.ts +43 -0
- package/dist/core/lines/FrustumCulling.js +85 -0
- package/dist/core/lines/Raycasting.d.ts +44 -0
- package/dist/core/lines/Raycasting.js +91 -0
- package/dist/core/lines/lines-material.d.ts +47 -0
- package/dist/core/lines/lines-material.js +115 -0
- package/dist/core/shader-source.d.ts +50 -0
- package/dist/core/shader-source.js +84 -0
- package/dist/core/text/BatchedText.d.ts +227 -0
- package/dist/core/text/BatchedText.js +467 -0
- package/dist/core/text/MemberTexture.d.ts +90 -0
- package/dist/core/text/MemberTexture.js +194 -0
- package/dist/core/text/Text.d.ts +73 -0
- package/dist/core/text/Text.js +215 -0
- package/dist/core/text/batched-text-material.d.ts +56 -0
- package/dist/core/text/batched-text-material.js +121 -0
- package/dist/core/text/glyph-packing.d.ts +17 -0
- package/dist/core/text/glyph-packing.js +61 -0
- package/dist/core/typed-array.d.ts +16 -0
- package/dist/core/typed-array.js +20 -0
- package/dist/debug/components/DebugPanelProvider.d.ts +20 -0
- package/dist/debug/components/DebugPanelProvider.js +38 -0
- package/dist/debug/components/DebugTools.d.ts +22 -0
- package/dist/debug/components/DebugTools.js +28 -0
- package/dist/debug/components/Gui.d.ts +20 -0
- package/dist/debug/components/Gui.js +32 -0
- package/dist/debug/components/MemoryInfo.d.ts +22 -0
- package/dist/debug/components/MemoryInfo.js +42 -0
- package/dist/debug/components/Panel.d.ts +31 -0
- package/dist/debug/components/Panel.js +98 -0
- package/dist/debug/components/Stats.d.ts +9 -0
- package/dist/debug/components/Stats.js +24 -0
- package/dist/debug/debug-context.d.ts +41 -0
- package/dist/debug/debug-context.js +59 -0
- package/dist/debug/index.d.ts +51 -0
- package/dist/debug/index.js +64 -0
- package/dist/events/LayoutDriver.d.ts +31 -0
- package/dist/events/LayoutDriver.js +88 -0
- package/dist/events/PointerMissed.d.ts +23 -0
- package/dist/events/PointerMissed.js +58 -0
- package/dist/events/def-culling.d.ts +46 -0
- package/dist/events/def-culling.js +69 -0
- package/dist/events/layout-targets.d.ts +104 -0
- package/dist/events/layout-targets.js +245 -0
- package/dist/events/pointer.d.ts +118 -0
- package/dist/events/pointer.js +168 -0
- package/dist/external/ExternalCanvas.d.ts +56 -0
- package/dist/external/ExternalCanvas.js +178 -0
- package/dist/external/external-camera.d.ts +17 -0
- package/dist/external/external-camera.js +82 -0
- package/dist/external/external-events.d.ts +14 -0
- package/dist/external/external-events.js +33 -0
- package/dist/index.d.ts +11 -783
- package/dist/index.js +12 -8031
- package/dist/objects/Background.d.ts +31 -0
- package/dist/objects/Background.js +37 -0
- package/dist/objects/Lighting.d.ts +20 -0
- package/dist/objects/Lighting.js +85 -0
- package/dist/objects/containers/SlotContainer.d.ts +266 -0
- package/dist/objects/containers/SlotContainer.js +251 -0
- package/dist/objects/containers/hooks.d.ts +46 -0
- package/dist/objects/containers/hooks.js +118 -0
- package/dist/objects/containers/index.d.ts +6 -0
- package/dist/objects/containers/index.js +4 -0
- package/dist/objects/containers/keys.d.ts +10 -0
- package/dist/objects/containers/keys.js +18 -0
- package/dist/objects/containers/mesh-writes.d.ts +106 -0
- package/dist/objects/containers/mesh-writes.js +97 -0
- package/dist/objects/containers/props.d.ts +23 -0
- package/dist/objects/containers/props.js +1 -0
- package/dist/objects/images/ImageInstance.d.ts +29 -0
- package/dist/objects/images/ImageInstance.js +83 -0
- package/dist/objects/images/Images.d.ts +37 -0
- package/dist/objects/images/Images.js +204 -0
- package/dist/objects/images/atlas-packer.d.ts +128 -0
- package/dist/objects/images/atlas-packer.js +315 -0
- package/dist/objects/images/image-container.d.ts +51 -0
- package/dist/objects/images/image-container.js +70 -0
- package/dist/objects/images/index.d.ts +2 -0
- package/dist/objects/images/index.js +1 -0
- package/dist/objects/images/texture-budget.d.ts +120 -0
- package/dist/objects/images/texture-budget.js +215 -0
- package/dist/objects/layer/Layer.d.ts +27 -0
- package/dist/objects/layer/Layer.js +114 -0
- package/dist/objects/layer/index.d.ts +2 -0
- package/dist/objects/layer/index.js +1 -0
- package/dist/objects/layer/mount-scheduler.d.ts +102 -0
- package/dist/objects/layer/mount-scheduler.js +145 -0
- package/dist/objects/layer/visibility-gui.d.ts +19 -0
- package/dist/objects/layer/visibility-gui.js +93 -0
- package/dist/objects/lines/LineInstance.d.ts +21 -0
- package/dist/objects/lines/LineInstance.js +73 -0
- package/dist/objects/lines/Lines.d.ts +17 -0
- package/dist/objects/lines/Lines.js +29 -0
- package/dist/objects/lines/index.d.ts +2 -0
- package/dist/objects/lines/index.js +1 -0
- package/dist/objects/lines/line-container.d.ts +35 -0
- package/dist/objects/lines/line-container.js +40 -0
- package/dist/objects/materials/ColorMaterial.d.ts +85 -0
- package/dist/objects/materials/ColorMaterial.js +89 -0
- package/dist/objects/materials/LineMaterial.d.ts +44 -0
- package/dist/objects/materials/LineMaterial.js +72 -0
- package/dist/objects/materials/ModelMaterial.d.ts +41 -0
- package/dist/objects/materials/ModelMaterial.js +84 -0
- package/dist/objects/materials/TextureMaterial.d.ts +30 -0
- package/dist/objects/materials/TextureMaterial.js +29 -0
- package/dist/objects/materials/dim.d.ts +123 -0
- package/dist/objects/materials/dim.js +213 -0
- package/dist/objects/materials/shared.d.ts +6 -0
- package/dist/objects/materials/shared.js +51 -0
- package/dist/objects/models/ModelInstance.d.ts +22 -0
- package/dist/objects/models/ModelInstance.js +33 -0
- package/dist/objects/models/Models.d.ts +22 -0
- package/dist/objects/models/Models.js +177 -0
- package/dist/objects/models/gltf-cache.d.ts +17 -0
- package/dist/objects/models/gltf-cache.js +50 -0
- package/dist/objects/models/index.d.ts +2 -0
- package/dist/objects/models/index.js +1 -0
- package/dist/objects/models/model-asset.d.ts +48 -0
- package/dist/objects/models/model-asset.js +77 -0
- package/dist/objects/models/model-container.d.ts +139 -0
- package/dist/objects/models/model-container.js +227 -0
- package/dist/objects/shapes/ShapeInstance.d.ts +26 -0
- package/dist/objects/shapes/ShapeInstance.js +40 -0
- package/dist/objects/shapes/Shapes.d.ts +21 -0
- package/dist/objects/shapes/Shapes.js +120 -0
- package/dist/objects/shapes/index.d.ts +2 -0
- package/dist/objects/shapes/index.js +1 -0
- package/dist/objects/shapes/shape-container.d.ts +165 -0
- package/dist/objects/shapes/shape-container.js +272 -0
- package/dist/objects/shapes/shape-geometry.d.ts +27 -0
- package/dist/objects/shapes/shape-geometry.js +94 -0
- package/dist/objects/text/TextInstance.d.ts +22 -0
- package/dist/objects/text/TextInstance.js +95 -0
- package/dist/objects/text/Texts.d.ts +30 -0
- package/dist/objects/text/Texts.js +41 -0
- package/dist/objects/text/index.d.ts +2 -0
- package/dist/objects/text/index.js +1 -0
- package/dist/objects/text/text-container.d.ts +105 -0
- package/dist/objects/text/text-container.js +206 -0
- package/dist/objects/text/text-layout.d.ts +83 -0
- package/dist/objects/text/text-layout.js +154 -0
- package/dist/space/Camera.d.ts +103 -0
- package/dist/space/Camera.js +321 -0
- package/dist/space/Scene.d.ts +44 -0
- package/dist/space/Scene.js +112 -0
- package/dist/space/Space.d.ts +288 -0
- package/dist/space/Space.js +329 -0
- package/dist/space/VisibleRect.d.ts +72 -0
- package/dist/space/VisibleRect.js +129 -0
- package/dist/space/camera-handle.d.ts +67 -0
- package/dist/space/camera-handle.js +63 -0
- package/dist/space/camera-kind.d.ts +26 -0
- package/dist/space/camera-kind.js +30 -0
- package/dist/space/canvas-size.d.ts +24 -0
- package/dist/space/canvas-size.js +20 -0
- package/dist/space/clipping.d.ts +55 -0
- package/dist/space/clipping.js +108 -0
- package/dist/space/layout-measure.d.ts +65 -0
- package/dist/space/layout-measure.js +173 -0
- package/dist/space/viewport.d.ts +112 -0
- package/dist/space/viewport.js +67 -0
- package/dist/types/defs.d.ts +169 -0
- package/dist/types/defs.js +1 -0
- package/dist/types/events.d.ts +183 -0
- package/dist/types/events.js +1 -0
- package/dist/types/guards.d.ts +14 -0
- package/dist/types/guards.js +42 -0
- package/dist/update/index.d.ts +3 -0
- package/dist/update/index.js +2 -0
- package/dist/update/slot-writers.d.ts +30 -0
- package/dist/update/slot-writers.js +72 -0
- package/dist/update/store.d.ts +41 -0
- package/dist/update/store.js +98 -0
- package/dist/utils/arrays.d.ts +13 -0
- package/dist/utils/arrays.js +20 -0
- package/dist/utils/colors.d.ts +19 -0
- package/dist/utils/colors.js +27 -0
- package/dist/utils/logging.d.ts +26 -0
- package/dist/utils/logging.js +47 -0
- package/dist/utils/math.d.ts +24 -0
- package/dist/utils/math.js +27 -0
- package/package.json +67 -19
package/dist/index.d.ts
CHANGED
|
@@ -1,783 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Current zoom factor */
|
|
13
|
-
zoom: number;
|
|
14
|
-
/** Roll angle in degrees */
|
|
15
|
-
roll: number;
|
|
16
|
-
/** Pitch angle in degrees */
|
|
17
|
-
pitch: number;
|
|
18
|
-
/** Pixel to SVG scale factor */
|
|
19
|
-
ptScale: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export declare type ColorInput = string | number;
|
|
23
|
-
|
|
24
|
-
/** Options for the {@link ControlsAPI.configure} method. */
|
|
25
|
-
export declare interface ConfigureOptions {
|
|
26
|
-
/** Smooth time for zoom operations in seconds.*/
|
|
27
|
-
zoomTime: number;
|
|
28
|
-
/** Smooth time for pan operations in seconds. */
|
|
29
|
-
panTime: number;
|
|
30
|
-
/** Smooth time for roll operations in seconds. */
|
|
31
|
-
rollTime: number;
|
|
32
|
-
/** Smooth time for pitch operations in seconds. */
|
|
33
|
-
pitchTime: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** Controls system public API. */
|
|
37
|
-
export declare interface ControlsAPI {
|
|
38
|
-
/**
|
|
39
|
-
* Gesture handlers for camera controls.
|
|
40
|
-
* @inlineType Handlers
|
|
41
|
-
*/
|
|
42
|
-
handlers: Readonly<Handlers>;
|
|
43
|
-
/**
|
|
44
|
-
* Zooms the camera by the given factor.
|
|
45
|
-
* @param zoom Zoom factor to apply (e.g., 1.5 for 50% zoom in, 0.5 for 50% zoom out)
|
|
46
|
-
* @param immediate If true, applies the change immediately without animation
|
|
47
|
-
* @returns Promise that resolves when the zoom animation completes
|
|
48
|
-
*/
|
|
49
|
-
zoomBy: (zoom: number, immediate?: boolean) => Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Zooms the camera to fit the given rectangle.
|
|
52
|
-
* @param rect Rectangle to zoom to in SVG coordinates
|
|
53
|
-
* @param options Optional zoom configuration
|
|
54
|
-
* @param immediate If true, applies the change immediately without animation
|
|
55
|
-
* @returns Promise that resolves when the zoom animation completes
|
|
56
|
-
*/
|
|
57
|
-
zoomTo: (rect: Rect, options?: Partial<ZoomToOptions>, immediate?: boolean) => Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Pans the camera by the given offset in SVG space.
|
|
60
|
-
* @param x X offset in SVG space
|
|
61
|
-
* @param y Y offset in SVG space
|
|
62
|
-
* @param immediate If true, applies the change immediately without animation
|
|
63
|
-
* @returns Promise that resolves when the pan animation completes
|
|
64
|
-
*/
|
|
65
|
-
panBy: (x: number, y: number, immediate?: boolean) => Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Pans the camera to the given coordinates in SVG space.
|
|
68
|
-
* @param x X coordinate in SVG space
|
|
69
|
-
* @param y Y coordinate in SVG space
|
|
70
|
-
* @param immediate If true, applies the change immediately without animation
|
|
71
|
-
* @returns Promise that resolves when the pan animation completes
|
|
72
|
-
*/
|
|
73
|
-
panTo: (x: number, y: number, immediate?: boolean) => Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Rolls the camera by the given angle in degrees.
|
|
76
|
-
* Note: This method won't work if {@link ControlsAPI.handlers | handlers.roll} is disabled.
|
|
77
|
-
* @param angle Angle in degrees to roll by
|
|
78
|
-
* @param immediate If true, applies the change immediately without animation
|
|
79
|
-
* @returns Promise that resolves when the roll animation completes
|
|
80
|
-
*/
|
|
81
|
-
rollBy: (angle: number, immediate?: boolean) => Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* Rolls the camera to the given angle in degrees.
|
|
84
|
-
* Note: This method won't work if {@link ControlsAPI.handlers | handlers.roll} is disabled.
|
|
85
|
-
* @param angle Target angle in degrees
|
|
86
|
-
* @param immediate If true, applies the change immediately without animation
|
|
87
|
-
* @returns Promise that resolves when the roll animation completes
|
|
88
|
-
*/
|
|
89
|
-
rollTo: (angle: number, immediate?: boolean) => Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Pitches the camera by the given angle in degrees.
|
|
92
|
-
* Positive angles increase pitch, negative angles decrease pitch.
|
|
93
|
-
* Note: This method won't work if {@link ControlsAPI.handlers | handlers.pitch} is disabled.
|
|
94
|
-
* @param angle Angle in degrees to pitch by
|
|
95
|
-
* @param immediate If true, applies the change immediately without animation
|
|
96
|
-
* @returns Promise that resolves when the pitch animation completes
|
|
97
|
-
*/
|
|
98
|
-
pitchBy: (angle: number, immediate?: boolean) => Promise<void>;
|
|
99
|
-
/**
|
|
100
|
-
* Pitches the camera to the given angle in degrees.
|
|
101
|
-
* The angle is clamped to the 0-90 degree range.
|
|
102
|
-
* Note: This method won't work if {@link ControlsAPI.handlers | handlers.pitch} is disabled.
|
|
103
|
-
* @param angle Target angle in degrees
|
|
104
|
-
* @param immediate If true, applies the change immediately without animation
|
|
105
|
-
* @returns Promise that resolves when the pitch animation completes
|
|
106
|
-
*/
|
|
107
|
-
pitchTo: (angle: number, immediate?: boolean) => Promise<void>;
|
|
108
|
-
/**
|
|
109
|
-
* Resets the camera to the starting state.
|
|
110
|
-
* @param options Configuration for which handlers to reset
|
|
111
|
-
* @param immediate If true, applies the change immediately without animation
|
|
112
|
-
* @returns Promise that resolves when all reset animations complete
|
|
113
|
-
*/
|
|
114
|
-
resetCamera: (options?: Partial<ResetCameraOptions>, immediate?: boolean) => Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Configures smooth time values for camera operations.
|
|
117
|
-
* @param options Partial configuration object with time values in seconds
|
|
118
|
-
*/
|
|
119
|
-
configure: (options: Partial<ConfigureOptions>) => void;
|
|
120
|
-
/**
|
|
121
|
-
* Sets the camera bounds to restrict camera movement.
|
|
122
|
-
* Note: This method must be called after the viewport is initialized by `renderer.start()`.
|
|
123
|
-
* @param rect Rectangle in SVG coordinates defining the camera boundary or `undefined` to remove the boundary
|
|
124
|
-
*/
|
|
125
|
-
setCameraBounds: (rect?: Rect) => void;
|
|
126
|
-
/**
|
|
127
|
-
* Gets the current camera state.
|
|
128
|
-
* @returns Camera state object with center, zoom, roll, pitch, and ptScale
|
|
129
|
-
*/
|
|
130
|
-
getCameraState: () => CameraState;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Mapping of engine-wide events to their payloads
|
|
135
|
-
*/
|
|
136
|
-
export declare interface EngineEvents {
|
|
137
|
-
/** Camera change */
|
|
138
|
-
"navigation:change": void;
|
|
139
|
-
/** Camera roll */
|
|
140
|
-
"navigation:roll": number;
|
|
141
|
-
/** Mouse move */
|
|
142
|
-
"pointer:move": MouseEventData;
|
|
143
|
-
/** Mouse out */
|
|
144
|
-
"pointer:out": MouseEventData;
|
|
145
|
-
/** Mouse click */
|
|
146
|
-
"pointer:click": MouseEventData;
|
|
147
|
-
/** Viewport pixel to svg scale */
|
|
148
|
-
"viewport:ptscale": PtScaleEventData;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export declare type EventHandler<Payload> = (payload: Payload) => void;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Public API for interacting with the event system
|
|
155
|
-
*/
|
|
156
|
-
export declare interface EventsAPI {
|
|
157
|
-
/**
|
|
158
|
-
* Add an event listener for a specific event
|
|
159
|
-
* @param event - The event to listen for
|
|
160
|
-
* @param handler - The handler to call when the event is emitted
|
|
161
|
-
*/
|
|
162
|
-
addEventListener<E extends keyof EngineEvents>(event: E, handler: EventHandler<EngineEvents[E]>): void;
|
|
163
|
-
/**
|
|
164
|
-
* Remove an event listener for a specific event
|
|
165
|
-
* @param event - The event to remove the listener for
|
|
166
|
-
* @param handler - The handler to remove
|
|
167
|
-
*/
|
|
168
|
-
removeEventListener<E extends keyof EngineEvents>(event: E, handler: EventHandler<EngineEvents[E]>): void;
|
|
169
|
-
/**
|
|
170
|
-
* Check if there are any listeners for a specific event
|
|
171
|
-
* @param event - The event to check
|
|
172
|
-
* @returns true if there are listeners, false otherwise
|
|
173
|
-
*/
|
|
174
|
-
hasListeners<E extends keyof EngineEvents>(event: E): boolean;
|
|
175
|
-
/**
|
|
176
|
-
* Clear all event listeners
|
|
177
|
-
*/
|
|
178
|
-
clear(): void;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Loads a GLB file, converts it to a Three.js {@link Scene}, exports the scene as a GLTF
|
|
183
|
-
* (JSON) file, and triggers a browser download of the result.
|
|
184
|
-
* @param url - The URL of the GLB file.
|
|
185
|
-
* @param isMeshopt - Whether the model file uses meshopt compression.
|
|
186
|
-
*/
|
|
187
|
-
export declare function glb2gltf(url: string, isMeshopt?: boolean): Promise<void>;
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Public API interface exposed through renderer.controls.handlers.
|
|
191
|
-
* Each handler implements this interface to provide consistent enable/disable/configure functionality.
|
|
192
|
-
* @template T Handler-specific options type (can be undefined if handler has no options).
|
|
193
|
-
*/
|
|
194
|
-
export declare interface HandlerAPI<T = undefined> {
|
|
195
|
-
/**
|
|
196
|
-
* Enable this handler
|
|
197
|
-
*/
|
|
198
|
-
enable(): void;
|
|
199
|
-
/**
|
|
200
|
-
* Disable this handler
|
|
201
|
-
*/
|
|
202
|
-
disable(): void;
|
|
203
|
-
/**
|
|
204
|
-
* Check if this handler is currently enabled
|
|
205
|
-
* @returns true if enabled, false otherwise
|
|
206
|
-
*/
|
|
207
|
-
isEnabled(): boolean;
|
|
208
|
-
/**
|
|
209
|
-
* Configure this handler with new options.
|
|
210
|
-
* Only available if handler has options (T is not undefined)
|
|
211
|
-
* @param options Partial options to update
|
|
212
|
-
*/
|
|
213
|
-
configure(options: T extends undefined ? never : Partial<T>): void;
|
|
214
|
-
/**
|
|
215
|
-
* Reset this handler to its initial state.
|
|
216
|
-
* @param enableTransition Whether to animate the transition (default: true)
|
|
217
|
-
* @returns Promise that resolves when the reset is complete
|
|
218
|
-
*/
|
|
219
|
-
reset(enableTransition?: boolean): Promise<void>;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Gesture handlers
|
|
224
|
-
*/
|
|
225
|
-
declare interface Handlers {
|
|
226
|
-
/** Pan handler */
|
|
227
|
-
pan: HandlerAPI;
|
|
228
|
-
/** Zoom handler */
|
|
229
|
-
zoom: HandlerAPI;
|
|
230
|
-
/** Roll handler */
|
|
231
|
-
roll: HandlerAPI<RollHandlerOptions>;
|
|
232
|
-
/** Pitch handler */
|
|
233
|
-
pitch: HandlerAPI<PitchHandlerOptions>;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/** Image definition */
|
|
237
|
-
export declare interface ImageDef extends SharedDef {
|
|
238
|
-
/** Image source. Not updatable. */
|
|
239
|
-
source: ImageSource;
|
|
240
|
-
/** Image's bounds */
|
|
241
|
-
bounds: Rect;
|
|
242
|
-
/**
|
|
243
|
-
* Image's anchor point. Defines the point on the image that is used as an origin point for transformations.
|
|
244
|
-
* [0, 0] is the top-left corner, [0.5, 0.5] is the center (default), [1, 1] is the bottom-right corner.
|
|
245
|
-
*/
|
|
246
|
-
origin?: [number, number];
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export declare type ImageSource = HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;
|
|
250
|
-
|
|
251
|
-
export declare type Index = readonly [number, number, number];
|
|
252
|
-
|
|
253
|
-
export declare function isImageDef(def: RenderableDef): def is ImageDef;
|
|
254
|
-
|
|
255
|
-
export declare function isImageLayer(layer: LayerDef): layer is TypedLayerDef<ImageDef>;
|
|
256
|
-
|
|
257
|
-
export declare function isLayerDef(def: RenderableDef): def is LayerDef;
|
|
258
|
-
|
|
259
|
-
export declare function isLayerLayer(layer: LayerDef): layer is TypedLayerDef<LayerDef>;
|
|
260
|
-
|
|
261
|
-
export declare function isLineDef(def: RenderableDef): def is LineDef;
|
|
262
|
-
|
|
263
|
-
export declare function isLineLayer(layer: LayerDef): layer is TypedLayerDef<LineDef>;
|
|
264
|
-
|
|
265
|
-
export declare function isModelDef(def: RenderableDef): def is ModelDef;
|
|
266
|
-
|
|
267
|
-
export declare function isModelLayer(layer: LayerDef): layer is TypedLayerDef<ModelDef>;
|
|
268
|
-
|
|
269
|
-
export declare function isShapeDef(def: RenderableDef): def is ShapeDef;
|
|
270
|
-
|
|
271
|
-
export declare function isShapeLayer(layer: LayerDef): layer is TypedLayerDef<ShapeDef>;
|
|
272
|
-
|
|
273
|
-
export declare function isTextDef(def: RenderableDef): def is TextDef;
|
|
274
|
-
|
|
275
|
-
export declare function isTextLayer(layer: LayerDef): layer is TypedLayerDef<TextDef>;
|
|
276
|
-
|
|
277
|
-
export declare type IVector2 = Vector2Like | Vector2Tuple;
|
|
278
|
-
|
|
279
|
-
export declare type IVector3 = Vector3Like | Vector3Tuple;
|
|
280
|
-
|
|
281
|
-
/** Layer definition */
|
|
282
|
-
export declare interface LayerDef extends SharedDef {
|
|
283
|
-
/** Layer's name */
|
|
284
|
-
readonly name: string;
|
|
285
|
-
/** Whether to enable interaction with the layer (raycasting). */
|
|
286
|
-
interactive?: boolean;
|
|
287
|
-
/** Collection of layer's children. Mixing different types of children is not supported. */
|
|
288
|
-
children: RenderableDefCollection;
|
|
289
|
-
/**
|
|
290
|
-
* Layer's rendering mode. Propagates to children: child layers inherit the parent's mode
|
|
291
|
-
* unless they specify their own. Defaults to `"2D"` at the root.
|
|
292
|
-
* Resolved once during scene build and should not be changed afterwards.
|
|
293
|
-
* - `"2D"`: painter's algorithm (AlwaysDepth). Layer order determines overlap.
|
|
294
|
-
* - `"3D"`: depth testing (LessDepth). Closer geometry occludes farther geometry.
|
|
295
|
-
*/
|
|
296
|
-
readonly mode?: "2D" | "3D";
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/** Line definition */
|
|
300
|
-
export declare interface LineDef extends SharedDef {
|
|
301
|
-
/** Line's points. Not updatable. */
|
|
302
|
-
points: [Vector2Like, Vector2Like];
|
|
303
|
-
/** Line's color in css format */
|
|
304
|
-
color: ColorInput;
|
|
305
|
-
/** Line's width in screen-space units (pixels). */
|
|
306
|
-
width: number;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
/** Options for loading a GLB file. */
|
|
310
|
-
export declare interface LoadGLBOptions {
|
|
311
|
-
/** The URL of the GLB file. */
|
|
312
|
-
url: string;
|
|
313
|
-
/** Whether the model file uses meshopt compression. */
|
|
314
|
-
isMeshopt?: boolean;
|
|
315
|
-
/** Whether the model file uses Draco compression. */
|
|
316
|
-
isDraco?: boolean;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/** External 3D model definition */
|
|
320
|
-
export declare interface ModelDef extends SharedDef {
|
|
321
|
-
/** Model's URL. Not updatable. */
|
|
322
|
-
url: string;
|
|
323
|
-
/** Model's bounds */
|
|
324
|
-
bounds: Rect;
|
|
325
|
-
/** Model's opacity. Optional. */
|
|
326
|
-
opacity?: number;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Data for mouse events
|
|
331
|
-
*/
|
|
332
|
-
export declare interface MouseEventData {
|
|
333
|
-
/** Original mouse event */
|
|
334
|
-
event: MouseEvent;
|
|
335
|
-
/** Translated pointer data for each loaded scene */
|
|
336
|
-
data: PointWithinSceneData[];
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Configuration options for PitchHandler
|
|
341
|
-
*/
|
|
342
|
-
export declare interface PitchHandlerOptions {
|
|
343
|
-
/**
|
|
344
|
-
* Minimum pitch angle in degrees (0 = looking straight down at the map)
|
|
345
|
-
* @default 0
|
|
346
|
-
*/
|
|
347
|
-
minPitch?: number;
|
|
348
|
-
/**
|
|
349
|
-
* Maximum pitch angle in degrees (90 = looking horizontally)
|
|
350
|
-
* @default 85
|
|
351
|
-
*/
|
|
352
|
-
maxPitch?: number;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/** Point within a scene coupled with the scene identifier and intersected defs */
|
|
356
|
-
export declare interface PointWithinSceneData {
|
|
357
|
-
/** Point in SVG/model coordinates. */
|
|
358
|
-
point: Vector2Like;
|
|
359
|
-
/** Identifier of the scene that contains the point. Undefined in case of default scene. */
|
|
360
|
-
sceneId?: string;
|
|
361
|
-
/** Intersected defs */
|
|
362
|
-
defs: RenderableDef[];
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/** Polygon shape instance. */
|
|
366
|
-
export declare class Polygon {
|
|
367
|
-
private _indices;
|
|
368
|
-
private _vertices;
|
|
369
|
-
private _bbox;
|
|
370
|
-
/**
|
|
371
|
-
* @param vertices Array of polygon vertices.
|
|
372
|
-
* @param indices Array of polygon indices. Each index is a triplet of vertex indices forming a triangle.
|
|
373
|
-
*/
|
|
374
|
-
constructor(vertices: (IVector3 | IVector2)[], indices: Index[]);
|
|
375
|
-
/** Array of polygon vertices. */
|
|
376
|
-
get vertices(): readonly Vector3Like[];
|
|
377
|
-
/** Array of polygon indices. Each index is a triplet of vertex indices forming a triangle. */
|
|
378
|
-
get indices(): readonly Index[];
|
|
379
|
-
/**
|
|
380
|
-
* Bounding rectangle of the polygon.
|
|
381
|
-
* This is a 2D axis-aligned bounding box computed from the X/Y projection of vertices.
|
|
382
|
-
* The Z extent of the polygon is not tracked.
|
|
383
|
-
*/
|
|
384
|
-
get bounds(): Rect;
|
|
385
|
-
/**
|
|
386
|
-
* Converts a {@link Rect} to a {@link Polygon}.
|
|
387
|
-
* @param rect {@link Rect} instance
|
|
388
|
-
* @returns new {@link Polygon} instance
|
|
389
|
-
*/
|
|
390
|
-
static fromRect(rect: Rect): Polygon;
|
|
391
|
-
/**
|
|
392
|
-
* Merges multiple polygons into a single one.
|
|
393
|
-
* @param polygons Array of {@link Polygon} instances
|
|
394
|
-
* @returns new {@link Polygon} instance
|
|
395
|
-
*/
|
|
396
|
-
static merge(...polygons: Polygon[]): Polygon;
|
|
397
|
-
/**
|
|
398
|
-
* Translates all vertices of the polygon by the given offset.
|
|
399
|
-
* @param offset Offset to translate the polygon by. Can be a 2D or 3D vector.
|
|
400
|
-
* @returns this {@link Polygon} instance
|
|
401
|
-
*/
|
|
402
|
-
translate(offset: Vector2Like | Vector3Like): Polygon;
|
|
403
|
-
/**
|
|
404
|
-
* Rotates all vertices of the polygon around the given center. Only 2D rotation (around Z axis) is supported.
|
|
405
|
-
* @param rotation Rotation angle in radians. Positive values rotate clockwise.
|
|
406
|
-
* @param center Center of the rotation. If omitted, defaults to the bounding rectangle center.
|
|
407
|
-
* @returns this {@link Polygon} instance
|
|
408
|
-
*/
|
|
409
|
-
rotate(rotation: number, center?: Vector2Like): Polygon;
|
|
410
|
-
/**
|
|
411
|
-
* Scales the polygon around the given origin.
|
|
412
|
-
* @param scaleFactor Can be a single number or a 2D vector. If a single number is provided, both horizontal and
|
|
413
|
-
* vertical axes will be scaled by the same factor. Z is unchanged in both cases.
|
|
414
|
-
* @param origin Origin of the scaling. If omitted, defaults to the bounding rectangle center.
|
|
415
|
-
* @returns this {@link Polygon} instance
|
|
416
|
-
*/
|
|
417
|
-
scale(scaleFactor: number | Vector2Like, origin?: Vector2Like): Polygon;
|
|
418
|
-
private computeBoundingRect;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/** Data for ptScale events */
|
|
422
|
-
export declare interface PtScaleEventData {
|
|
423
|
-
/** Scene identifier, undefined for default scene */
|
|
424
|
-
sceneId?: string;
|
|
425
|
-
/** Pixel to SVG scale factor */
|
|
426
|
-
ptScale: number;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/** Rectangle shape instance. */
|
|
430
|
-
export declare class Rect {
|
|
431
|
-
/** Optional rotation of the rectangle. In radians, around center. Positive values rotate clockwise. */
|
|
432
|
-
rotation: number;
|
|
433
|
-
/** Optional elevation of the rectangle. Positive values raise geometry toward the viewer. Defaults to 0. */
|
|
434
|
-
elevation: number;
|
|
435
|
-
private _min;
|
|
436
|
-
private _max;
|
|
437
|
-
private _center;
|
|
438
|
-
private _size;
|
|
439
|
-
/**
|
|
440
|
-
* @param min Top left corner of the rectangle.
|
|
441
|
-
* @param max Bottom right corner of the rectangle.
|
|
442
|
-
* @param rotation Optional rotation of the rectangle. In radians, around center. Positive values rotate clockwise.
|
|
443
|
-
* @param elevation Optional elevation. Positive values raise geometry toward the viewer. Defaults to 0.
|
|
444
|
-
*/
|
|
445
|
-
constructor(min: IVector2, max: IVector2, rotation?: number, elevation?: number);
|
|
446
|
-
/** Top left corner of the rectangle. */
|
|
447
|
-
get min(): Vector2Like;
|
|
448
|
-
/** Set top left corner of the rectangle. */
|
|
449
|
-
set min(min: Vector2Like);
|
|
450
|
-
/** Bottom right corner of the rectangle. */
|
|
451
|
-
get max(): Vector2Like;
|
|
452
|
-
/** Set bottom right corner of the rectangle. */
|
|
453
|
-
set max(max: Vector2Like);
|
|
454
|
-
/** Center of the rectangle. */
|
|
455
|
-
get center(): Vector2Like;
|
|
456
|
-
/** Set center of the rectangle. */
|
|
457
|
-
set center(center: Vector2Like);
|
|
458
|
-
/** Size of the rectangle. */
|
|
459
|
-
get size(): Vector2Like;
|
|
460
|
-
/** Set size of the rectangle. */
|
|
461
|
-
set size(size: Vector2Like);
|
|
462
|
-
/**
|
|
463
|
-
* Creates a rectangle from an SVG rectangle element.
|
|
464
|
-
* @param rect {@link SVGRectElement} or {@link SVGImageElement}
|
|
465
|
-
* @param rotation Optional rotation of the rectangle. In radians, around center. Positive values rotate clockwise.
|
|
466
|
-
* @param elevation Optional elevation. Positive values raise geometry toward the viewer. Defaults to 0.
|
|
467
|
-
* @returns new {@link Rect} instance
|
|
468
|
-
*/
|
|
469
|
-
static fromSvg(rect: SVGRectElement | SVGImageElement, rotation?: number, elevation?: number): Rect;
|
|
470
|
-
/**
|
|
471
|
-
* Moves the rectangle by the given offset.
|
|
472
|
-
* @param offset Offset to move the rectangle by.
|
|
473
|
-
* @returns this {@link Rect} instance
|
|
474
|
-
*/
|
|
475
|
-
translate(offset: Vector2Like): Rect;
|
|
476
|
-
/**
|
|
477
|
-
* Expands the rectangle by the given amount on all sides.
|
|
478
|
-
* Use positive values to increase the size of the rectangle, negative values to decrease it.
|
|
479
|
-
* @param expansion Can be a single number or a 2D vector. If a single number is provided, both horizontal and vertical sizes will be expanded by the same amount.
|
|
480
|
-
* @returns this {@link Rect} instance
|
|
481
|
-
*/
|
|
482
|
-
expand(expansion: number | Vector2Like): Rect;
|
|
483
|
-
private updateCenterAndSize;
|
|
484
|
-
private updateMinAndMax;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
export declare type RenderableDef = LayerDef | ShapeDef | ImageDef | TextDef | LineDef | ModelDef;
|
|
488
|
-
|
|
489
|
-
export declare type RenderableDefCollection<T = RenderableDef> = T extends RenderableDef ? T[] : never;
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Main class for rendering the content of a {@link SceneDef}
|
|
493
|
-
*/
|
|
494
|
-
export declare class Renderer {
|
|
495
|
-
/** {@link HTMLCanvasElement} that this renderer is rendering to */
|
|
496
|
-
readonly canvas: HTMLCanvasElement;
|
|
497
|
-
private ui?;
|
|
498
|
-
private gl?;
|
|
499
|
-
private ctx;
|
|
500
|
-
private clock;
|
|
501
|
-
private renderer;
|
|
502
|
-
private memoryInfoExtension;
|
|
503
|
-
private memoryInfo?;
|
|
504
|
-
private eventSystem;
|
|
505
|
-
private lightsSystem;
|
|
506
|
-
private layerSystem;
|
|
507
|
-
private viewportSystem;
|
|
508
|
-
private updatesSystem;
|
|
509
|
-
private interactionsSystem;
|
|
510
|
-
private controlsSystem?;
|
|
511
|
-
private controlsAPI?;
|
|
512
|
-
private eventsAPI?;
|
|
513
|
-
private viewportAPI?;
|
|
514
|
-
private initialized;
|
|
515
|
-
private disposed;
|
|
516
|
-
private needsRedraw;
|
|
517
|
-
/**
|
|
518
|
-
* @param opts {@link RendererOptions}
|
|
519
|
-
*/
|
|
520
|
-
constructor(opts: RendererOptions);
|
|
521
|
-
/**
|
|
522
|
-
* {@link EventsAPI} instance for subscribing to internal events
|
|
523
|
-
*/
|
|
524
|
-
get events(): EventsAPI;
|
|
525
|
-
/**
|
|
526
|
-
* {@link ControlsAPI} instance for controlling the viewport
|
|
527
|
-
*/
|
|
528
|
-
get controls(): ControlsAPI;
|
|
529
|
-
/**
|
|
530
|
-
* {@link ViewportAPI} instance for view transforms and coordinate conversion.
|
|
531
|
-
*/
|
|
532
|
-
get viewport(): ViewportAPI;
|
|
533
|
-
/**
|
|
534
|
-
* Optional CSS-pixel sub-rectangle of the viewport used for positioning the scene's viewbox.
|
|
535
|
-
*/
|
|
536
|
-
get visibleRect(): Rect | undefined;
|
|
537
|
-
/**
|
|
538
|
-
* Sets the CSS-pixel visible sub-rectangle.
|
|
539
|
-
* Triggers a viewport transform recompute (and schedules a redraw) only if the renderer
|
|
540
|
-
* is already initialized and not disposed; otherwise the value is stored and applied on the
|
|
541
|
-
* next {@link init} or {@link addScene} call.
|
|
542
|
-
*/
|
|
543
|
-
set visibleRect(rect: Rect);
|
|
544
|
-
/**
|
|
545
|
-
* Underlying {@link WebGLRenderer} instance
|
|
546
|
-
*/
|
|
547
|
-
get context(): WebGLRenderer;
|
|
548
|
-
/* Excluded from this release type: size */
|
|
549
|
-
/**
|
|
550
|
-
* Returns true if the renderer is in external mode, meaning that webgl context is managed outside of the renderer
|
|
551
|
-
* (for example, when using Mapbox GL JS as a host context). In this mode renderer will not clear the canvas before
|
|
552
|
-
* rendering, and will not automatically compute scene and camera transformations. Clients are responsible for setting
|
|
553
|
-
* the transform matrix manually by using {@link SceneDef.staticTransform} and passing camera projection matrix
|
|
554
|
-
* to {@link render} as an optional argument.
|
|
555
|
-
*/
|
|
556
|
-
get isExternalMode(): boolean;
|
|
557
|
-
/**
|
|
558
|
-
* Returns true if the renderer is initialized, meaning that the viewport and scene have been set up.
|
|
559
|
-
*/
|
|
560
|
-
get isInitialized(): boolean;
|
|
561
|
-
/**
|
|
562
|
-
* Returns true if the renderer is disposed, meaning that all WebGL resources have been released.
|
|
563
|
-
*/
|
|
564
|
-
get isDisposed(): boolean;
|
|
565
|
-
/**
|
|
566
|
-
* Loads a GLB file and returns a Three.js model.
|
|
567
|
-
* @param models - The models to load.
|
|
568
|
-
*/
|
|
569
|
-
loadModel(models: LoadGLBOptions[]): Promise<void>;
|
|
570
|
-
/**
|
|
571
|
-
* Initializes viewport and scene with the given scene definition.
|
|
572
|
-
* Should be called once on startup. Repeated calls will produce console warnings.
|
|
573
|
-
* @param sceneDef {@link SceneDef} to render
|
|
574
|
-
*/
|
|
575
|
-
init(sceneDef?: SceneDef): void;
|
|
576
|
-
/**
|
|
577
|
-
* Add a scene to the renderer. Note that this method is untested in internal mode. Use {@link Renderer.init} instead.
|
|
578
|
-
* @param sceneDef {@link SceneDef} to render
|
|
579
|
-
* @param sceneId identifier of the scene (map key)
|
|
580
|
-
*/
|
|
581
|
-
addScene(sceneDef: SceneDef, sceneId: string): void;
|
|
582
|
-
/**
|
|
583
|
-
* Start the rendering loop
|
|
584
|
-
*/
|
|
585
|
-
start(): void;
|
|
586
|
-
/**
|
|
587
|
-
* Update the given defs to make them reflect the current state.
|
|
588
|
-
* Defs are queued for processing and will be applied during the next render frame,
|
|
589
|
-
* with frustum culling deferring off-screen text and image updates.
|
|
590
|
-
* @param defs {@link RenderableDef} array to update
|
|
591
|
-
*/
|
|
592
|
-
update(...defs: RenderableDef[]): void;
|
|
593
|
-
/**
|
|
594
|
-
* Render a single frame
|
|
595
|
-
* @param cameraProjection optional camera projection matrix. Ignored in internal mode, required in external mode.
|
|
596
|
-
*/
|
|
597
|
-
render(cameraProjection?: number[]): void;
|
|
598
|
-
/**
|
|
599
|
-
* Stop the rendering loop
|
|
600
|
-
*/
|
|
601
|
-
stop(): void;
|
|
602
|
-
/**
|
|
603
|
-
* Dispose all WebGL resources. This calls {@link Renderer.stop} internally.
|
|
604
|
-
* WARNING: This method is final and cannot be undone. Attempting to use the renderer after calling this method
|
|
605
|
-
* will result in a console warning and no-op methods. If you need to re-initialize the renderer, create a new instance.
|
|
606
|
-
*/
|
|
607
|
-
dispose(): void;
|
|
608
|
-
private initScene;
|
|
609
|
-
private resizeCanvasToDisplaySize;
|
|
610
|
-
private createRendererContext;
|
|
611
|
-
private onContextLost;
|
|
612
|
-
private onContextRestored;
|
|
613
|
-
private initStatsContext;
|
|
614
|
-
private updateMemoryInfo;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Options for initializing the {@link Renderer}
|
|
619
|
-
*/
|
|
620
|
-
export declare interface RendererOptions {
|
|
621
|
-
/** {@link HTMLCanvasElement} to render to */
|
|
622
|
-
canvas: HTMLCanvasElement;
|
|
623
|
-
/** Optional {@link WebGLRenderingContext} to use (e.g. for Mapbox GL JS) */
|
|
624
|
-
gl?: WebGLRenderingContext;
|
|
625
|
-
/** Optional partial {@link UI} configuration */
|
|
626
|
-
ui?: Partial<UI>;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* Options for the {@link ControlsAPI.resetCamera} method.
|
|
631
|
-
* @inline
|
|
632
|
-
*/
|
|
633
|
-
export declare type ResetCameraOptions = {
|
|
634
|
-
[Property in keyof Handlers]?: boolean;
|
|
635
|
-
};
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* Configuration options for RollHandler
|
|
639
|
-
*/
|
|
640
|
-
export declare interface RollHandlerOptions {
|
|
641
|
-
/**
|
|
642
|
-
* Rotation threshold in pixels along circumference of touch circle (Mapbox-style).
|
|
643
|
-
* Higher values require more movement before rotation starts.
|
|
644
|
-
* @default 25
|
|
645
|
-
*/
|
|
646
|
-
rotationThreshold?: number;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
/** Scene definition */
|
|
650
|
-
export declare interface SceneDef {
|
|
651
|
-
/** Root layer of the scene tree */
|
|
652
|
-
rootLayer: LayerDef;
|
|
653
|
-
/** Background color in css format */
|
|
654
|
-
background?: ColorInput;
|
|
655
|
-
/** SVG viewbox */
|
|
656
|
-
viewbox: Rect;
|
|
657
|
-
/** Textures memory limit in megabytes */
|
|
658
|
-
memoryLimit?: number;
|
|
659
|
-
/** Static transform matrix */
|
|
660
|
-
staticTransform?: number[];
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
export declare type Shape = Rect | Polygon;
|
|
664
|
-
|
|
665
|
-
/** Shape definition. */
|
|
666
|
-
export declare interface ShapeDef extends SharedDef {
|
|
667
|
-
/**
|
|
668
|
-
* Shape to render. Updating partially supported, you can't add or remove polygon's vertices or indices.
|
|
669
|
-
* Also it's not possible to change the shape type (i.e. from polygon to rect and vice versa).
|
|
670
|
-
*/
|
|
671
|
-
shape: Shape;
|
|
672
|
-
/** Shape's color in css format */
|
|
673
|
-
color: ColorInput;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
/** Shared properties for all renderable defs */
|
|
677
|
-
export declare interface SharedDef {
|
|
678
|
-
/** Whether the def is hidden */
|
|
679
|
-
hidden?: boolean;
|
|
680
|
-
/** Def's dim state. `true` to dim, `false` to skip dim, `undefined` to reset to ancestor's value. */
|
|
681
|
-
dim?: boolean;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* Loads a GLTF/GLB file and splits its top-level children into two GLB files based on
|
|
686
|
-
* whether each child's name starts with `BasisTransform`. The matching children are saved
|
|
687
|
-
* with a `-decor` suffix; the rest are saved with a `-base` suffix. Both files are
|
|
688
|
-
* triggered as browser downloads. The output is intentionally uncompressed — run a
|
|
689
|
-
* meshopt/quantize pass offline (e.g. via `gltf-transform`) afterwards.
|
|
690
|
-
* @param url - The URL of the GLTF/GLB file.
|
|
691
|
-
*/
|
|
692
|
-
export declare function splitGltf(url: string): Promise<void>;
|
|
693
|
-
|
|
694
|
-
/** Text alignment */
|
|
695
|
-
export declare interface TextAlignment {
|
|
696
|
-
/** Horizontal alignment */
|
|
697
|
-
horizontal: "left" | "center" | "right";
|
|
698
|
-
/** Vertical alignment */
|
|
699
|
-
vertical: "top" | "center" | "bottom";
|
|
700
|
-
/** Text alignment within the line. Optional. */
|
|
701
|
-
text?: "left" | "center" | "right";
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
/** Text definition */
|
|
705
|
-
export declare interface TextDef extends SharedDef {
|
|
706
|
-
/** Array of text lines. Not updatable, but each line is updatable. */
|
|
707
|
-
lines: TextLineDef[];
|
|
708
|
-
/** Text's bounds */
|
|
709
|
-
bounds: Rect;
|
|
710
|
-
/** Text's padding [horizontal, vertical] */
|
|
711
|
-
padding: [number, number];
|
|
712
|
-
/** {@link TextAlignment} object describing text's alignment */
|
|
713
|
-
alignment: TextAlignment;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
/** Single text line definition */
|
|
717
|
-
export declare interface TextLineDef {
|
|
718
|
-
/** Line's text */
|
|
719
|
-
text: string;
|
|
720
|
-
/** Line's color in css format */
|
|
721
|
-
color: ColorInput;
|
|
722
|
-
/** Line's font URL. Not updatable. Supported formats: .ttf, .otf, .woff (.woff2 is not supported). */
|
|
723
|
-
fontUrl: string;
|
|
724
|
-
/** Line's font size */
|
|
725
|
-
fontSize: number;
|
|
726
|
-
/** Line's stroke color & width. Optional. */
|
|
727
|
-
stroke?: {
|
|
728
|
-
color: ColorInput;
|
|
729
|
-
width: number;
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
/** Typed layer definition. Useful for type-checking and type-casting. */
|
|
734
|
-
export declare interface TypedLayerDef<T extends RenderableDef> extends LayerDef {
|
|
735
|
-
children: RenderableDefCollection<T>;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* Type describing debug UI elements
|
|
740
|
-
*/
|
|
741
|
-
export declare interface UI {
|
|
742
|
-
/** {@link Stats} instance for tracking performance metrics */
|
|
743
|
-
stats: default_2;
|
|
744
|
-
/** HTML element for displaying WebGL memory information */
|
|
745
|
-
memoryInfoPanel: HTMLDivElement;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
export { Vector2Like }
|
|
749
|
-
|
|
750
|
-
export { Vector3Like }
|
|
751
|
-
|
|
752
|
-
/** Viewport system public API. */
|
|
753
|
-
export declare interface ViewportAPI {
|
|
754
|
-
/**
|
|
755
|
-
* Convert canvas coordinates (CSS pixels, relative to canvas top-left) to SVG coordinates.
|
|
756
|
-
* @param point point in canvas space (CSS pixels)
|
|
757
|
-
* @returns Array of points in SVG coordinates of all loaded scenes
|
|
758
|
-
*/
|
|
759
|
-
canvasToSvg: (point: Vector2Like) => {
|
|
760
|
-
point: Vector2Like;
|
|
761
|
-
sceneId?: string;
|
|
762
|
-
}[];
|
|
763
|
-
/**
|
|
764
|
-
* Set the maximum zoom factor. Default is 35.
|
|
765
|
-
* @param maxZoom Maximum zoom factor
|
|
766
|
-
*/
|
|
767
|
-
setMaxZoom: (maxZoom: number) => void;
|
|
768
|
-
/**
|
|
769
|
-
* Set the minimum zoom factor. Default is 0.1.
|
|
770
|
-
* @param minZoom Minimum zoom factor
|
|
771
|
-
*/
|
|
772
|
-
setMinZoom: (minZoom: number) => void;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
/** Options for the {@link ControlsAPI.zoomTo} method. */
|
|
776
|
-
export declare interface ZoomToOptions {
|
|
777
|
-
/** Maximum zoom factor. */
|
|
778
|
-
maxZoom: number;
|
|
779
|
-
/** Percentage of padding to add to the target rectangle. */
|
|
780
|
-
paddingPercent: number;
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
export { }
|
|
1
|
+
export { type CameraAPI, type CameraAxes, type CameraState, type ControlsConfig, type InertiaConfig, type PanConfig, type RollConfig, type TransitionOptions, useCameraAPI, useCameraMoveStart, useCameraState, type ZoomToOptions, } from './controls';
|
|
2
|
+
export { prepareDebug } from './debug';
|
|
3
|
+
export * from './Renderer';
|
|
4
|
+
export { type CameraProps, type SmoothTime } from './space/Camera';
|
|
5
|
+
export { type CanvasPoint, type CanvasPointLike, type PlanPoint, type PlanPointLike, } from './space/Space';
|
|
6
|
+
export { useViewport, type ViewportAPI } from './space/viewport';
|
|
7
|
+
export * from './types/defs';
|
|
8
|
+
export * from './types/events';
|
|
9
|
+
export * from './types/guards';
|
|
10
|
+
export { update } from './update';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|