@tresjs/core 5.1.0 → 5.1.1

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 (63) hide show
  1. package/dist/chunk-QpvadvMP.js +30 -0
  2. package/dist/template-compiler-options.d.mts +17 -0
  3. package/dist/template-compiler-options.mjs +18 -0
  4. package/dist/tres.d.ts +1056 -0
  5. package/dist/tres.js +2349 -5573
  6. package/package.json +21 -26
  7. package/components.d.ts +0 -1
  8. package/composables.d.ts +0 -1
  9. package/dist/index.d.ts +0 -6
  10. package/dist/src/components/TresCanvas.vue.d.ts +0 -94
  11. package/dist/src/components/index.d.ts +0 -2
  12. package/dist/src/composables/index.d.ts +0 -9
  13. package/dist/src/composables/useCamera/index.d.ts +0 -43
  14. package/dist/src/composables/useCreateRafLoop/index.d.ts +0 -14
  15. package/dist/src/composables/useEventManager/index.d.ts +0 -10
  16. package/dist/src/composables/useGraph/index.d.ts +0 -3
  17. package/dist/src/composables/useLoader/component.vue.d.ts +0 -38
  18. package/dist/src/composables/useLoader/index.d.ts +0 -51
  19. package/dist/src/composables/useLoop/index.d.ts +0 -14
  20. package/dist/src/composables/useRenderer/pixelRatio.d.ts +0 -4
  21. package/dist/src/composables/useRenderer/useRendererManager.d.ts +0 -194
  22. package/dist/src/composables/useSizes/index.d.ts +0 -11
  23. package/dist/src/composables/useTres/index.d.ts +0 -37
  24. package/dist/src/composables/useTresContextProvider/index.d.ts +0 -24
  25. package/dist/src/core/catalogue.d.ts +0 -9
  26. package/dist/src/core/nodeOps.d.ts +0 -4
  27. package/dist/src/core/revision.d.ts +0 -1
  28. package/dist/src/devtools/DevtoolsMessenger.d.ts +0 -53
  29. package/dist/src/devtools/highlight.d.ts +0 -7
  30. package/dist/src/devtools/index.d.ts +0 -2
  31. package/dist/src/devtools/inspectorHandlers.d.ts +0 -60
  32. package/dist/src/devtools/plugin.d.ts +0 -10
  33. package/dist/src/devtools/setupDevtools.d.ts +0 -14
  34. package/dist/src/devtools/types.d.ts +0 -90
  35. package/dist/src/devtools/utils.d.ts +0 -7
  36. package/dist/src/directives/index.d.ts +0 -4
  37. package/dist/src/directives/vDistanceTo.d.ts +0 -6
  38. package/dist/src/directives/vLightHelper.d.ts +0 -6
  39. package/dist/src/directives/vLog.d.ts +0 -6
  40. package/dist/src/index.d.ts +0 -25
  41. package/dist/src/types/index.d.ts +0 -137
  42. package/dist/src/utils/array.d.ts +0 -6
  43. package/dist/src/utils/createPriorityEventHook.d.ts +0 -15
  44. package/dist/src/utils/graph.d.ts +0 -15
  45. package/dist/src/utils/index.d.ts +0 -19
  46. package/dist/src/utils/is/dom.d.ts +0 -1
  47. package/dist/src/utils/is/index.d.ts +0 -4
  48. package/dist/src/utils/is/three.d.ts +0 -162
  49. package/dist/src/utils/is/tres.d.ts +0 -70
  50. package/dist/src/utils/is/typed.d.ts +0 -1
  51. package/dist/src/utils/is/util.d.ts +0 -1
  52. package/dist/src/utils/logger.d.ts +0 -25
  53. package/dist/src/utils/makeMap.d.ts +0 -9
  54. package/dist/src/utils/normalize.d.ts +0 -17
  55. package/dist/src/utils/perf.d.ts +0 -7
  56. package/dist/src/utils/pointerEvents.d.ts +0 -10
  57. package/dist/src/utils/primitive/createRetargetingProxy.d.ts +0 -1
  58. package/dist/src/utils/string.d.ts +0 -1
  59. package/dist/src/utils/template-compiler-options.d.ts +0 -8
  60. package/dist/src/utils/test-utils.d.ts +0 -2
  61. package/dist/src/utils/three.d.ts +0 -9
  62. package/types.d.ts +0 -1
  63. package/utils.d.ts +0 -1
package/dist/tres.d.ts ADDED
@@ -0,0 +1,1056 @@
1
+ /**
2
+ * name: @tresjs/core
3
+ * version: v5.1.1
4
+ * (c) 2025
5
+ * description: Declarative ThreeJS using Vue Components
6
+ * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
+ */
8
+ import * as vue0 from "vue";
9
+ import { App, ComputedRef, DefineComponent, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef, VNode, VNodeRef } from "vue";
10
+ import * as THREE from "three";
11
+ import { BufferGeometry, Camera, Color, ColorRepresentation, ColorSpace, Event, Fog, Group, Layers, Light, Loader, LoadingManager, Material, Mesh, Object3D, Object3DEventMap, OrthographicCamera, PerspectiveCamera, Scene, ShadowMapType, ToneMapping, Vector3, WebGLRenderer } from "three";
12
+ import * as _vueuse_core0 from "@vueuse/core";
13
+ import { EventHookOff, MaybeRef as MaybeRef$1, UseAsyncStateOptions, UseAsyncStateReturn } from "@vueuse/core";
14
+ import { PointerEvent, PointerEventsMap } from "@pmndrs/pointer-events";
15
+ import { Renderer } from "three/webgpu";
16
+
17
+ //#region src/composables/useLoader/index.d.ts
18
+ interface LoaderMethods {
19
+ setDRACOLoader: (dracoLoader: any) => void;
20
+ setMeshoptDecoder: (meshoptDecoder: any) => void;
21
+ setKTX2Loader: (ktx2Loader: any) => void;
22
+ }
23
+ type TresLoader<T> = Loader & Partial<LoaderMethods> & {
24
+ load: (url: string, onLoad: (result: T) => void, onProgress?: (event: ProgressEvent<EventTarget>) => void, onError?: (err: unknown) => void) => void;
25
+ loadAsync: (url: string, onProgress?: (event: ProgressEvent) => void) => Promise<T>;
26
+ };
27
+ type LoaderProto<T> = new (manager?: LoadingManager) => TresLoader<T>;
28
+ interface TresLoaderOptions<T, Shallow extends boolean> {
29
+ manager?: LoadingManager;
30
+ extensions?: (loader: TresLoader<T>) => void;
31
+ initialValue?: T;
32
+ asyncOptions?: UseAsyncStateOptions<Shallow, any | null>;
33
+ }
34
+ /**
35
+ * Return type for the useLoader composable
36
+ * @template T - The type of the loaded asset (e.g., GLTF, Texture, etc.)
37
+ * @template Shallow - Whether to use shallow reactivity for better performance
38
+ * @extends {UseAsyncStateReturn<T, [string], Shallow>} - Extends VueUse's useAsyncState return type
39
+ */
40
+ type UseLoaderReturn<T, Shallow extends boolean> = UseAsyncStateReturn<T, [string], Shallow> & {
41
+ /**
42
+ * Loads a new asset from the given path
43
+ * @param path - The URL or path to the asset to load
44
+ */
45
+ load: (path: string) => void;
46
+ /**
47
+ * Progress of the loading process
48
+ * @property loaded - The number of bytes loaded
49
+ * @property total - The total number of bytes to load
50
+ * @property percentage - The percentage of the loading process
51
+ */
52
+ progress: {
53
+ loaded: number;
54
+ total: number;
55
+ percentage: number;
56
+ };
57
+ };
58
+ /**
59
+ * Vue composable for loading 3D models using Three.js loaders
60
+ * @param Loader - The Three.js loader constructor
61
+ * @param path - The path to the model file
62
+ * @param options - Optional configuration for the loader
63
+ * @returns UseAsyncState composable with the loaded model
64
+ */
65
+ declare function useLoader<T, Shallow extends boolean = false>(Loader: LoaderProto<T>, path: MaybeRef<string>, options?: TresLoaderOptions<T, Shallow>): UseLoaderReturn<T, Shallow>;
66
+ //#endregion
67
+ //#region src/composables/useCreateRafLoop/index.d.ts
68
+ interface RafLoopContext {
69
+ delta: number;
70
+ elapsed: number;
71
+ }
72
+ //#endregion
73
+ //#region src/composables/useSizes/index.d.ts
74
+ interface SizesType {
75
+ height: Readonly<Ref<number>>;
76
+ width: Readonly<Ref<number>>;
77
+ aspectRatio: ComputedRef<number>;
78
+ }
79
+ //#endregion
80
+ //#region src/composables/useCamera/index.d.ts
81
+ /**
82
+ * Interface for the return value of the useCamera composable
83
+ */
84
+ interface UseCameraReturn {
85
+ activeCamera: ComputedRef<TresCamera>;
86
+ /**
87
+ * The list of cameras
88
+ */
89
+ cameras: Ref<TresCamera[]>;
90
+ /**
91
+ * Register a camera
92
+ * @param camera - The camera to register
93
+ * @param active - Whether to set the camera as active
94
+ */
95
+ registerCamera: (camera: TresCamera, active?: boolean) => void;
96
+ /**
97
+ * Deregister a camera
98
+ * @param camera - The camera to deregister
99
+ */
100
+ deregisterCamera: (camera: TresCamera) => void;
101
+ /**
102
+ * Set the active camera
103
+ * @param cameraOrUuid - The camera or its UUID to set as active
104
+ */
105
+ setActiveCamera: (cameraOrUuid: string | TresCamera) => void;
106
+ }
107
+ /**
108
+ * Interface for the parameters of the useCamera composable
109
+ */
110
+ interface UseCameraParams {
111
+ sizes: TresContext['sizes'];
112
+ }
113
+ /**
114
+ * Composable for managing cameras in a Three.js scene
115
+ * @param params - The parameters for the composable
116
+ * @param params.sizes - The sizes object containing window dimensions
117
+ * @returns The camera management functions and state
118
+ */
119
+ declare const useCameraManager: ({
120
+ sizes
121
+ }: UseCameraParams) => UseCameraReturn;
122
+ //#endregion
123
+ //#region src/composables/useRenderer/useRendererManager.d.ts
124
+ /**
125
+ * If set to 'on-demand', the scene will only be rendered when the current frame is invalidated
126
+ * If set to 'manual', the scene will only be rendered when advance() is called
127
+ * If set to 'always', the scene will be rendered every frame
128
+ */
129
+ type RenderMode = 'always' | 'on-demand' | 'manual';
130
+ type RenderFunction = (notifySuccess: () => void) => void;
131
+ type TresRenderer = WebGLRenderer | Renderer;
132
+ interface RendererOptions {
133
+ /**
134
+ * WebGL Context options (Readonly because they are passed to the renderer constructor)
135
+ * They can't be changed after the renderer is created because they are passed to the canvas context
136
+ */
137
+ antialias?: boolean;
138
+ /**
139
+ * Enables stencil buffer with 8 bits.
140
+ * Required for stencil-based operations like shadow volumes or post-processing effects.
141
+ * @readonly
142
+ * @default true
143
+ */
144
+ stencil?: boolean;
145
+ /**
146
+ * Enables depth buffer with at least 16 bits.
147
+ * Required for proper 3D rendering and depth testing.
148
+ * @readonly
149
+ * @default true
150
+ */
151
+ depth?: boolean;
152
+ /**
153
+ * Sets the shader precision of the renderer.
154
+ * @see {@link https://threejs.org/docs/#api/en/renderers/WebGLRenderer}
155
+ * @default 'highp'
156
+ */
157
+ precision?: 'highp' | 'mediump' | 'lowp';
158
+ /**
159
+ * Enables logarithmic depth buffer. Useful for scenes with large differences in scale.
160
+ * Helps prevent z-fighting in scenes with objects very close and very far from the camera.
161
+ * @readonly
162
+ * @default false
163
+ */
164
+ logarithmicDepthBuffer?: boolean;
165
+ /**
166
+ * Preserves the buffers until manually cleared or overwritten.
167
+ * Needed for screenshots or when reading pixels from the canvas.
168
+ * Warning: This may impact performance.
169
+ * @readonly
170
+ * @default false
171
+ */
172
+ preserveDrawingBuffer?: boolean;
173
+ /**
174
+ * Power preference for the renderer.
175
+ * Power preference for the renderer.
176
+ * - `default`: Automatically chooses the most suitable power setting.
177
+ * - `high-performance`: Prioritizes rendering performance.
178
+ * - `low-power`: Tries to reduce power usage.
179
+ * @see {@link https://threejs.org/docs/#api/en/renderers/WebGLRenderer}
180
+ * @default 'default'
181
+ * @readonly
182
+ */
183
+ powerPreference?: WebGLPowerPreference;
184
+ /**
185
+ * Whether to create the WebGL context with an alpha buffer.
186
+ * This is a WebGL context option that must be set during context creation and cannot be changed later.
187
+ * When true, the canvas can be transparent, showing content behind it.
188
+ * @readonly
189
+ * @default false
190
+ */
191
+ alpha?: boolean;
192
+ /**
193
+ * Whether to premultiply the alpha of the canvas.
194
+ * @see {@link https://threejs.org/docs/#api/en/renderers/WebGLRenderer}
195
+ * @default true
196
+ */
197
+ premultipliedAlpha?: boolean;
198
+ /**
199
+ * Whether to fail if the major performance caveat is detected.
200
+ * @see {@link https://threejs.org/docs/#api/en/renderers/WebGLRenderer}
201
+ * @default false
202
+ */
203
+ failIfMajorPerformanceCaveat?: boolean;
204
+ /**
205
+ * WebGL options with set methods
206
+ * @see {@link https://threejs.org/docs/#api/en/renderers/WebGLRenderer}
207
+ */
208
+ /**
209
+ * Clear color for the canvas
210
+ * Can include alpha value (e.g. '#00808000' for fully transparent teal)
211
+ */
212
+ clearColor?: ColorRepresentation;
213
+ /**
214
+ * The opacity of the clear color (0-1)
215
+ * Controls the transparency of the clear color
216
+ * @default 1
217
+ */
218
+ clearAlpha?: number;
219
+ /**
220
+ * Enable shadow rendering in the scene
221
+ * @default false
222
+ */
223
+ shadows?: boolean;
224
+ /**
225
+ * Tone mapping technique to use for the scene
226
+ * - `NoToneMapping`: No tone mapping is applied.
227
+ * - `LinearToneMapping`: Linear tone mapping.
228
+ * - `ReinhardToneMapping`: Reinhard tone mapping.
229
+ * - `CineonToneMapping`: Cineon tone mapping.
230
+ * - `ACESFilmicToneMapping`: ACES Filmic tone mapping.
231
+ * - `AgXToneMapping`: AgX tone mapping.
232
+ * - `NeutralToneMapping`: Neutral tone mapping.
233
+ * @see {@link https://threejs.org/docs/#api/en/constants/Renderer}
234
+ * @default ACESFilmicToneMapping (Opinionated default by TresJS)
235
+ */
236
+ toneMapping?: ToneMapping;
237
+ /**
238
+ * Type of shadow map to use for shadow calculations
239
+ * - `BasicShadowMap`: Basic shadow map.
240
+ * - `PCFShadowMap`: Percentage-Closer Filtering shadow map.
241
+ * - `PCFSoftShadowMap`: Percentage-Closer Filtering soft shadow map.
242
+ * - `VSMShadowMap`: Variance shadow map.
243
+ * @see {@link https://threejs.org/docs/#api/en/constants/Renderer}
244
+ * @default PCFSoftShadowMap (Opinionated default by TresJS)
245
+ */
246
+ shadowMapType?: ShadowMapType;
247
+ /**
248
+ * Whether to use legacy lights system instead of the new one
249
+ * @deprecated Use `useLegacyLights: false` for the new lighting system
250
+ */
251
+ useLegacyLights?: boolean;
252
+ /**
253
+ * Color space for the output render
254
+ * @see {@link https://threejs.org/docs/#api/en/constants/Renderer}
255
+ */
256
+ outputColorSpace?: ColorSpace;
257
+ /**
258
+ * Exposure level of tone mapping
259
+ * @default 1
260
+ */
261
+ toneMappingExposure?: number;
262
+ /**
263
+ * Rendering mode for the canvas
264
+ * - 'always': Renders every frame
265
+ * - 'on-demand': Renders only when changes are detected
266
+ * - 'manual': Renders only when explicitly called
267
+ * @default 'always'
268
+ */
269
+ renderMode?: 'always' | 'on-demand' | 'manual';
270
+ /**
271
+ * Device Pixel Ratio for the renderer
272
+ * Can be a single number or a tuple defining a range [min, max]
273
+ */
274
+ dpr?: number | [number, number];
275
+ /**
276
+ * Custom WebGL renderer instance
277
+ * Allows using a pre-configured renderer instead of creating a new one
278
+ */
279
+ renderer?: (ctx: TresRendererSetupContext) => TresRenderer;
280
+ }
281
+ interface TresRendererSetupContext {
282
+ sizes: SizesType;
283
+ scene: ShallowRef<TresScene>;
284
+ camera: UseCameraReturn;
285
+ canvas: MaybeRef<HTMLCanvasElement>;
286
+ }
287
+ interface UseRendererOptions {
288
+ scene: ShallowRef<TresScene>;
289
+ canvas: MaybeRef<HTMLCanvasElement>;
290
+ options: Reactive<RendererOptions>;
291
+ contextParts: Pick<TresContext, 'sizes' | 'camera'>;
292
+ }
293
+ declare function useRendererManager({
294
+ scene,
295
+ canvas,
296
+ options,
297
+ contextParts: {
298
+ sizes,
299
+ camera
300
+ }
301
+ }: UseRendererOptions): {
302
+ loop: {
303
+ start: () => void;
304
+ stop: () => void;
305
+ isActive: Readonly<ShallowRef<boolean>>;
306
+ onBeforeLoop: _vueuse_core0.EventHookOn<RafLoopContext>;
307
+ onLoop: _vueuse_core0.EventHookOn<RafLoopContext>;
308
+ };
309
+ instance: TresRenderer;
310
+ advance: () => void;
311
+ onReady: _vueuse_core0.EventHookOn<TresRenderer>;
312
+ onRender: _vueuse_core0.EventHookOn<TresRenderer>;
313
+ invalidate: (amountOfFramesToInvalidate?: number) => void;
314
+ canBeInvalidated: vue0.ComputedRef<boolean>;
315
+ mode: "always" | "on-demand" | "manual" | undefined;
316
+ replaceRenderFunction: (fn: RenderFunction) => void;
317
+ };
318
+ type UseRendererManagerReturn = ReturnType<typeof useRendererManager>;
319
+ //#endregion
320
+ //#region src/composables/useEventManager/index.d.ts
321
+ declare function useEventManager({
322
+ canvas,
323
+ contextParts: {
324
+ scene,
325
+ camera,
326
+ renderer
327
+ }
328
+ }: {
329
+ canvas: MaybeRef<HTMLCanvasElement>;
330
+ contextParts: Pick<TresContext, 'scene' | 'camera' | 'renderer'>;
331
+ }): {
332
+ onPointerMissed: _vueuse_core0.EventHookOn<PointerEvent<MouseEvent> & Event<"click", Object3D<Object3DEventMap & PointerEventsMap>>>;
333
+ };
334
+ //#endregion
335
+ //#region src/composables/useTresContextProvider/index.d.ts
336
+ interface TresContext {
337
+ scene: ShallowRef<TresScene>;
338
+ sizes: SizesType;
339
+ extend: (objects: any) => void;
340
+ camera: UseCameraReturn;
341
+ controls: Ref<TresControl | null>;
342
+ renderer: UseRendererManagerReturn;
343
+ events: ReturnType<typeof useEventManager>;
344
+ }
345
+ declare const useTresContextProvider: (args_0: {
346
+ scene: TresScene;
347
+ canvas: MaybeRef<HTMLCanvasElement>;
348
+ windowSize: MaybeRefOrGetter<boolean>;
349
+ rendererOptions: RendererOptions;
350
+ }) => TresContext;
351
+ declare const useTresContext: () => TresContext;
352
+ //#endregion
353
+ //#region src/utils/pointerEvents.d.ts
354
+ declare const supportedPointerEvents: readonly ["onClick", "onContextmenu", "onPointermove", "onPointerenter", "onPointerleave", "onPointerover", "onPointerout", "onDblclick", "onPointerdown", "onPointerup", "onPointercancel", "onLostpointercapture", "onWheel"];
355
+ type SupportedVuePointerEvent = typeof supportedPointerEvents[number];
356
+ type TresPointerEvent = PointerEvent<MouseEvent>;
357
+ type PointerEventHandlers = { [key in SupportedVuePointerEvent]: (event: TresPointerEvent) => void };
358
+ //#endregion
359
+ //#region src/types/index.d.ts
360
+ type AttachFnType = (parent: any, self: TresInstance) => () => void;
361
+ type AttachType = string | AttachFnType;
362
+ type DisposeType = ((self: TresInstance) => void) | boolean | 'default';
363
+ type ConstructorRepresentation = new (...args: any[]) => any;
364
+ type NonFunctionKeys<P> = { [K in keyof P]-?: P[K] extends ((...args: any[]) => any) ? never : K }[keyof P];
365
+ type Overwrite<P, O> = Omit<P, NonFunctionKeys<O>> & O;
366
+ type Properties<T> = Pick<T, NonFunctionKeys<T>>;
367
+ type Mutable<P> = { [K in keyof P]: P[K] | Readonly<P[K]> };
368
+ type Args<T> = T extends ConstructorRepresentation ? ConstructorParameters<T> : any[];
369
+ interface TresCatalogue {
370
+ [name: string]: ConstructorRepresentation;
371
+ }
372
+ type TresCamera = THREE.OrthographicCamera | THREE.PerspectiveCamera;
373
+ /**
374
+ * Represents the properties of an instance.
375
+ *
376
+ * @template T - The type of the object.
377
+ * @template P - The type of the arguments.
378
+ */
379
+ interface InstanceProps<T = any, P = any> {
380
+ args?: Args<P>;
381
+ object?: T;
382
+ visible?: boolean;
383
+ dispose?: null;
384
+ attach?: AttachType;
385
+ }
386
+ interface TresBaseObject {
387
+ removeFromParent?: () => void;
388
+ dispose?: () => void;
389
+ [prop: string]: any;
390
+ }
391
+ interface LocalState {
392
+ type: string;
393
+ root: TresContext;
394
+ memoizedProps: {
395
+ [key: string]: any;
396
+ };
397
+ objects: TresObject[];
398
+ parent: TresObject | null;
399
+ primitive?: boolean;
400
+ dispose?: DisposeType;
401
+ attach?: AttachType;
402
+ previousAttach: any;
403
+ }
404
+ interface TresObject3D extends THREE.Object3D<THREE.Object3DEventMap> {
405
+ geometry?: THREE.BufferGeometry & TresBaseObject;
406
+ material?: THREE.Material & TresBaseObject;
407
+ }
408
+ type TresObject = TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.Material | THREE.Fog) & {
409
+ __tres?: LocalState;
410
+ };
411
+ /**
412
+ * Union type covering all common Three.js material types
413
+ * This provides better TypeScript intellisense and type checking
414
+ * when accessing specific material properties
415
+ */
416
+ type TresMaterial = THREE.MeshBasicMaterial | THREE.MeshStandardMaterial | THREE.MeshPhysicalMaterial | THREE.MeshLambertMaterial | THREE.MeshPhongMaterial | THREE.MeshToonMaterial | THREE.MeshNormalMaterial | THREE.MeshMatcapMaterial | THREE.MeshDepthMaterial | THREE.MeshDistanceMaterial | THREE.LineBasicMaterial | THREE.LineDashedMaterial | THREE.PointsMaterial | THREE.SpriteMaterial | THREE.ShaderMaterial | THREE.RawShaderMaterial | THREE.ShadowMaterial | THREE.Material;
417
+ type TresInstance = TresObject & {
418
+ __tres: LocalState;
419
+ };
420
+ type TresPrimitive = TresInstance & {
421
+ object: TresInstance;
422
+ isPrimitive: true;
423
+ };
424
+ interface TresScene extends THREE.Scene {
425
+ __tres: {
426
+ root: TresContext;
427
+ };
428
+ }
429
+ interface MathRepresentation {
430
+ set(...args: number[] | [THREE.ColorRepresentation]): any;
431
+ }
432
+ interface VectorRepresentation extends MathRepresentation {
433
+ setScalar(s: number): any;
434
+ }
435
+ interface VectorCoordinates {
436
+ x: number;
437
+ y: number;
438
+ z: number;
439
+ }
440
+ type MathType<T extends MathRepresentation | THREE.Euler> = T extends THREE.Color ? ConstructorParameters<typeof THREE.Color> | THREE.ColorRepresentation : T extends VectorRepresentation | THREE.Layers | THREE.Euler ? T | Parameters<T['set']> | number | VectorCoordinates : T | Parameters<T['set']>;
441
+ type VectorLike$1<VectorClass extends THREE.Vector2 | THREE.Vector3 | THREE.Vector4> = VectorClass | Parameters<VectorClass['set']> | Readonly<Parameters<VectorClass['set']>> | Parameters<VectorClass['setScalar']>[0];
442
+ type TresVector2 = VectorLike$1<THREE.Vector2>;
443
+ type TresVector3 = VectorLike$1<THREE.Vector3>;
444
+ type TresVector4 = VectorLike$1<THREE.Vector4>;
445
+ type TresColor = ConstructorParameters<typeof THREE.Color> | THREE.Color | number | string;
446
+ type TresColorArray = typeof THREE.Color | [color: THREE.ColorRepresentation];
447
+ type TresLayers = THREE.Layers | Parameters<THREE.Layers['set']>[0];
448
+ type TresQuaternion = THREE.Quaternion | Parameters<THREE.Quaternion['set']>;
449
+ type TresEuler = THREE.Euler;
450
+ type TresControl = THREE.EventDispatcher & {
451
+ enabled: boolean;
452
+ };
453
+ type TresContextWithClock = TresContext & {
454
+ delta: number;
455
+ elapsed: number;
456
+ };
457
+ type WithMathProps<P> = { [K in keyof P]: P[K] extends MathRepresentation | THREE.Euler ? MathType<P[K]> : P[K] };
458
+ interface RaycastableRepresentation {
459
+ raycast: (raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) => void;
460
+ }
461
+ type EventProps<P> = P extends RaycastableRepresentation ? Partial<PointerEventHandlers> : unknown;
462
+ interface VueProps {
463
+ children?: VNode[];
464
+ ref?: VNodeRef;
465
+ key?: string | number | symbol;
466
+ }
467
+ type ElementProps<T extends ConstructorRepresentation, P = InstanceType<T>> = Partial<Overwrite<P, WithMathProps<P> & VueProps & EventProps<P>>>;
468
+ type ThreeElement<T extends ConstructorRepresentation> = Mutable<Overwrite<ElementProps<T>, Omit<InstanceProps<InstanceType<T>, T>, 'object'>>>;
469
+ type ThreeExports = typeof THREE;
470
+ type ThreeInstancesImpl = { [K in keyof ThreeExports as Uncapitalize<K>]: ThreeExports[K] extends ConstructorRepresentation ? ThreeElement<ThreeExports[K]> : never };
471
+ interface ThreeInstances extends ThreeInstancesImpl {
472
+ primitive: Omit<ThreeElement<any>, 'args'> & {
473
+ object: object;
474
+ };
475
+ }
476
+ type TresComponents = { [K in keyof ThreeInstances as `Tres${Capitalize<string & K>}`]: DefineComponent<ThreeInstances[K]> };
477
+ declare module 'vue' {
478
+ interface GlobalComponents extends TresComponents {
479
+ primitive: DefineComponent<TresPrimitive>;
480
+ }
481
+ }
482
+ //#endregion
483
+ //#region src/utils/graph.d.ts
484
+ interface TresObjectMap {
485
+ nodes: {
486
+ [name: string]: TresObject;
487
+ };
488
+ materials: {
489
+ [name: string]: TresMaterial;
490
+ };
491
+ meshes: {
492
+ [name: string]: Mesh;
493
+ };
494
+ scene?: Scene;
495
+ }
496
+ declare function buildGraph(object: Object3D | TresObject): TresObjectMap;
497
+ //#endregion
498
+ //#region src/composables/useLoader/component.vue.d.ts
499
+ declare const __VLS_export$1: <T extends TresObjectMap>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
500
+ props: __VLS_PrettifyLocal<{
501
+ /**
502
+ * The THREE.js loader to use
503
+ */
504
+ loader: LoaderProto<T>;
505
+ /**
506
+ * Path to resource
507
+ */
508
+ path: string;
509
+ /**
510
+ * Optional THREE.js LoadingManager
511
+ */
512
+ manager?: LoadingManager;
513
+ } & {
514
+ onLoaded?: ((result: T) => any) | undefined;
515
+ onError?: ((error: unknown) => any) | undefined;
516
+ }> & vue0.PublicProps;
517
+ expose: (exposed: {}) => void;
518
+ attrs: any;
519
+ slots: {
520
+ default?: (props: {
521
+ state: vue0.UnwrapRef<T>;
522
+ isLoading: boolean;
523
+ error: unknown;
524
+ }) => any;
525
+ };
526
+ emit: ((evt: "loaded", result: T) => void) & ((evt: "error", error: unknown) => void);
527
+ }>) => vue0.VNode & {
528
+ __ctx?: Awaited<typeof __VLS_setup>;
529
+ };
530
+ declare const _default$1: typeof __VLS_export$1;
531
+ type __VLS_PrettifyLocal<T> = { [K in keyof T as K]: T[K] } & {};
532
+ //#endregion
533
+ //#region src/composables/useGraph/index.d.ts
534
+ declare const useGraph: (object: MaybeRef$1<TresObject | undefined>) => vue0.ComputedRef<TresObjectMap | undefined>;
535
+ //#endregion
536
+ //#region src/utils/createPriorityEventHook.d.ts
537
+ type Callback<T> = Parameters<EventHookOff<T>>[0];
538
+ type PriorityEventHookOn<T> = (fn: Callback<T>, priority?: number) => {
539
+ off: () => void;
540
+ };
541
+ //#endregion
542
+ //#region src/composables/useTres/index.d.ts
543
+ interface TresPartialContext extends Omit<TresContext, 'renderer' | 'camera'> {
544
+ /**
545
+ * The renderer instance
546
+ *
547
+ * @type {TresRenderer}
548
+ * @memberof TresPartialContext
549
+ */
550
+ renderer: TresRenderer;
551
+ /**
552
+ * The current active camera
553
+ *
554
+ * @type {ComputedRef<Camera | undefined>}
555
+ * @memberof TresPartialContext
556
+ */
557
+ camera: ComputedRef<Camera | undefined>;
558
+ /**
559
+ * Marks the scene as needing an update in the next frame.
560
+ * This is used in on-demand rendering mode to schedule a render.
561
+ *
562
+ * @type {() => void}
563
+ * @memberof TresPartialContext
564
+ */
565
+ invalidate: () => void;
566
+ /**
567
+ * Manually advances the render loop by one frame.
568
+ * This is particularly useful in manual rendering mode where you want explicit control over when frames are rendered.
569
+ *
570
+ * @type {() => void}
571
+ * @memberof TresPartialContext
572
+ */
573
+ advance: () => void;
574
+ }
575
+ declare function useTres(): TresPartialContext;
576
+ //#endregion
577
+ //#region src/composables/useLoop/index.d.ts
578
+ type LoopContext = RafLoopContext & TresPartialContext;
579
+ /**
580
+ * Composable that provides control over the render loop and animation lifecycle.
581
+ */
582
+ declare const useLoop: () => {
583
+ stop: () => void;
584
+ start: () => void;
585
+ isActive: Readonly<vue0.ShallowRef<boolean>>;
586
+ onBeforeRender: PriorityEventHookOn<LoopContext>;
587
+ onRender: PriorityEventHookOn<LoopContext>;
588
+ render: (fn: RenderFunction) => void;
589
+ };
590
+ //#endregion
591
+ //#region src/utils/logger.d.ts
592
+ /**
593
+ * Logger utility for TresJS
594
+ * @module logger
595
+ */
596
+ declare const isProd: boolean;
597
+ type OneOrMore<T> = {
598
+ 0: T;
599
+ } & Array<T>;
600
+ /**
601
+ * Logs an error message with the TresJS prefix
602
+ * @param args - Arguments to log
603
+ */
604
+ declare function logError(...args: OneOrMore<any>): void;
605
+ /**
606
+ * Logs a warning message with the TresJS prefix
607
+ * @param args - Arguments to log
608
+ */
609
+ declare function logWarning(...args: OneOrMore<any>): void;
610
+ /**
611
+ * Logs a message with the TresJS prefix (only in development mode)
612
+ * @param name - Name of the message
613
+ * @param value - Value to log
614
+ */
615
+ declare function logMessage(name: string, value: any): void;
616
+ //#endregion
617
+ //#region src/utils/index.d.ts
618
+ declare function disposeObject3D(object: TresObject): void;
619
+ //#endregion
620
+ //#region src/utils/normalize.d.ts
621
+ interface Vector2PropInterface {
622
+ x?: number;
623
+ y?: number;
624
+ width?: number;
625
+ height?: number;
626
+ }
627
+ interface Vector3PropInterface extends Vector2PropInterface {
628
+ z?: number;
629
+ }
630
+ type VectorFlexibleParams = Vector3 | number[] | Vector3PropInterface | number;
631
+ declare function normalizeVectorFlexibleParam(value: VectorFlexibleParams): Array<number>;
632
+ declare function normalizeColor(value: Color | Array<number> | string | number | ColorRepresentation): Color;
633
+ //#endregion
634
+ //#region src/utils/template-compiler-options.d.ts
635
+ declare const templateCompilerOptions: {
636
+ template: {
637
+ compilerOptions: {
638
+ isCustomElement: (tag: string) => boolean;
639
+ };
640
+ };
641
+ };
642
+ //#endregion
643
+ //#region src/components/TresCanvas.vue.d.ts
644
+ interface TresCanvasProps extends RendererOptions {
645
+ /**
646
+ * Custom camera instance to use as main camera
647
+ * If not provided, a default PerspectiveCamera will be created
648
+ */
649
+ camera?: TresCamera;
650
+ /**
651
+ * Whether the canvas should be sized to the window
652
+ * When true, canvas will be fixed positioned and full viewport size
653
+ * @default false
654
+ */
655
+ windowSize?: boolean;
656
+ /**
657
+ * Whether to enable the provide/inject bridge between Vue and TresJS
658
+ * When true, Vue's provide/inject will work across the TresJS boundary
659
+ * @default true
660
+ */
661
+ enableProvideBridge?: boolean;
662
+ }
663
+ declare const __VLS_export: __VLS_WithSlots<vue0.DefineComponent<TresCanvasProps, {
664
+ context: vue0.ShallowRef<TresContext | null, TresContext | null>;
665
+ dispose: () => void;
666
+ }, {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {
667
+ click: (event: PointerEvent<MouseEvent>) => any;
668
+ contextmenu: (event: PointerEvent<MouseEvent>) => any;
669
+ pointermove: (event: PointerEvent<MouseEvent>) => any;
670
+ pointerenter: (event: PointerEvent<MouseEvent>) => any;
671
+ pointerleave: (event: PointerEvent<MouseEvent>) => any;
672
+ pointerover: (event: PointerEvent<MouseEvent>) => any;
673
+ pointerout: (event: PointerEvent<MouseEvent>) => any;
674
+ dblclick: (event: PointerEvent<MouseEvent>) => any;
675
+ pointerdown: (event: PointerEvent<MouseEvent>) => any;
676
+ pointerup: (event: PointerEvent<MouseEvent>) => any;
677
+ pointercancel: (event: PointerEvent<MouseEvent>) => any;
678
+ lostpointercapture: (event: PointerEvent<MouseEvent>) => any;
679
+ wheel: (event: PointerEvent<MouseEvent>) => any;
680
+ ready: (context: TresContext) => any;
681
+ pointermissed: (event: PointerEvent<MouseEvent>) => any;
682
+ render: (context: TresContext) => any;
683
+ beforeLoop: (context: TresContextWithClock) => any;
684
+ loop: (context: TresContextWithClock) => any;
685
+ }, string, vue0.PublicProps, Readonly<TresCanvasProps> & Readonly<{
686
+ onClick?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
687
+ onContextmenu?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
688
+ onPointermove?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
689
+ onPointerenter?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
690
+ onPointerleave?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
691
+ onPointerover?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
692
+ onPointerout?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
693
+ onDblclick?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
694
+ onPointerdown?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
695
+ onPointerup?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
696
+ onPointercancel?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
697
+ onLostpointercapture?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
698
+ onWheel?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
699
+ onReady?: ((context: TresContext) => any) | undefined;
700
+ onPointermissed?: ((event: PointerEvent<MouseEvent>) => any) | undefined;
701
+ onRender?: ((context: TresContext) => any) | undefined;
702
+ onBeforeLoop?: ((context: TresContextWithClock) => any) | undefined;
703
+ onLoop?: ((context: TresContextWithClock) => any) | undefined;
704
+ }>, {
705
+ windowSize: boolean;
706
+ antialias: boolean;
707
+ stencil: boolean;
708
+ depth: boolean;
709
+ logarithmicDepthBuffer: boolean;
710
+ preserveDrawingBuffer: boolean;
711
+ alpha: boolean;
712
+ failIfMajorPerformanceCaveat: boolean;
713
+ clearColor: THREE.ColorRepresentation;
714
+ clearAlpha: number;
715
+ shadows: boolean;
716
+ toneMapping: THREE.ToneMapping;
717
+ shadowMapType: THREE.ShadowMapType;
718
+ useLegacyLights: boolean;
719
+ renderMode: "always" | "on-demand" | "manual";
720
+ enableProvideBridge: boolean;
721
+ }, {}, {}, {}, string, vue0.ComponentProvideOptions, false, {}, any>, {
722
+ default: () => any;
723
+ }>;
724
+ declare const _default: typeof __VLS_export;
725
+ type __VLS_WithSlots<T, S> = T & {
726
+ new (): {
727
+ $slots: S;
728
+ };
729
+ };
730
+ //#endregion
731
+ //#region src/core/catalogue.d.ts
732
+ declare const catalogue: Ref<TresCatalogue>;
733
+ declare const extend: (objects: any) => any;
734
+ //#endregion
735
+ //#region src/devtools/DevtoolsMessenger.d.ts
736
+ type DevtoolsMessageType = 'performance' | 'context' | 'asset-load';
737
+ interface AssetLoadData {
738
+ url: string;
739
+ type: string;
740
+ loaded: boolean;
741
+ size: number;
742
+ asset: HTMLImageElement | HTMLScriptElement | HTMLLinkElement | Blob | ArrayBuffer | null;
743
+ }
744
+ interface DevtoolsMessage<T = any> {
745
+ type: DevtoolsMessageType;
746
+ data: T;
747
+ timestamp?: number;
748
+ }
749
+ type DevtoolsSubscriber = (message: DevtoolsMessage) => void;
750
+ /**
751
+ * Messenger class for communicating with Tres DevTools
752
+ * This class will be attached to window.__TRES__DEVTOOLS__
753
+ */
754
+ declare class DevtoolsMessenger {
755
+ private subscribers;
756
+ private messageQueue;
757
+ private maxQueueSize;
758
+ /**
759
+ * Send a message to devtools subscribers
760
+ * If no subscribers are available, only queueable message types are queued
761
+ */
762
+ send<T>(type: DevtoolsMessageType, data: T): void;
763
+ /**
764
+ * Queue a message for later delivery
765
+ */
766
+ private queueMessage;
767
+ /**
768
+ * Flush all queued messages to current subscribers
769
+ */
770
+ private flushQueue;
771
+ /**
772
+ * Subscribe to devtools messages
773
+ * When a new subscriber is added, all queued messages (asset-load events) are immediately delivered
774
+ */
775
+ subscribe(subscriber: DevtoolsSubscriber): () => void;
776
+ /**
777
+ * Check if there are any subscribers
778
+ */
779
+ get hasSubscribers(): boolean;
780
+ /**
781
+ * Get the current queue size
782
+ */
783
+ get queueSize(): number;
784
+ /**
785
+ * Clear all queued messages
786
+ */
787
+ clearQueue(): void;
788
+ }
789
+ //#endregion
790
+ //#region src/devtools/plugin.d.ts
791
+ declare function registerTresDevtools(app: App, tres: TresContext): void;
792
+ //#endregion
793
+ //#region src/directives/vDistanceTo.d.ts
794
+ declare const vDistanceTo: {
795
+ updated: (el: TresObject, binding: Ref<TresObject>) => void;
796
+ unmounted: (el: TresObject) => void;
797
+ };
798
+ //#endregion
799
+ //#region src/directives/vLightHelper.d.ts
800
+ declare const vLightHelper: {
801
+ mounted: (el: TresObject) => void;
802
+ updated: (el: TresObject) => void;
803
+ unmounted: (el: TresObject) => void;
804
+ };
805
+ //#endregion
806
+ //#region src/directives/vLog.d.ts
807
+ declare const vLog: {
808
+ mounted: (el: TresObject, binding: {
809
+ arg: string;
810
+ }) => void;
811
+ };
812
+ //#endregion
813
+ //#region src/utils/is/three.d.ts
814
+ /**
815
+ * Type guard to check if a value is a Three.js Object3D
816
+ * @param value - The value to check
817
+ * @returns True if the value is a Three.js Object3D instance, false otherwise
818
+ * @example
819
+ * ```ts
820
+ * const value = new THREE.Object3D()
821
+ * if (isObject3D(value)) {
822
+ * // TypeScript knows value is Object3D here
823
+ * value.position // OK
824
+ * value.rotation // OK
825
+ * value.scale // OK
826
+ * }
827
+ * ```
828
+ */
829
+ declare const isObject3D: (value: unknown) => value is Object3D<THREE.Object3DEventMap>;
830
+ /**
831
+ * Type guard to check if a value is a Three.js Mesh
832
+ * @param value - The value to check
833
+ * @returns True if the value is a Three.js Mesh instance, false otherwise
834
+ * @example
835
+ * ```ts
836
+ * const value = new THREE.Mesh()
837
+ * if (isMesh(value)) {
838
+ * // TypeScript knows value is Mesh here
839
+ * value.geometry // OK
840
+ */
841
+ declare const isMesh: (value: unknown) => value is Mesh<BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, Material | Material[], THREE.Object3DEventMap>;
842
+ /**
843
+ * Type guard to check if a value is a Three.js Camera
844
+ * @param value - The value to check
845
+ * @returns True if the value is a Three.js Camera instance, false otherwise
846
+ * @example
847
+ * ```ts
848
+ * const value = new THREE.PerspectiveCamera()
849
+ * if (isCamera(value)) {
850
+ * // TypeScript knows value is Camera here
851
+ * value.fov // OK
852
+ * value.near // OK
853
+ * value.far // OK
854
+ * }
855
+ * ```
856
+ */
857
+ declare const isCamera: (value: unknown) => value is Camera;
858
+ /**
859
+ * Type guard to check if a value is a Three.js OrthographicCamera
860
+ * @param value - The value to check
861
+ * @returns True if the value is a Three.js OrthographicCamera instance, false otherwise
862
+ */
863
+ declare const isOrthographicCamera: (value: unknown) => value is OrthographicCamera;
864
+ /**
865
+ * Type guard to check if a value is a Three.js PerspectiveCamera
866
+ * @param value - The value to check
867
+ * @returns True if the value is a Three.js PerspectiveCamera instance, false otherwise
868
+ */
869
+ declare const isPerspectiveCamera: (value: unknown) => value is PerspectiveCamera;
870
+ /**
871
+ * Type guard to check if a value is a Three.js Color
872
+ * @param value - The value to check
873
+ * @returns True if the value is a Three.js Color instance, false otherwise
874
+ */
875
+ declare const isColor: (value: unknown) => value is Color;
876
+ /**
877
+ * Type guard to check if a value is a Three.js ColorRepresentation
878
+ * @param value - The value to check
879
+ * @returns True if the value is a Three.js ColorRepresentation instance, false otherwise
880
+ */
881
+ declare const isColorRepresentation: (value: unknown) => value is ColorRepresentation;
882
+ /**
883
+ * Type guard to check if a value is a Three.js Layers
884
+ * @param value - The value to check
885
+ * @returns True if the value is a Three.js Layers instance, false otherwise
886
+ */
887
+ declare const isLayers: (value: unknown) => value is Layers;
888
+ /**
889
+ * Type guard to check if a value is a Three.js BufferGeometry
890
+ * @param value - The value to check
891
+ * @returns True if the value is a Three.js BufferGeometry instance, false otherwise
892
+ * @example
893
+ * ```ts
894
+ * const value = new THREE.BufferGeometry()
895
+ * if (isBufferGeometry(value)) {
896
+ * // TypeScript knows value is BufferGeometry here
897
+ * value.attributes // OK
898
+ * value.index // OK
899
+ * value.computeVertexNormals() // OK
900
+ * }
901
+ * ```
902
+ */
903
+ declare const isBufferGeometry: (value: unknown) => value is BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
904
+ /**
905
+ * Type guard to check if a value is a Three.js Material
906
+ * @param value - The value to check
907
+ * @returns True if the value is a Three.js Material instance, false otherwise
908
+ * @example
909
+ * ```ts
910
+ * const value = new THREE.MeshStandardMaterial()
911
+ * if (isMaterial(value)) {
912
+ * // TypeScript knows value is Material here
913
+ * value.color // OK
914
+ * value.metalness // OK
915
+ * value.roughness // OK
916
+ * }
917
+ * ```
918
+ */
919
+ declare const isMaterial: (value: unknown) => value is Material;
920
+ /**
921
+ * Type guard to check if a value is a Three.js Light
922
+ * @param value - The value to check
923
+ * @returns True if the value is a Three.js Light instance, false otherwise
924
+ * @example
925
+ * ```ts
926
+ * const value = new THREE.DirectionalLight()
927
+ * if (isLight(value)) {
928
+ * // TypeScript knows value is Light here
929
+ * value.intensity // OK
930
+ * value.color // OK
931
+ * value.position // OK
932
+ * }
933
+ * ```
934
+ */
935
+ declare const isLight: (value: unknown) => value is Light<THREE.LightShadow<Camera> | undefined>;
936
+ /**
937
+ * Type guard to check if a value is a Three.js Fog
938
+ * @param value - The value to check
939
+ * @returns True if the value is a Three.js Fog instance, false otherwise
940
+ * @example
941
+ * ```ts
942
+ * const value = new THREE.Fog(0x000000, 1, 1000)
943
+ * if (isFog(value)) {
944
+ * // TypeScript knows value is Fog here
945
+ * value.color // OK
946
+ * value.near // OK
947
+ * value.far // OK
948
+ * }
949
+ * ```
950
+ */
951
+ declare const isFog: (value: unknown) => value is Fog;
952
+ /**
953
+ * Type guard to check if a value is a Three.js Scene
954
+ * @param value - The value to check
955
+ * @returns True if the value is a Three.js Scene instance, false otherwise
956
+ * @example
957
+ * ```ts
958
+ * const value = new THREE.Scene()
959
+ * if (isScene(value)) {
960
+ * // TypeScript knows value is Scene here
961
+ * value.children // OK
962
+ * value.add(new THREE.Object3D()) // OK
963
+ * value.remove(new THREE.Object3D()) // OK
964
+ * }
965
+ * ```
966
+ */
967
+ declare const isScene: (value: unknown) => value is Scene;
968
+ /**
969
+ * Type guard to check if a value is a Three.js Group
970
+ * @param value - The value to check
971
+ * @returns True if the value is a Three.js Group instance, false otherwise
972
+ * ```
973
+ */
974
+ declare const isGroup: (value: unknown) => value is Group<THREE.Object3DEventMap>;
975
+ //#endregion
976
+ //#region src/utils/is/tres.d.ts
977
+ interface VectorLike {
978
+ set: (...args: any[]) => void;
979
+ constructor?: (...args: any[]) => any;
980
+ }
981
+ declare const isVectorLike: (value: unknown) => value is VectorLike;
982
+ interface Copyable {
983
+ copy: (...args: any[]) => void;
984
+ constructor?: (...args: any[]) => any;
985
+ }
986
+ declare const isCopyable: (value: unknown) => value is Copyable;
987
+ interface ClassInstance {
988
+ constructor?: (...args: any[]) => any;
989
+ }
990
+ declare const isClassInstance: (object: unknown) => object is ClassInstance;
991
+ /**
992
+ * Type guard to check if a value is a TresCamera
993
+ * @param value - The value to check
994
+ * @returns True if the value is a TresCamera instance, false otherwise
995
+ */
996
+ declare const isTresCamera: (value: unknown) => value is TresCamera;
997
+ /**
998
+ * Type guard to check if a value is a TresObject
999
+ * @param value - The value to check
1000
+ * @returns True if the value is a TresObject (Object3D | BufferGeometry | Material | Fog), false otherwise
1001
+ * @example
1002
+ * ```ts
1003
+ * const value = new THREE.Mesh()
1004
+ * if (isTresObject(value)) {
1005
+ * // TypeScript knows value is TresObject here
1006
+ * // You can use common properties and methods shared by all TresObjects
1007
+ * }
1008
+ * ```
1009
+ * @remarks
1010
+ * TresObject is a union type that represents the core Three.js objects that can be used in TresJS.
1011
+ * This includes Object3D, BufferGeometry, Material, and Fog instances.
1012
+ */
1013
+ declare const isTresObject: (value: unknown) => value is TresObject;
1014
+ /**
1015
+ * Type guard to check if a value is a TresPrimitive
1016
+ * @param value - The value to check
1017
+ * @returns True if the value is a TresPrimitive instance, false otherwise
1018
+ * @example
1019
+ * ```ts
1020
+ * const value = { isPrimitive: true }
1021
+ * if (isTresPrimitive(value)) {
1022
+ * // TypeScript knows value is TresPrimitive here
1023
+ * // You can use properties and methods specific to TresPrimitives
1024
+ * }
1025
+ * ```
1026
+ * @remarks
1027
+ * TresPrimitive is a special type in TresJS that represents primitive objects
1028
+ * that can be used directly in the scene without needing to be wrapped in a Three.js object.
1029
+ */
1030
+ declare const isTresPrimitive: (value: unknown) => value is TresPrimitive;
1031
+ /**
1032
+ * Type guard to check if a value is a TresInstance (has __tres property)
1033
+ * @param value - The value to check
1034
+ * @returns True if the value is a TresInstance (has __tres property), false otherwise
1035
+ * @example
1036
+ * ```ts
1037
+ * const value = new THREE.Mesh()
1038
+ * if (isTresInstance(value)) {
1039
+ * // TypeScript knows value is TresInstance here
1040
+ * // You can safely access value.__tres
1041
+ * }
1042
+ * ```
1043
+ */
1044
+ declare const isTresInstance: (value: unknown) => value is TresInstance;
1045
+ //#endregion
1046
+ //#region src/index.d.ts
1047
+ interface TresOptions {
1048
+ extends?: Record<string, unknown>;
1049
+ }
1050
+ interface TresPlugin {
1051
+ [key: string]: any;
1052
+ install: (app: App, options?: TresOptions) => void;
1053
+ }
1054
+ declare const plugin: TresPlugin;
1055
+ //#endregion
1056
+ export { Args, AssetLoadData, AttachFnType, AttachType, ConstructorRepresentation, DevtoolsMessage, DevtoolsMessageType, DevtoolsMessenger, DevtoolsSubscriber, DisposeType, ElementProps, InstanceProps, LoaderMethods, LoaderProto, LocalState, LoopContext, MathType, Mutable, NonFunctionKeys, Overwrite, Properties, RenderFunction, RenderMode, RendererOptions, ThreeElement, ThreeInstances, TresCamera, _default as TresCanvas, TresCatalogue, TresColor, TresColorArray, type TresContext, TresContextWithClock, TresControl, TresEuler, TresInstance, TresLayers, TresLoader, TresLoaderOptions, TresMaterial, TresObject, TresObject3D, TresObjectMap, TresOptions, TresPartialContext, TresPlugin, type TresPointerEvent, TresPrimitive, TresQuaternion, TresRenderer, TresRendererSetupContext, TresScene, TresVector2, TresVector3, TresVector4, UseCameraReturn, _default$1 as UseLoader, UseLoaderReturn, UseRendererManagerReturn, UseRendererOptions, VectorCoordinates, type VectorFlexibleParams, VueProps, WithMathProps, buildGraph, catalogue, plugin as default, disposeObject3D as dispose, extend, isBufferGeometry, isCamera, isClassInstance, isColor, isColorRepresentation, isCopyable, isFog, isGroup, isLayers, isLight, isMaterial, isMesh, isObject3D, isOrthographicCamera, isPerspectiveCamera, isProd, isScene, isTresCamera, isTresInstance, isTresObject, isTresPrimitive, isVectorLike, logError, logMessage, logWarning, normalizeColor, normalizeVectorFlexibleParam, registerTresDevtools, templateCompilerOptions, useCameraManager, useGraph, useLoader, useLoop, useRendererManager, useTres, useTresContext, useTresContextProvider, vDistanceTo, vLightHelper, vLog };