@almadar/shell-web 0.1.0 → 1.1.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.
Files changed (131) hide show
  1. package/dist/{ArbitraryClassCompiler-Mzabq-UB.d.ts → ArbitraryClassCompiler-CO_iASBn.d.ts} +99 -4
  2. package/dist/AvlGlyph-PIXU6QH5.js +5 -0
  3. package/dist/AvlStateMachine-CKGMECMG.js +8 -0
  4. package/dist/AvlTransitionDetail-QZX6G5KJ.js +10 -0
  5. package/dist/AvlTransitionExplainer-26WLEIC6.js +11 -0
  6. package/dist/BehaviorView-JLZ4PKWY.js +10 -0
  7. package/dist/{EventBusProvider-CVwjkV_2.d.ts → EventBusProvider-BFFHfN4O.d.ts} +12 -0
  8. package/dist/{FileTree-BCFnBEuQ.d.ts → FileTree-B3GDAjaQ.d.ts} +131 -4
  9. package/dist/FlowCanvas-RPII4V24.js +23 -0
  10. package/dist/{BehaviorValueFrame-SSEMEBTG.css → FlowCanvas-VWUPMBKB.css} +189 -191
  11. package/dist/{GameAudioProvider-Cm9BnvmP.d.ts → GameAudioProvider-D7wo5ryN.d.ts} +5 -8
  12. package/dist/KernelEngineContext-CPeWQMAz.d.ts +46 -0
  13. package/dist/LayersPanel-M2LHWUFF.js +6 -0
  14. package/dist/ModuleCard-NJD6JQGD.js +6 -0
  15. package/dist/OrbInspector-OWWKPOBF.js +23 -0
  16. package/dist/{TraitValueFrame-4G3KOUBR.css → OrbInspector-VMTMZHNQ.css} +189 -191
  17. package/dist/{Select-mDZIwNqN.d.ts → Select-C2Uq6t86.d.ts} +17 -31
  18. package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
  19. package/dist/{FlowCanvas-3JRMNJLV.css → UISlotRenderer-BIS6KT7T.css} +189 -191
  20. package/dist/UISlotRenderer-PY7FIJXN.js +23 -0
  21. package/dist/auth/browser/index.js +1 -0
  22. package/dist/auth/react/index.d.ts +8 -1
  23. package/dist/auth/react/index.js +40 -2
  24. package/dist/avl/index.css +189 -191
  25. package/dist/avl/index.d.ts +107 -85
  26. package/dist/avl/index.js +170 -39
  27. package/dist/{chunk-P4LNHAFI.js → chunk-2WGR4TDJ.js} +465 -36
  28. package/dist/{chunk-GKIFONTE.js → chunk-3S54FWRC.js} +2 -2
  29. package/dist/{chunk-KVQS4GXU.js → chunk-4YJ53G7S.js} +18 -8
  30. package/dist/{chunk-MBQAMMSE.js → chunk-4YXBKHHM.js} +269 -658
  31. package/dist/{chunk-YDNJLLG6.js → chunk-57DC34LY.js} +19 -10
  32. package/dist/{chunk-FP3WIKTC.js → chunk-7N6ZPHQ5.js} +9 -1
  33. package/dist/{chunk-AILY3XPS.js → chunk-AE7VCQB6.js} +5 -6
  34. package/dist/{chunk-L677XGY3.js → chunk-AGVSO4WY.js} +4 -5
  35. package/dist/{chunk-FAJDTHWC.js → chunk-AGXD77SL.js} +2 -2
  36. package/dist/chunk-AU7O65OX.js +66 -0
  37. package/dist/{chunk-DFNZUYX4.js → chunk-FAKU5F62.js} +273 -29
  38. package/dist/{chunk-U6QRZASX.js → chunk-ILQXJ2AR.js} +1 -1
  39. package/dist/chunk-M74BCDBQ.js +490 -0
  40. package/dist/{chunk-GYTPOFVC.js → chunk-MS4K3K2R.js} +12095 -13329
  41. package/dist/{chunk-SGM3FASH.js → chunk-OWNG4JZI.js} +13 -12
  42. package/dist/{chunk-VFF5OO47.js → chunk-PCR37T3U.js} +15 -38
  43. package/dist/{chunk-SJGJJKBY.js → chunk-PRLHKBXG.js} +5 -3
  44. package/dist/{chunk-R5O5AUPI.js → chunk-PRXQGGCO.js} +93 -86
  45. package/dist/{chunk-42FY4RYA.js → chunk-REXYVBUO.js} +2 -2
  46. package/dist/{chunk-EQAMU2ZC.js → chunk-UTDC2NEA.js} +1 -1
  47. package/dist/{chunk-73SRAB4P.js → chunk-UU57VNS2.js} +2 -2
  48. package/dist/{chunk-TESBIVUA.js → chunk-VHC2M26B.js} +2 -2
  49. package/dist/{chunk-L2DEKY4J.js → chunk-VO2TTLS5.js} +3 -6
  50. package/dist/{chunk-2PY54Z44.js → chunk-VUIACGDU.js} +4 -5
  51. package/dist/{chunk-DLZF4PVE.js → chunk-YYIHRIDH.js} +3 -3
  52. package/dist/{chunk-DYEKAA4L.js → chunk-ZDRDJKYB.js} +243 -252
  53. package/dist/components/index.css +189 -191
  54. package/dist/components/index.d.ts +739 -289
  55. package/dist/components/index.js +25 -28
  56. package/dist/context/index.d.ts +2 -3
  57. package/dist/context/index.js +4 -3
  58. package/dist/core.d.ts +95 -19
  59. package/dist/core.js +2 -1
  60. package/dist/design-classes/index.cjs +3 -1
  61. package/dist/design-classes/index.js +3 -1
  62. package/dist/{fx-CmQjnHmT.d.ts → fx-Br8zjvu9.d.ts} +6 -6
  63. package/dist/hooks/index.d.ts +40 -5
  64. package/dist/hooks/index.js +5 -4
  65. package/dist/index.d.ts +40 -114
  66. package/dist/index.js +174 -34
  67. package/dist/kernel-client-JW6OH5FX.js +537 -0
  68. package/dist/kernel-wire-DGAySGhX.d.ts +95 -0
  69. package/dist/lib/index.d.ts +3 -4
  70. package/dist/lib/index.js +4 -4
  71. package/dist/{prism-AIWGN2X5.js → prism-X5YWKXO5.js} +5 -3
  72. package/dist/providers/index.css +189 -191
  73. package/dist/providers/index.d.ts +41 -28
  74. package/dist/providers/index.js +19 -24
  75. package/dist/renderer/index.d.ts +0 -2
  76. package/dist/renderer/index.js +1 -0
  77. package/dist/runtime/index.css +189 -191
  78. package/dist/runtime/index.d.ts +57 -253
  79. package/dist/runtime/index.js +18 -24
  80. package/dist/ssr/index.cjs +2643 -535
  81. package/dist/ssr/index.d.cts +0 -23
  82. package/dist/ssr/index.d.ts +0 -23
  83. package/dist/ssr/index.js +2639 -535
  84. package/dist/storage/browser/index.js +1 -0
  85. package/dist/test-support.d.ts +15 -8
  86. package/dist/test-support.js +91 -24
  87. package/dist/{paintDispatch-ChW5mVuK.d.ts → verificationRegistry-oopV1J1n.d.ts} +132 -30
  88. package/package.json +14 -38
  89. package/src/core/lib/band-shapes.json +7 -0
  90. package/src/core/locales/ar.json +18 -5
  91. package/src/core/locales/en.json +18 -5
  92. package/src/core/locales/sl.json +18 -5
  93. package/tailwind-preset.cjs +30 -1
  94. package/dist/AvlGlyph-JKJOAH23.js +0 -6
  95. package/dist/AvlStateMachine-PI4YGREK.js +0 -8
  96. package/dist/AvlTransitionDetail-ZH7V24UG.js +0 -12
  97. package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +0 -13
  98. package/dist/BehaviorValueFrame-6RUJXT4A.js +0 -29
  99. package/dist/BehaviorView-RFEE5J6E.js +0 -10
  100. package/dist/Canvas3DHost-_Y-5uLM_.d.ts +0 -552
  101. package/dist/FlowCanvas-STDC4OWK.js +0 -27
  102. package/dist/KernelEngineContext-BOCQoFwk.d.ts +0 -43
  103. package/dist/LayersPanel-BBQ54IVG.js +0 -7
  104. package/dist/ModuleCard-3TT2X7IW.js +0 -7
  105. package/dist/OrbInspector-K6T6O7GI.js +0 -27
  106. package/dist/OrbInspector-MHLJ6OEE.css +0 -1756
  107. package/dist/ServerBridge-Cm1On51b.d.ts +0 -233
  108. package/dist/TraitValueFrame-2PJGLLVI.js +0 -28
  109. package/dist/UISlotRenderer-JKFSX24W.js +0 -27
  110. package/dist/UISlotRenderer-KVFO6J7R.css +0 -1756
  111. package/dist/UserContext-DqWeZkUZ.d.ts +0 -100
  112. package/dist/avl-3d-context-BIRKWpaL.d.ts +0 -204
  113. package/dist/avl-schema-parser-CtJxJ9KU.d.ts +0 -132
  114. package/dist/avl-zoom-state-CKMVuBFg.d.ts +0 -17
  115. package/dist/chunk-2QOH2HWM.js +0 -95
  116. package/dist/chunk-6P3MWXYE.js +0 -440
  117. package/dist/chunk-B4BU77LT.js +0 -432
  118. package/dist/chunk-DJ433ET5.js +0 -1327
  119. package/dist/chunk-DZ42OJQC.js +0 -176
  120. package/dist/chunk-EOWMARUB.js +0 -16
  121. package/dist/chunk-FIW6WN23.js +0 -508
  122. package/dist/chunk-GAR5TQ5B.js +0 -199
  123. package/dist/chunk-PC7K4SK7.js +0 -1384
  124. package/dist/chunk-ZO6MXAS3.js +0 -69
  125. package/dist/kernel-client-ZH4PSMCN.js +0 -367
  126. package/dist/kernel-wire-B4S8pnP3.d.ts +0 -65
  127. package/dist/three/index.css +0 -503
  128. package/dist/three/index.d.ts +0 -1185
  129. package/dist/three/index.js +0 -3896
  130. package/dist/useKeyboardRouter-Dsq553Ur.d.ts +0 -42
  131. package/dist/verificationRegistry-CabxhfTv.d.ts +0 -122
@@ -1,1185 +0,0 @@
1
- import { C as CanvasPointLightConfig } from '../Canvas3DHost-_Y-5uLM_.js';
2
- import { IsometricTile, IsometricUnit, IsometricFeature } from '../components/index.js';
3
- export { c as Canvas3DHost, d as Canvas3DHostHandle, e as Canvas3DHostProps, c as GameCanvas3D, U as UnitAnimationState } from '../Canvas3DHost-_Y-5uLM_.js';
4
- import React__default, { Component, ReactNode, ErrorInfo } from 'react';
5
- import * as THREE from 'three';
6
- import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
7
- import { JsonObject, EventEmit, OrbitalSchema } from '@almadar/core';
8
- import { ZoomLevel } from '../avl/index.js';
9
- import { b as Avl3DModelOverrides } from '../avl-3d-context-BIRKWpaL.js';
10
- export { d as AVL_3D_COLORS, A as Avl3DConfig, a as Avl3DContext, C as CAMERA_POSITIONS, P as Position3D, e as arcCurve3D, f as fibonacciSpherePositions, g as goldenSpiralPositions, o as orbitRingPositions, s as selfLoopCurve3D, t as treeLayout3D, u as useAvl3DConfig } from '../avl-3d-context-BIRKWpaL.js';
11
- import { ApplicationLevelData, OrbitalLevelData, TraitLevelData, TransitionLevelData } from '../avl/index.js';
12
- import '../paintDispatch-ChW5mVuK.js';
13
- import '../fx-CmQjnHmT.js';
14
- import 'lucide-react';
15
- import '../EventBusProvider-CVwjkV_2.js';
16
-
17
- /**
18
- * Scene3D
19
- *
20
- * Three.js scene wrapper component for React Three Fiber.
21
- * Manages the scene environment, fog, and background.
22
- *
23
- * @packageDocumentation
24
- */
25
-
26
- interface Scene3DProps {
27
- /** Background color or URL */
28
- background?: string;
29
- /** Fog configuration */
30
- fog?: {
31
- color: string;
32
- near: number;
33
- far: number;
34
- };
35
- /** Children to render in scene */
36
- children?: React__default.ReactNode;
37
- }
38
- /**
39
- * Scene3D Component
40
- *
41
- * Manages Three.js scene settings like background and fog.
42
- *
43
- * @example
44
- * ```tsx
45
- * <Canvas>
46
- * <Scene3D background="#1a1a2e" fog={{ color: '#1a1a2e', near: 10, far: 50 }}>
47
- * <GameObjects />
48
- * </Scene3D>
49
- * </Canvas>
50
- * ```
51
- */
52
- declare function Scene3D({ background, fog, children }: Scene3DProps): React__default.JSX.Element;
53
-
54
- /**
55
- * Camera3D
56
- *
57
- * Three.js camera component with orbit controls.
58
- * Supports isometric, perspective, and top-down camera modes.
59
- *
60
- * @packageDocumentation
61
- */
62
-
63
- type CameraMode$1 = 'isometric' | 'perspective' | 'top-down';
64
- interface Camera3DProps {
65
- /** Camera mode */
66
- mode?: CameraMode$1;
67
- /** Initial camera position */
68
- position?: [number, number, number];
69
- /** Target to look at */
70
- target?: [number, number, number];
71
- /** Zoom level */
72
- zoom?: number;
73
- /** Field of view (perspective mode only) */
74
- fov?: number;
75
- /** Enable orbit controls */
76
- enableOrbit?: boolean;
77
- /** Minimum zoom distance */
78
- minDistance?: number;
79
- /** Maximum zoom distance */
80
- maxDistance?: number;
81
- /** Called when camera changes */
82
- onChange?: (camera: THREE.Camera) => void;
83
- }
84
- interface Camera3DHandle {
85
- /** Get current camera */
86
- getCamera: () => THREE.Camera;
87
- /** Set camera position */
88
- setPosition: (x: number, y: number, z: number) => void;
89
- /** Look at target */
90
- lookAt: (x: number, y: number, z: number) => void;
91
- /** Reset to initial position */
92
- reset: () => void;
93
- /** Get current view bounds */
94
- getViewBounds: () => {
95
- min: THREE.Vector3;
96
- max: THREE.Vector3;
97
- };
98
- }
99
- /**
100
- * Camera3D Component
101
- *
102
- * Configurable camera with orbit controls and multiple modes.
103
- *
104
- * @example
105
- * ```tsx
106
- * <Canvas>
107
- * <Camera3D mode="isometric" position={[10, 10, 10]} target={[0, 0, 0]} />
108
- * </Canvas>
109
- * ```
110
- */
111
- declare const Camera3D: React__default.ForwardRefExoticComponent<Camera3DProps & React__default.RefAttributes<Camera3DHandle>>;
112
-
113
- /**
114
- * Lighting3D
115
- *
116
- * Default lighting setup for 3D game scenes.
117
- * Includes ambient, directional, and optional point lights.
118
- *
119
- * @packageDocumentation
120
- */
121
-
122
- interface Lighting3DProps {
123
- /** Ambient light intensity */
124
- ambientIntensity?: number;
125
- /** Ambient light color */
126
- ambientColor?: string;
127
- /** Directional light intensity */
128
- directionalIntensity?: number;
129
- /** Directional light color */
130
- directionalColor?: string;
131
- /** Directional light position */
132
- directionalPosition?: [number, number, number];
133
- /** Hemisphere (sky/ground) light intensity */
134
- hemisphereIntensity?: number;
135
- /** Hemisphere sky color */
136
- hemisphereColor?: string;
137
- /** Hemisphere ground color */
138
- hemisphereGroundColor?: string;
139
- /** Additional point lights, authored as data */
140
- points?: CanvasPointLightConfig[];
141
- /** Enable shadows */
142
- shadows?: boolean;
143
- /** Shadow map size */
144
- shadowMapSize?: number;
145
- /** Shadow camera size (orthographic half-extent) */
146
- shadowCameraSize?: number;
147
- /** Shadow depth bias — reduces shadow acne */
148
- shadowBias?: number;
149
- /** Shadow normal bias — reduces acne on angled faces (undefined = three.js default 0) */
150
- shadowNormalBias?: number;
151
- /** Shadow camera near plane */
152
- shadowCameraNear?: number;
153
- /** Shadow camera far plane */
154
- shadowCameraFar?: number;
155
- /** Show helper for directional light */
156
- showHelpers?: boolean;
157
- }
158
- /**
159
- * Lighting3D Component
160
- *
161
- * Pre-configured lighting setup for game scenes.
162
- *
163
- * @example
164
- * ```tsx
165
- * <Canvas>
166
- * <Lighting3D
167
- * ambientIntensity={0.6}
168
- * directionalIntensity={1.0}
169
- * shadows={true}
170
- * />
171
- * </Canvas>
172
- * ```
173
- */
174
- declare function Lighting3D({ ambientIntensity, ambientColor, directionalIntensity, directionalColor, directionalPosition, hemisphereIntensity, hemisphereColor, hemisphereGroundColor, points, shadows, shadowMapSize, shadowCameraSize, shadowBias, shadowNormalBias, shadowCameraNear, shadowCameraFar, showHelpers, }: Lighting3DProps): React__default.JSX.Element;
175
-
176
- /**
177
- * Canvas3DLoadingState
178
- *
179
- * Loading state component for 3D canvas with progress indicator.
180
- * Displays asset loading progress and estimated time remaining.
181
- *
182
- * @packageDocumentation
183
- */
184
-
185
- interface Canvas3DLoadingStateProps {
186
- /** Current loading progress (0-100) */
187
- progress?: number;
188
- /** Number of assets loaded */
189
- loaded?: number;
190
- /** Total assets to load */
191
- total?: number;
192
- /** Loading message */
193
- message?: string;
194
- /** Secondary details message */
195
- details?: string;
196
- /** Whether to show spinner */
197
- showSpinner?: boolean;
198
- /** Custom className */
199
- className?: string;
200
- }
201
- /**
202
- * Canvas3DLoadingState Component
203
- *
204
- * Displays loading progress for 3D assets.
205
- *
206
- * @example
207
- * ```tsx
208
- * <Canvas3DLoadingState
209
- * progress={65}
210
- * loaded={13}
211
- * total={20}
212
- * message="Loading 3D models..."
213
- * details="character-knight.glb"
214
- * />
215
- * ```
216
- */
217
- declare function Canvas3DLoadingState({ progress, loaded, total, message: messageProp, details, showSpinner, className, }: Canvas3DLoadingStateProps): React__default.JSX.Element;
218
-
219
- /**
220
- * Canvas3DErrorBoundary
221
- *
222
- * Error boundary for 3D canvas components.
223
- * Catches Three.js and React Three Fiber errors gracefully.
224
- *
225
- * @packageDocumentation
226
- */
227
-
228
- interface Canvas3DErrorBoundaryProps {
229
- /** Child components */
230
- children: ReactNode;
231
- /** Custom fallback component */
232
- fallback?: ReactNode;
233
- /** Error callback */
234
- onError?: (error: Error, errorInfo: ErrorInfo) => void;
235
- /** Reset callback */
236
- onReset?: () => void;
237
- }
238
- interface Canvas3DErrorBoundaryState {
239
- /** Whether an error has occurred */
240
- hasError: boolean;
241
- /** The error that occurred */
242
- error: Error | null;
243
- /** Error info from React */
244
- errorInfo: ErrorInfo | null;
245
- }
246
- /**
247
- * Canvas3DErrorBoundary Component
248
- *
249
- * Catches errors in 3D canvas and displays a user-friendly fallback.
250
- *
251
- * @example
252
- * ```tsx
253
- * <Canvas3DErrorBoundary
254
- * onError={(error) => console.error('3D Error:', error)}
255
- * onReset={() => console.log('Resetting...')}
256
- * >
257
- * <GameCanvas3D {...props} />
258
- * </Canvas3DErrorBoundary>
259
- * ```
260
- */
261
- declare class Canvas3DErrorBoundary extends Component<Canvas3DErrorBoundaryProps, Canvas3DErrorBoundaryState> {
262
- constructor(props: Canvas3DErrorBoundaryProps);
263
- static getDerivedStateFromError(error: Error): Canvas3DErrorBoundaryState;
264
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
265
- handleReset: () => void;
266
- render(): ReactNode;
267
- }
268
-
269
- /**
270
- * ModelLoader Component
271
- *
272
- * React Three Fiber component for loading and displaying GLB/GLTF models from URLs.
273
- * Handles loading states and errors without requiring React Suspense.
274
- *
275
- * @packageDocumentation
276
- */
277
-
278
- interface ModelLoaderProps {
279
- /** URL to the GLB/GLTF model */
280
- url: string;
281
- /** Position [x, y, z] */
282
- position?: [number, number, number];
283
- /** Scale - either a single number or [x, y, z] */
284
- scale?: number | [number, number, number];
285
- /** Rotation in degrees [x, y, z] */
286
- rotation?: [number, number, number];
287
- /** Whether the model is selected */
288
- isSelected?: boolean;
289
- /** Whether the model is hovered */
290
- isHovered?: boolean;
291
- /** Click handler */
292
- onClick?: () => void;
293
- /** Hover handler */
294
- onHover?: (hovered: boolean) => void;
295
- /** Fallback geometry type */
296
- fallbackGeometry?: 'box' | 'sphere' | 'cylinder' | 'none';
297
- /**
298
- * Named GLB animation clip to play (e.g. "idle", "walk") — the LOLO state machine
299
- * drives this from the unit's `animation` field. Matched case-insensitively; an
300
- * unknown or absent name leaves the model static (bind pose).
301
- */
302
- animation?: string;
303
- /** Multiply the model's material colors by this CSS color (per-instance; e.g. team tint). */
304
- tint?: string;
305
- /** Enable shadows */
306
- castShadow?: boolean;
307
- /** Receive shadows */
308
- receiveShadow?: boolean;
309
- /**
310
- * Base path for shared resources (textures, materials).
311
- * If not provided, auto-detected from the URL by looking for a `/3d/` segment.
312
- * E.g. "https://host/3d/" so that "Textures/colormap.png" resolves correctly.
313
- */
314
- resourceBasePath?: string;
315
- }
316
- /**
317
- * ModelLoader component for rendering GLB models in React Three Fiber
318
- */
319
- declare function ModelLoader({ url, position, scale, rotation, isSelected, isHovered, onClick, onHover, fallbackGeometry, castShadow, receiveShadow, resourceBasePath, animation, tint, }: ModelLoaderProps): React__default.JSX.Element;
320
-
321
- /**
322
- * AssetLoader
323
- *
324
- * Three.js asset loading manager for 3D models and textures.
325
- * Supports GLB/GLTF (primary), OBJ (fallback), and texture loading.
326
- * Implements caching for performance.
327
- *
328
- * @packageDocumentation
329
- */
330
-
331
- interface LoadedModel {
332
- scene: THREE.Group;
333
- animations: THREE.AnimationClip[];
334
- }
335
- declare class AssetLoader {
336
- private objLoader;
337
- private textureLoader;
338
- private modelCache;
339
- private textureCache;
340
- private loadingPromises;
341
- constructor();
342
- /**
343
- * Load a GLB/GLTF model
344
- * @param url - URL to the .glb or .gltf file
345
- * @returns Promise with loaded model scene and animations
346
- */
347
- loadModel(url: string): Promise<LoadedModel>;
348
- /**
349
- * Load an OBJ model (fallback for non-GLB assets)
350
- * @param url - URL to the .obj file
351
- * @returns Promise with loaded object group
352
- */
353
- loadOBJ(url: string): Promise<THREE.Group>;
354
- /**
355
- * Load a texture
356
- * @param url - URL to the texture image
357
- * @returns Promise with loaded texture
358
- */
359
- loadTexture(url: string): Promise<THREE.Texture>;
360
- /**
361
- * Preload multiple assets
362
- * @param urls - Array of asset URLs to preload
363
- * @returns Promise that resolves when all assets are loaded
364
- */
365
- preload(urls: string[]): Promise<void>;
366
- /**
367
- * Check if a model is cached
368
- * @param url - Model URL
369
- */
370
- hasModel(url: string): boolean;
371
- /**
372
- * Check if a texture is cached
373
- * @param url - Texture URL
374
- */
375
- hasTexture(url: string): boolean;
376
- /**
377
- * Get cached model (throws if not cached)
378
- * @param url - Model URL
379
- */
380
- getModel(url: string): LoadedModel;
381
- /**
382
- * Get cached texture (throws if not cached)
383
- * @param url - Texture URL
384
- */
385
- getTexture(url: string): THREE.Texture;
386
- /**
387
- * Clear all caches
388
- */
389
- clearCache(): void;
390
- /**
391
- * Get cache statistics
392
- */
393
- getStats(): {
394
- models: number;
395
- textures: number;
396
- loading: number;
397
- };
398
- }
399
- declare const assetLoader: AssetLoader;
400
-
401
- type CameraMode = 'isometric' | 'perspective' | 'top-down';
402
- interface UseThreeOptions {
403
- /** Camera mode for viewing the scene */
404
- cameraMode?: CameraMode;
405
- /** Initial camera position [x, y, z] */
406
- cameraPosition?: [number, number, number];
407
- /** Background color */
408
- backgroundColor?: string;
409
- /** Enable shadows */
410
- shadows?: boolean;
411
- /** Enable grid helper */
412
- showGrid?: boolean;
413
- /** Grid size */
414
- gridSize?: number;
415
- /** Asset loader instance */
416
- assetLoader?: AssetLoader;
417
- }
418
- interface UseThreeReturn {
419
- /** Canvas element reference (for React Three Fiber) */
420
- canvasRef: React.RefObject<HTMLCanvasElement | null>;
421
- /** Three.js renderer */
422
- renderer: THREE.WebGLRenderer | null;
423
- /** Three.js scene */
424
- scene: THREE.Scene | null;
425
- /** Three.js camera */
426
- camera: THREE.Camera | null;
427
- /** Orbit controls */
428
- controls: OrbitControls | null;
429
- /** Is scene ready */
430
- isReady: boolean;
431
- /** Canvas dimensions */
432
- dimensions: {
433
- width: number;
434
- height: number;
435
- };
436
- /** Set camera position */
437
- setCameraPosition: (x: number, y: number, z: number) => void;
438
- /** Look at a specific point */
439
- lookAt: (x: number, y: number, z: number) => void;
440
- /** Reset camera to initial position */
441
- resetCamera: () => void;
442
- /** Fit view to bounds */
443
- fitView: (bounds: {
444
- minX: number;
445
- maxX: number;
446
- minZ: number;
447
- maxZ: number;
448
- }) => void;
449
- }
450
- /**
451
- * Hook for managing a Three.js scene
452
- * This is a lower-level hook used by GameCanvas3D
453
- */
454
- declare function useThree(options?: UseThreeOptions): UseThreeReturn;
455
-
456
- interface UseAssetLoaderOptions {
457
- /** URLs to preload on mount */
458
- preloadUrls?: string[];
459
- /** Asset loader instance (uses singleton if not provided) */
460
- loader?: AssetLoader;
461
- }
462
- interface AssetLoadingState {
463
- /** Whether assets are currently loading */
464
- isLoading: boolean;
465
- /** Loading progress (0-100) */
466
- progress: number;
467
- /** Number of loaded assets */
468
- loaded: number;
469
- /** Total assets to load */
470
- total: number;
471
- /** Any loading errors */
472
- errors: string[];
473
- }
474
- interface UseAssetLoaderReturn extends AssetLoadingState {
475
- /** Load a single model */
476
- loadModel: (url: string) => Promise<LoadedModel>;
477
- /** Load a single OBJ model */
478
- loadOBJ: (url: string) => Promise<THREE.Group>;
479
- /** Load a single texture */
480
- loadTexture: (url: string) => Promise<THREE.Texture>;
481
- /** Preload multiple assets */
482
- preload: (urls: string[]) => Promise<void>;
483
- /** Check if model is cached */
484
- hasModel: (url: string) => boolean;
485
- /** Check if texture is cached */
486
- hasTexture: (url: string) => boolean;
487
- /** Get cached model */
488
- getModel: (url: string) => LoadedModel | undefined;
489
- /** Get cached texture */
490
- getTexture: (url: string) => THREE.Texture | undefined;
491
- /** Clear all caches */
492
- clearCache: () => void;
493
- }
494
- /**
495
- * Hook for managing 3D asset loading in React components
496
- *
497
- * @example
498
- * ```tsx
499
- * const { loadModel, isLoading, progress } = useAssetLoader({
500
- * preloadUrls: ['/assets/model.glb']
501
- * });
502
- *
503
- * useEffect(() => {
504
- * loadModel('/assets/character.glb').then((model) => {
505
- * scene.add(model.scene);
506
- * });
507
- * }, []);
508
- * ```
509
- */
510
- declare function useAssetLoader(options?: UseAssetLoaderOptions): UseAssetLoaderReturn;
511
-
512
- type NodeType = 'tile' | 'unit' | 'feature' | 'highlight' | 'effect';
513
- interface SceneGraphNode {
514
- /** Unique node identifier */
515
- id: string;
516
- /** Node type classification */
517
- type: NodeType;
518
- /** Three.js object */
519
- mesh: THREE.Object3D;
520
- /** World position */
521
- position: {
522
- x: number;
523
- y: number;
524
- z: number;
525
- };
526
- /** Grid position */
527
- gridPosition: {
528
- x: number;
529
- z: number;
530
- };
531
- /** Optional metadata */
532
- metadata?: JsonObject;
533
- }
534
- interface UseSceneGraphReturn {
535
- /** Reference to the nodes map */
536
- nodesRef: React.MutableRefObject<Map<string, SceneGraphNode>>;
537
- /** Add a node to the scene */
538
- addNode: (node: SceneGraphNode) => void;
539
- /** Remove a node from the scene */
540
- removeNode: (id: string) => void;
541
- /** Get a node by ID */
542
- getNode: (id: string) => SceneGraphNode | undefined;
543
- /** Update node position */
544
- updateNodePosition: (id: string, x: number, y: number, z: number) => void;
545
- /** Update node grid position */
546
- updateNodeGridPosition: (id: string, gridX: number, gridZ: number) => void;
547
- /** Get node at grid position */
548
- getNodeAtGrid: (x: number, z: number, type?: NodeType) => SceneGraphNode | undefined;
549
- /** Get all nodes of a specific type */
550
- getNodesByType: (type: NodeType) => SceneGraphNode[];
551
- /** Get all nodes within a bounding box */
552
- getNodesInBounds: (minX: number, maxX: number, minZ: number, maxZ: number) => SceneGraphNode[];
553
- /** Clear all nodes */
554
- clearNodes: () => void;
555
- /** Count nodes by type */
556
- countNodes: (type?: NodeType) => number;
557
- }
558
- /**
559
- * Hook for managing the 3D scene graph
560
- *
561
- * @example
562
- * ```tsx
563
- * const { addNode, removeNode, getNodeAtGrid } = useSceneGraph();
564
- *
565
- * // Add a tile
566
- * addNode({
567
- * id: 'tile-0-0',
568
- * type: 'tile',
569
- * mesh: tileMesh,
570
- * position: { x: 0, y: 0, z: 0 },
571
- * gridPosition: { x: 0, z: 0 }
572
- * });
573
- * ```
574
- */
575
- declare function useSceneGraph(): UseSceneGraphReturn;
576
-
577
- interface RaycastHit {
578
- /** Intersected object */
579
- object: THREE.Object3D;
580
- /** Intersection point */
581
- point: THREE.Vector3;
582
- /** Distance from camera */
583
- distance: number;
584
- /** UV coordinates (if available) */
585
- uv?: THREE.Vector2;
586
- /** Face normal */
587
- face?: THREE.Face;
588
- /** Face index */
589
- faceIndex?: number;
590
- /** Instance ID (for instanced meshes) */
591
- instanceId?: number;
592
- }
593
- interface GridHit {
594
- /** Grid X coordinate */
595
- gridX: number;
596
- /** Grid Z coordinate */
597
- gridZ: number;
598
- /** World position */
599
- worldPosition: THREE.Vector3;
600
- /** Intersected object type */
601
- objectType?: 'tile' | 'unit' | 'feature';
602
- /** Object ID if available */
603
- objectId?: string;
604
- }
605
- interface UseRaycasterOptions {
606
- /** Camera reference */
607
- camera: THREE.Camera | null;
608
- /** Canvas element for coordinate conversion */
609
- canvas: HTMLCanvasElement | null;
610
- /** Grid cell size */
611
- cellSize?: number;
612
- /** Grid offset X */
613
- offsetX?: number;
614
- /** Grid offset Z */
615
- offsetZ?: number;
616
- }
617
- interface UseRaycasterReturn {
618
- /** Raycaster instance */
619
- raycaster: React.MutableRefObject<THREE.Raycaster>;
620
- /** Mouse vector instance */
621
- mouse: React.MutableRefObject<THREE.Vector2>;
622
- /** Get intersection at client coordinates */
623
- getIntersection: (clientX: number, clientY: number, objects: THREE.Object3D[]) => RaycastHit | null;
624
- /** Get all intersections at client coordinates */
625
- getAllIntersections: (clientX: number, clientY: number, objects: THREE.Object3D[]) => RaycastHit[];
626
- /** Get grid coordinates at client position */
627
- getGridCoordinates: (clientX: number, clientY: number) => {
628
- x: number;
629
- z: number;
630
- } | null;
631
- /** Get tile at client position from scene */
632
- getTileAtPosition: (clientX: number, clientY: number, scene: THREE.Scene) => GridHit | null;
633
- /** Convert client coordinates to normalized device coordinates */
634
- clientToNDC: (clientX: number, clientY: number) => {
635
- x: number;
636
- y: number;
637
- };
638
- /** Check if point is within canvas bounds */
639
- isWithinCanvas: (clientX: number, clientY: number) => boolean;
640
- }
641
- /**
642
- * Hook for 3D raycasting operations
643
- *
644
- * @example
645
- * ```tsx
646
- * const { getIntersection, getGridCoordinates } = useRaycaster({
647
- * camera,
648
- * canvas: canvasRef.current
649
- * });
650
- *
651
- * const handleClick = (e: MouseEvent) => {
652
- * const hit = getIntersection(e.clientX, e.clientY, tileMeshes);
653
- * if (hit) {
654
- * const grid = getGridCoordinates(e.clientX, e.clientY);
655
- * console.log('Clicked grid:', grid);
656
- * }
657
- * };
658
- * ```
659
- */
660
- declare function useRaycaster(options: UseRaycasterOptions): UseRaycasterReturn;
661
-
662
- interface GameCanvas3DEventConfig {
663
- /** Event name for tile clicks. `tileId` is optional — the neutral draw-host emits
664
- * only the scene coordinate `{ x, z }` (the FSM keys off the cell, not an id). */
665
- tileClickEvent?: EventEmit<{
666
- x: number;
667
- z: number;
668
- tileId?: string;
669
- type?: string;
670
- terrain?: string;
671
- elevation?: number;
672
- }>;
673
- /** Event name for unit clicks */
674
- unitClickEvent?: EventEmit<{
675
- unitId: string;
676
- x: number;
677
- z: number;
678
- unitType?: string;
679
- name?: string;
680
- team?: string;
681
- faction?: string;
682
- health?: number;
683
- maxHealth?: number;
684
- }>;
685
- /** Event name for feature clicks */
686
- featureClickEvent?: EventEmit<{
687
- featureId: string;
688
- x: number;
689
- z: number;
690
- type?: string;
691
- elevation?: number;
692
- }>;
693
- /** Event name for canvas clicks */
694
- canvasClickEvent?: EventEmit<{
695
- clientX: number;
696
- clientY: number;
697
- button: number;
698
- }>;
699
- /** Event name for tile hover */
700
- tileHoverEvent?: EventEmit<{
701
- tileId: string;
702
- x: number;
703
- z: number;
704
- type?: string;
705
- }>;
706
- /** Event name for tile leave */
707
- tileLeaveEvent?: EventEmit<Record<string, never>>;
708
- /** Event name for unit animation changes */
709
- unitAnimationEvent?: EventEmit<{
710
- unitId: string;
711
- state: string;
712
- timestamp: number;
713
- }>;
714
- /** Event name for camera changes */
715
- cameraChangeEvent?: EventEmit<{
716
- position: {
717
- x: number;
718
- y: number;
719
- z: number;
720
- };
721
- timestamp: number;
722
- }>;
723
- }
724
- /** Minimal mouse event interface — satisfied by both React.MouseEvent and ThreeEvent<MouseEvent> */
725
- interface MinimalMouseEvent {
726
- clientX: number;
727
- clientY: number;
728
- button: number;
729
- }
730
- interface UseGameCanvas3DEventsOptions extends GameCanvas3DEventConfig {
731
- /** Callback for tile clicks (direct) */
732
- onTileClick?: (tile: IsometricTile, event: MinimalMouseEvent) => void;
733
- /** Callback for unit clicks (direct) */
734
- onUnitClick?: (unit: IsometricUnit, event: MinimalMouseEvent) => void;
735
- /** Callback for feature clicks (direct) */
736
- onFeatureClick?: (feature: IsometricFeature, event: MinimalMouseEvent) => void;
737
- /** Callback for canvas clicks (direct) */
738
- onCanvasClick?: (event: MinimalMouseEvent) => void;
739
- /** Callback for tile hover (direct) */
740
- onTileHover?: (tile: IsometricTile | null, event: MinimalMouseEvent) => void;
741
- /** Callback for unit animation changes (direct) */
742
- onUnitAnimation?: (unitId: string, state: string) => void;
743
- }
744
- interface UseGameCanvas3DEventsReturn {
745
- /** Handle tile click - emits event and calls callback */
746
- handleTileClick: (tile: IsometricTile, event: MinimalMouseEvent) => void;
747
- /** Handle unit click - emits event and calls callback */
748
- handleUnitClick: (unit: IsometricUnit, event: MinimalMouseEvent) => void;
749
- /** Handle feature click - emits event and calls callback */
750
- handleFeatureClick: (feature: IsometricFeature, event: MinimalMouseEvent) => void;
751
- /** Handle canvas click - emits event and calls callback */
752
- handleCanvasClick: (event: MinimalMouseEvent) => void;
753
- /** Handle tile hover - emits event and calls callback */
754
- handleTileHover: (tile: IsometricTile | null, event: MinimalMouseEvent) => void;
755
- /** Handle unit animation - emits event and calls callback */
756
- handleUnitAnimation: (unitId: string, state: string) => void;
757
- /** Handle camera change - emits event */
758
- handleCameraChange: (position: {
759
- x: number;
760
- y: number;
761
- z: number;
762
- }) => void;
763
- }
764
- /**
765
- * Hook for integrating GameCanvas3D with the event bus
766
- *
767
- * Supports both declarative event props (tileClickEvent) and
768
- * direct callback props (onTileClick).
769
- *
770
- * @example
771
- * ```tsx
772
- * const events = useGameCanvas3DEvents({
773
- * tileClickEvent: 'TILE_SELECTED',
774
- * unitClickEvent: 'UNIT_SELECTED',
775
- * onTileClick: (tile) => console.log('Tile:', tile)
776
- * });
777
- *
778
- * // In component:
779
- * <TileRenderer onTileClick={events.handleTileClick} />
780
- * ```
781
- */
782
- declare function useGameCanvas3DEvents(options: UseGameCanvas3DEventsOptions): UseGameCanvas3DEventsReturn;
783
-
784
- /**
785
- * Grid 3D Utilities
786
- *
787
- * Utility functions for 3D grid coordinate transformations,
788
- * raycasting, and spatial calculations for GameCanvas3D.
789
- *
790
- * @packageDocumentation
791
- */
792
-
793
- interface Grid3DConfig {
794
- /** Size of each grid cell */
795
- cellSize: number;
796
- /** Grid offset X */
797
- offsetX?: number;
798
- /** Grid offset Z */
799
- offsetZ?: number;
800
- /** Grid Y height (elevation) */
801
- elevation?: number;
802
- }
803
- interface GridCoordinate {
804
- x: number;
805
- y: number;
806
- z: number;
807
- }
808
- /**
809
- * Convert grid coordinates to world position
810
- * @param gridX - Grid X coordinate
811
- * @param gridZ - Grid Z coordinate
812
- * @param config - Grid configuration
813
- * @returns World position vector
814
- */
815
- declare function gridToWorld(gridX: number, gridZ: number, config?: Grid3DConfig): THREE.Vector3;
816
- /**
817
- * Convert world position to grid coordinates
818
- * @param worldX - World X position
819
- * @param worldZ - World Z position
820
- * @param config - Grid configuration
821
- * @returns Grid coordinates
822
- */
823
- declare function worldToGrid(worldX: number, worldZ: number, config?: Grid3DConfig): {
824
- x: number;
825
- z: number;
826
- };
827
- /**
828
- * Raycast from camera through mouse position to find grid intersection
829
- * @param camera - Three.js camera
830
- * @param mouseX - Mouse X position (normalized -1 to 1)
831
- * @param mouseY - Mouse Y position (normalized -1 to 1)
832
- * @param planeY - Y height of the intersection plane (default: 0)
833
- * @returns Intersection point or null
834
- */
835
- declare function raycastToPlane(camera: THREE.Camera, mouseX: number, mouseY: number, planeY?: number): THREE.Vector3 | null;
836
- /**
837
- * Raycast from camera through mouse position against a set of objects
838
- * @param camera - Three.js camera
839
- * @param mouseX - Mouse X position (normalized -1 to 1)
840
- * @param mouseY - Mouse Y position (normalized -1 to 1)
841
- * @param objects - Array of objects to test
842
- * @returns First intersection or null
843
- */
844
- declare function raycastToObjects(camera: THREE.Camera, mouseX: number, mouseY: number, objects: THREE.Object3D[]): THREE.Intersection | null;
845
- /**
846
- * Calculate distance between two grid coordinates
847
- * @param a - First grid coordinate
848
- * @param b - Second grid coordinate
849
- * @returns Distance in grid units
850
- */
851
- declare function gridDistance(a: {
852
- x: number;
853
- z: number;
854
- }, b: {
855
- x: number;
856
- z: number;
857
- }): number;
858
- /**
859
- * Calculate Manhattan distance between two grid coordinates
860
- * @param a - First grid coordinate
861
- * @param b - Second grid coordinate
862
- * @returns Manhattan distance
863
- */
864
- declare function gridManhattanDistance(a: {
865
- x: number;
866
- z: number;
867
- }, b: {
868
- x: number;
869
- z: number;
870
- }): number;
871
- /**
872
- * Get neighboring grid cells
873
- * @param x - Center X coordinate
874
- * @param z - Center Z coordinate
875
- * @param includeDiagonal - Whether to include diagonal neighbors
876
- * @returns Array of neighbor coordinates
877
- */
878
- declare function getNeighbors(x: number, z: number, includeDiagonal?: boolean): {
879
- x: number;
880
- z: number;
881
- }[];
882
- /**
883
- * Check if a grid coordinate is within bounds
884
- * @param x - X coordinate
885
- * @param z - Z coordinate
886
- * @param bounds - Bounds object
887
- * @returns Whether the coordinate is within bounds
888
- */
889
- declare function isInBounds(x: number, z: number, bounds: {
890
- minX: number;
891
- maxX: number;
892
- minZ: number;
893
- maxZ: number;
894
- }): boolean;
895
- /**
896
- * Get all grid cells within a circular radius
897
- * @param centerX - Center X coordinate
898
- * @param centerZ - Center Z coordinate
899
- * @param radius - Radius in grid units
900
- * @returns Array of coordinates within radius
901
- */
902
- declare function getCellsInRadius(centerX: number, centerZ: number, radius: number): {
903
- x: number;
904
- z: number;
905
- }[];
906
- /**
907
- * Create a highlight mesh for grid cells
908
- * @param color - Highlight color
909
- * @param opacity - Opacity (0-1)
910
- * @returns Mesh that can be positioned at grid cells
911
- */
912
- declare function createGridHighlight(color?: number, opacity?: number): THREE.Mesh;
913
- /**
914
- * Normalize mouse coordinates to NDC (-1 to 1)
915
- * @param clientX - Mouse client X
916
- * @param clientY - Mouse client Y
917
- * @param element - Canvas element
918
- * @returns Normalized coordinates
919
- */
920
- declare function normalizeMouseCoordinates(clientX: number, clientY: number, element: HTMLElement): {
921
- x: number;
922
- y: number;
923
- };
924
-
925
- /**
926
- * Culling Utilities
927
- *
928
- * Frustum culling and LOD (Level of Detail) management for 3D scene optimization.
929
- *
930
- * @packageDocumentation
931
- */
932
-
933
- interface CullingOptions {
934
- /** Camera frustum for culling */
935
- camera: THREE.Camera;
936
- /** Optional padding around frustum */
937
- padding?: number;
938
- }
939
- interface LODLevel {
940
- /** Distance threshold for this LOD level */
941
- distance: number;
942
- /** Geometry or mesh for this level */
943
- geometry?: THREE.BufferGeometry;
944
- /** Scale multiplier for this level */
945
- scale?: number;
946
- /** Whether to use simplified material */
947
- simpleMaterial?: boolean;
948
- }
949
- interface LODConfig {
950
- /** LOD levels from closest to farthest */
951
- levels: LODLevel[];
952
- /** Transition smoothness (0-1) */
953
- transitionSmoothness?: number;
954
- }
955
- /**
956
- * Frustum culling check for a position
957
- * @param position - World position to check
958
- * @param camera - Camera to check against
959
- * @param padding - Optional padding in world units
960
- * @returns Whether the position is within the frustum
961
- */
962
- declare function isInFrustum(position: THREE.Vector3, camera: THREE.Camera, padding?: number): boolean;
963
- /**
964
- * Filter an array of positions to only those within the frustum
965
- * @param positions - Array of world positions
966
- * @param camera - Camera to check against
967
- * @param padding - Optional padding in world units
968
- * @returns Array of positions within frustum
969
- */
970
- declare function filterByFrustum(positions: THREE.Vector3[], camera: THREE.Camera, padding?: number): THREE.Vector3[];
971
- /**
972
- * Get indices of visible items from an array
973
- * @param positions - Array of world positions
974
- * @param camera - Camera to check against
975
- * @param padding - Optional padding in world units
976
- * @returns Set of visible indices
977
- */
978
- declare function getVisibleIndices(positions: THREE.Vector3[], camera: THREE.Camera, padding?: number): Set<number>;
979
- /**
980
- * Calculate LOD level based on distance from camera
981
- * @param position - Object position
982
- * @param camera - Camera position
983
- * @param lodLevels - Array of distance thresholds (sorted closest to farthest)
984
- * @returns Index of the LOD level to use
985
- */
986
- declare function calculateLODLevel(position: THREE.Vector3, camera: THREE.Camera, lodLevels: number[]): number;
987
- /**
988
- * Create a distance-based LOD system for an instanced mesh
989
- * @param instancedMesh - The instanced mesh to manage
990
- * @param positions - Array of instance positions
991
- * @param camera - Camera to calculate distances from
992
- * @param lodDistances - Distance thresholds for LOD levels
993
- * @returns Array of LOD indices for each instance
994
- */
995
- declare function updateInstanceLOD(instancedMesh: THREE.InstancedMesh, positions: THREE.Vector3[], camera: THREE.Camera, lodDistances: number[]): Uint8Array;
996
- /**
997
- * Create visibility data for instanced mesh culling
998
- * Updates the instance matrix to hide/show instances
999
- * @param instancedMesh - The instanced mesh
1000
- * @param positions - Array of instance positions
1001
- * @param visibleIndices - Set of visible indices
1002
- * @returns Updated count of visible instances
1003
- */
1004
- declare function cullInstancedMesh(instancedMesh: THREE.InstancedMesh, positions: THREE.Vector3[], visibleIndices: Set<number>): number;
1005
- /**
1006
- * Spatial hash grid for efficient object queries
1007
- */
1008
- declare class SpatialHashGrid {
1009
- private cellSize;
1010
- private cells;
1011
- private objectPositions;
1012
- constructor(cellSize?: number);
1013
- /**
1014
- * Get cell key for a position
1015
- */
1016
- private getCellKey;
1017
- /**
1018
- * Insert an object into the grid
1019
- */
1020
- insert(id: string, position: THREE.Vector3): void;
1021
- /**
1022
- * Remove an object from the grid
1023
- */
1024
- remove(id: string): void;
1025
- /**
1026
- * Update an object's position
1027
- */
1028
- update(id: string, newPosition: THREE.Vector3): void;
1029
- /**
1030
- * Query objects within a radius of a position
1031
- */
1032
- queryRadius(center: THREE.Vector3, radius: number): string[];
1033
- /**
1034
- * Query objects within a bounding box
1035
- */
1036
- queryBox(minX: number, maxX: number, minZ: number, maxZ: number): string[];
1037
- /**
1038
- * Clear all objects from the grid
1039
- */
1040
- clear(): void;
1041
- /**
1042
- * Get statistics about the grid
1043
- */
1044
- getStats(): {
1045
- objects: number;
1046
- cells: number;
1047
- };
1048
- }
1049
-
1050
- /**
1051
- * Avl3DViewer - Interactive 3D Orbital Visualization
1052
- *
1053
- * The host organism that owns the R3F Canvas and delegates to 3D scene
1054
- * renderers at each zoom level. The 3D equivalent of AvlCosmicZoom.
1055
- *
1056
- * Reuses avl-schema-parser.ts and avl-zoom-state.ts directly.
1057
- *
1058
- * @packageDocumentation
1059
- */
1060
-
1061
- interface Avl3DViewerProps {
1062
- /** The orbital schema (parsed object or JSON string) */
1063
- schema: OrbitalSchema | string;
1064
- /** CSS class for the outer container */
1065
- className?: string;
1066
- /** Enable animations (default: true) */
1067
- animated?: boolean;
1068
- /** Pre-select an orbital on mount */
1069
- initialOrbital?: string;
1070
- /** Pre-select a trait on mount */
1071
- initialTrait?: string;
1072
- /** Callback when zoom level changes */
1073
- onZoomChange?: (level: ZoomLevel, context: {
1074
- orbital?: string;
1075
- trait?: string;
1076
- }) => void;
1077
- /** Container width */
1078
- width?: number | string;
1079
- /** Container height */
1080
- height?: number | string;
1081
- /** Enable postprocessing effects (bloom, DOF, vignette). Default: true */
1082
- effects?: boolean;
1083
- /** Custom 3D model URLs to replace default primitive geometry */
1084
- modelOverrides?: Avl3DModelOverrides;
1085
- }
1086
- declare const Avl3DViewer: React__default.FC<Avl3DViewerProps>;
1087
-
1088
- /**
1089
- * Avl3DApplicationScene - Galaxy view of all orbitals.
1090
- *
1091
- * Positions orbitals on a golden-ratio spiral and renders cross-orbital
1092
- * event wires between them. The 3D equivalent of AvlApplicationScene.
1093
- *
1094
- * @packageDocumentation
1095
- */
1096
-
1097
- interface Avl3DApplicationSceneProps {
1098
- /** Parsed application-level data */
1099
- data: ApplicationLevelData;
1100
- /** Click handler for an orbital */
1101
- onOrbitalClick?: (orbitalName: string) => void;
1102
- /** Primary color */
1103
- color?: string;
1104
- }
1105
- declare const Avl3DApplicationScene: React__default.FC<Avl3DApplicationSceneProps>;
1106
-
1107
- /**
1108
- * Avl3DOrbitalScene - Solar system view of a single orbital.
1109
- *
1110
- * Renders entity core at center, trait orbit rings, and page portals.
1111
- * The 3D equivalent of AvlOrbitalScene.
1112
- *
1113
- * @packageDocumentation
1114
- */
1115
-
1116
- interface Avl3DOrbitalSceneProps {
1117
- /** Parsed orbital-level data */
1118
- data: OrbitalLevelData;
1119
- /** Click handler for a trait */
1120
- onTraitClick?: (traitName: string) => void;
1121
- /** Currently highlighted trait */
1122
- highlightedTrait?: string | null;
1123
- /** Highlight change handler */
1124
- onTraitHighlight?: (traitName: string | null) => void;
1125
- /** Primary color */
1126
- color?: string;
1127
- }
1128
- declare const Avl3DOrbitalScene: React__default.FC<Avl3DOrbitalSceneProps>;
1129
-
1130
- /**
1131
- * Avl3DTraitScene - 3D state machine view for a single trait.
1132
- *
1133
- * Positions states on a fibonacci sphere and renders transition arcs
1134
- * between them. The 3D equivalent of AvlTraitScene.
1135
- *
1136
- * @packageDocumentation
1137
- */
1138
-
1139
- interface Avl3DTraitSceneProps {
1140
- /** Parsed trait-level data */
1141
- data: TraitLevelData;
1142
- /** Click handler for a transition */
1143
- onTransitionClick?: (transitionIndex: number) => void;
1144
- /** Primary color */
1145
- color?: string;
1146
- }
1147
- declare const Avl3DTraitScene: React__default.FC<Avl3DTraitSceneProps>;
1148
-
1149
- /**
1150
- * Avl3DTransitionScene - 3D expression tree and effect chain view.
1151
- *
1152
- * Renders a detailed view of a single transition with its guard
1153
- * expression tree and effect chain. The 3D equivalent of AvlTransitionScene.
1154
- *
1155
- * @packageDocumentation
1156
- */
1157
-
1158
- interface Avl3DTransitionSceneProps {
1159
- /** Parsed transition-level data */
1160
- data: TransitionLevelData;
1161
- /** Primary color */
1162
- color?: string;
1163
- }
1164
- declare const Avl3DTransitionScene: React__default.FC<Avl3DTransitionSceneProps>;
1165
-
1166
- /**
1167
- * Avl3DEffects - Postprocessing effects and ambient visuals for AVL 3D.
1168
- *
1169
- * Two layers:
1170
- * 1. Ambient visuals (sparkles, starfield) - always rendered via drei
1171
- * 2. Postprocessing (bloom, DOF, vignette) - rendered via @react-three/postprocessing
1172
- *
1173
- * @packageDocumentation
1174
- */
1175
-
1176
- interface Avl3DEffectsProps {
1177
- /** Current zoom level (effects vary by level) */
1178
- level: ZoomLevel;
1179
- /** Enable/disable all effects */
1180
- enabled?: boolean;
1181
- }
1182
- declare const Avl3DEffects: React__default.FC<Avl3DEffectsProps>;
1183
-
1184
- export { AssetLoader, Avl3DApplicationScene, Avl3DEffects, Avl3DModelOverrides, Avl3DOrbitalScene, Avl3DTraitScene, Avl3DTransitionScene, Avl3DViewer, Camera3D, Canvas3DErrorBoundary, Canvas3DLoadingState, Lighting3D, ModelLoader, Scene3D, SpatialHashGrid, assetLoader, calculateLODLevel, createGridHighlight, cullInstancedMesh, filterByFrustum, getCellsInRadius, getNeighbors, getVisibleIndices, gridDistance, gridManhattanDistance, gridToWorld, isInBounds, isInFrustum, normalizeMouseCoordinates, raycastToObjects, raycastToPlane, updateInstanceLOD, useAssetLoader, useGameCanvas3DEvents, useRaycaster, useSceneGraph, useThree, worldToGrid };
1185
- export type { AssetLoadingState, Avl3DApplicationSceneProps, Avl3DEffectsProps, Avl3DOrbitalSceneProps, Avl3DTraitSceneProps, Avl3DTransitionSceneProps, Avl3DViewerProps, Camera3DHandle, Camera3DProps, CameraMode$1 as CameraMode, Canvas3DErrorBoundaryProps, Canvas3DErrorBoundaryState, Canvas3DLoadingStateProps, CullingOptions, GameCanvas3DEventConfig, Grid3DConfig, GridCoordinate, GridHit, LODConfig, LODLevel, Lighting3DProps, LoadedModel, ModelLoaderProps, NodeType, RaycastHit, Scene3DProps, SceneGraphNode, UseAssetLoaderOptions, UseAssetLoaderReturn, UseGameCanvas3DEventsOptions, UseGameCanvas3DEventsReturn, UseRaycasterOptions, UseRaycasterReturn, UseSceneGraphReturn, UseThreeOptions, UseThreeReturn };