@tresjs/core 5.9.0 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/template-compiler-options.d.mts +1 -1
- package/dist/template-compiler-options.mjs +2 -4
- package/dist/tres.d.ts +152 -172
- package/dist/tres.js +108 -166
- package/package.json +26 -26
package/dist/tres.d.ts
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/core
|
|
3
|
-
* version: v5.9.
|
|
3
|
+
* version: v5.9.2
|
|
4
4
|
* (c) 2026
|
|
5
5
|
* description: Declarative ThreeJS using Vue Components
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
7
7
|
*/
|
|
8
|
-
import * as vue20 from "vue";
|
|
9
8
|
import { App, ComputedRef, DefineComponent, MaybeRef, MaybeRefOrGetter, Reactive, Ref, ShallowRef, VNode, VNodeRef } from "vue";
|
|
10
9
|
import * as THREE from "three";
|
|
11
10
|
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
11
|
import { EventHookOff, UseAsyncStateOptions, UseAsyncStateReturn } from "@vueuse/core";
|
|
14
12
|
import { PointerEvent, PointerEventsMap } from "@pmndrs/pointer-events";
|
|
15
13
|
import { Renderer } from "three/webgpu";
|
|
16
|
-
|
|
17
14
|
//#region src/composables/useLoader/index.d.ts
|
|
18
|
-
interface LoaderMethods {
|
|
15
|
+
export interface LoaderMethods {
|
|
19
16
|
setDRACOLoader: (dracoLoader: any) => void;
|
|
20
17
|
setMeshoptDecoder: (meshoptDecoder: any) => void;
|
|
21
18
|
setKTX2Loader: (ktx2Loader: any) => void;
|
|
22
19
|
}
|
|
23
|
-
type TresLoader<T> = Loader & Partial<LoaderMethods> & {
|
|
20
|
+
export type TresLoader<T> = Loader & Partial<LoaderMethods> & {
|
|
24
21
|
load: (url: string, onLoad: (result: T) => void, onProgress?: (event: ProgressEvent<EventTarget>) => void, onError?: (err: unknown) => void) => void;
|
|
25
22
|
loadAsync: (url: string, onProgress?: (event: ProgressEvent) => void) => Promise<T>;
|
|
26
23
|
};
|
|
27
|
-
type LoaderProto<T> = new (manager?: LoadingManager) => TresLoader<T>;
|
|
28
|
-
interface TresLoaderOptions<T, Shallow extends boolean> {
|
|
24
|
+
export type LoaderProto<T> = new (manager?: LoadingManager) => TresLoader<T>;
|
|
25
|
+
export interface TresLoaderOptions<T, Shallow extends boolean> {
|
|
29
26
|
manager?: LoadingManager;
|
|
30
27
|
extensions?: (loader: TresLoader<T>) => void;
|
|
31
28
|
initialValue?: T;
|
|
@@ -37,7 +34,7 @@ interface TresLoaderOptions<T, Shallow extends boolean> {
|
|
|
37
34
|
* @template Shallow - Whether to use shallow reactivity for better performance
|
|
38
35
|
* @extends {UseAsyncStateReturn<T, [string], Shallow>} - Extends VueUse's useAsyncState return type
|
|
39
36
|
*/
|
|
40
|
-
type UseLoaderReturn<T, Shallow extends boolean> = UseAsyncStateReturn<T, [string], Shallow> & {
|
|
37
|
+
export type UseLoaderReturn<T, Shallow extends boolean> = UseAsyncStateReturn<T, [string], Shallow> & {
|
|
41
38
|
/**
|
|
42
39
|
* Loads a new asset from the given path
|
|
43
40
|
* @param path - The URL or path to the asset to load
|
|
@@ -62,7 +59,7 @@ type UseLoaderReturn<T, Shallow extends boolean> = UseAsyncStateReturn<T, [strin
|
|
|
62
59
|
* @param options - Optional configuration for the loader
|
|
63
60
|
* @returns UseAsyncState composable with the loaded model
|
|
64
61
|
*/
|
|
65
|
-
declare function useLoader<T, Shallow extends boolean =
|
|
62
|
+
export declare function useLoader<T, Shallow extends boolean = true>(Loader: LoaderProto<T>, path: MaybeRef<string>, options?: TresLoaderOptions<T, Shallow>): UseLoaderReturn<T, Shallow>;
|
|
66
63
|
//#endregion
|
|
67
64
|
//#region src/composables/useCreateRafLoop/index.d.ts
|
|
68
65
|
interface RafLoopContext {
|
|
@@ -82,7 +79,7 @@ interface SizesType {
|
|
|
82
79
|
/**
|
|
83
80
|
* Interface for the return value of the useCamera composable
|
|
84
81
|
*/
|
|
85
|
-
interface UseCameraReturn {
|
|
82
|
+
export interface UseCameraReturn {
|
|
86
83
|
activeCamera: ComputedRef<TresCamera>;
|
|
87
84
|
/**
|
|
88
85
|
* The list of cameras
|
|
@@ -117,13 +114,11 @@ interface UseCameraParams {
|
|
|
117
114
|
* @param params.sizes - The sizes object containing window dimensions
|
|
118
115
|
* @returns The camera management functions and state
|
|
119
116
|
*/
|
|
120
|
-
declare const useCameraManager: ({
|
|
121
|
-
sizes
|
|
122
|
-
}: UseCameraParams) => UseCameraReturn;
|
|
117
|
+
export declare const useCameraManager: ({ sizes }: UseCameraParams) => UseCameraReturn;
|
|
123
118
|
//#endregion
|
|
124
119
|
//#region src/utils/error.d.ts
|
|
125
|
-
type TresRendererErrorCode = 'INITIALIZATION_FAILED';
|
|
126
|
-
declare class TresRendererError extends Error {
|
|
120
|
+
export type TresRendererErrorCode = 'INITIALIZATION_FAILED';
|
|
121
|
+
export declare class TresRendererError extends Error {
|
|
127
122
|
readonly code: TresRendererErrorCode;
|
|
128
123
|
readonly name = "TresRendererError";
|
|
129
124
|
constructor(message: string, code: TresRendererErrorCode, options?: ErrorOptions);
|
|
@@ -135,10 +130,10 @@ declare class TresRendererError extends Error {
|
|
|
135
130
|
* If set to 'manual', the scene will only be rendered when advance() is called
|
|
136
131
|
* If set to 'always', the scene will be rendered every frame
|
|
137
132
|
*/
|
|
138
|
-
type RenderMode = 'always' | 'on-demand' | 'manual';
|
|
139
|
-
type RenderFunction = (notifySuccess: () => void) => void;
|
|
140
|
-
type TresRenderer = WebGLRenderer | Renderer;
|
|
141
|
-
interface RendererOptions {
|
|
133
|
+
export type RenderMode = 'always' | 'on-demand' | 'manual';
|
|
134
|
+
export type RenderFunction = (notifySuccess: () => void) => void;
|
|
135
|
+
export type TresRenderer = WebGLRenderer | Renderer;
|
|
136
|
+
export interface RendererOptions {
|
|
142
137
|
/**
|
|
143
138
|
* WebGL Context options (Readonly because they are passed to the renderer constructor)
|
|
144
139
|
* They can't be changed after the renderer is created because they are passed to the canvas context
|
|
@@ -181,22 +176,22 @@ interface RendererOptions {
|
|
|
181
176
|
preserveDrawingBuffer?: boolean;
|
|
182
177
|
/**
|
|
183
178
|
* Power preference for the renderer.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
179
|
+
* Power preference for the renderer.
|
|
180
|
+
* - `default`: Automatically chooses the most suitable power setting.
|
|
181
|
+
* - `high-performance`: Prioritizes rendering performance.
|
|
182
|
+
* - `low-power`: Tries to reduce power usage.
|
|
188
183
|
* @see {@link https://threejs.org/docs/#api/en/renderers/WebGLRenderer}
|
|
189
184
|
* @default 'default'
|
|
190
185
|
* @readonly
|
|
191
186
|
*/
|
|
192
187
|
powerPreference?: WebGLPowerPreference;
|
|
193
188
|
/**
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
189
|
+
* Whether to create the WebGL context with an alpha buffer.
|
|
190
|
+
* This is a WebGL context option that must be set during context creation and cannot be changed later.
|
|
191
|
+
* When true, the canvas can be transparent, showing content behind it.
|
|
192
|
+
* @readonly
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
200
195
|
alpha?: boolean;
|
|
201
196
|
/**
|
|
202
197
|
* Whether to premultiply the alpha of the canvas.
|
|
@@ -287,63 +282,47 @@ interface RendererOptions {
|
|
|
287
282
|
*/
|
|
288
283
|
renderer?: (ctx: TresRendererSetupContext) => TresRenderer;
|
|
289
284
|
}
|
|
290
|
-
interface TresRendererSetupContext {
|
|
285
|
+
export interface TresRendererSetupContext {
|
|
291
286
|
sizes: SizesType;
|
|
292
287
|
scene: ShallowRef<TresScene>;
|
|
293
288
|
camera: UseCameraReturn;
|
|
294
289
|
canvas: MaybeRef<HTMLCanvasElement>;
|
|
295
290
|
}
|
|
296
|
-
interface UseRendererOptions {
|
|
291
|
+
export interface UseRendererOptions {
|
|
297
292
|
scene: ShallowRef<TresScene>;
|
|
298
293
|
canvas: MaybeRef<HTMLCanvasElement>;
|
|
299
294
|
options: Reactive<RendererOptions>;
|
|
300
295
|
fpsLimit?: MaybeRefOrGetter<number>;
|
|
301
296
|
contextParts: Pick<TresContext, 'sizes' | 'camera'>;
|
|
302
297
|
}
|
|
303
|
-
declare function useRendererManager({
|
|
304
|
-
scene,
|
|
305
|
-
canvas,
|
|
306
|
-
options,
|
|
307
|
-
fpsLimit,
|
|
308
|
-
contextParts: {
|
|
309
|
-
sizes,
|
|
310
|
-
camera
|
|
311
|
-
}
|
|
312
|
-
}: UseRendererOptions): {
|
|
298
|
+
export declare function useRendererManager({ scene, canvas, options, fpsLimit, contextParts: { sizes, camera } }: UseRendererOptions): {
|
|
313
299
|
loop: {
|
|
314
300
|
start: () => void;
|
|
315
301
|
stop: () => void;
|
|
316
302
|
isActive: Readonly<ShallowRef<boolean>>;
|
|
317
|
-
onBeforeLoop:
|
|
318
|
-
onLoop:
|
|
303
|
+
onBeforeLoop: import("@vueuse/core").EventHookOn<RafLoopContext>;
|
|
304
|
+
onLoop: import("@vueuse/core").EventHookOn<RafLoopContext>;
|
|
319
305
|
};
|
|
320
306
|
instance: TresRenderer;
|
|
321
307
|
advance: () => void;
|
|
322
|
-
onReady:
|
|
323
|
-
onRender:
|
|
324
|
-
onError:
|
|
308
|
+
onReady: import("@vueuse/core").EventHookOn<TresRenderer>;
|
|
309
|
+
onRender: import("@vueuse/core").EventHookOn<TresRenderer>;
|
|
310
|
+
onError: import("@vueuse/core").EventHookOn<TresRendererError>;
|
|
325
311
|
invalidate: (amountOfFramesToInvalidate?: number) => void;
|
|
326
|
-
canBeInvalidated:
|
|
312
|
+
canBeInvalidated: import("vue").ComputedRef<boolean>;
|
|
327
313
|
mode: "always" | "on-demand" | "manual" | undefined;
|
|
328
314
|
replaceRenderFunction: (fn: RenderFunction) => void;
|
|
329
|
-
isInitialized:
|
|
330
|
-
error:
|
|
315
|
+
isInitialized: import("vue").Ref<boolean, boolean>;
|
|
316
|
+
error: import("vue").Ref<TresRendererError | null, TresRendererError | null>;
|
|
331
317
|
};
|
|
332
|
-
type UseRendererManagerReturn = ReturnType<typeof useRendererManager>;
|
|
318
|
+
export type UseRendererManagerReturn = ReturnType<typeof useRendererManager>;
|
|
333
319
|
//#endregion
|
|
334
320
|
//#region src/composables/useEventManager/index.d.ts
|
|
335
|
-
declare function useEventManager({
|
|
336
|
-
canvas,
|
|
337
|
-
contextParts: {
|
|
338
|
-
scene,
|
|
339
|
-
camera,
|
|
340
|
-
renderer
|
|
341
|
-
}
|
|
342
|
-
}: {
|
|
321
|
+
declare function useEventManager({ canvas, contextParts: { scene, camera, renderer } }: {
|
|
343
322
|
canvas: MaybeRef<HTMLCanvasElement>;
|
|
344
323
|
contextParts: Pick<TresContext, 'scene' | 'camera' | 'renderer'>;
|
|
345
324
|
}): {
|
|
346
|
-
onPointerMissed:
|
|
325
|
+
onPointerMissed: import("@vueuse/core").EventHookOn<TresPointerEvent & Event<"click", Object3D<Object3DEventMap & PointerEventsMap>>>;
|
|
347
326
|
};
|
|
348
327
|
//#endregion
|
|
349
328
|
//#region src/composables/useTresContextProvider/index.d.ts
|
|
@@ -365,7 +344,7 @@ interface TresContext {
|
|
|
365
344
|
isWebGPU: ComputedRef<boolean>;
|
|
366
345
|
events: ReturnType<typeof useEventManager>;
|
|
367
346
|
}
|
|
368
|
-
declare const INJECTION_KEY = "useTres";
|
|
347
|
+
export declare const INJECTION_KEY = "useTres";
|
|
369
348
|
declare const useTresContextProvider: (args_0: {
|
|
370
349
|
scene: TresScene;
|
|
371
350
|
canvas: MaybeRef<HTMLCanvasElement>;
|
|
@@ -380,29 +359,29 @@ declare const supportedPointerEvents: readonly ["onClick", "onContextmenu", "onP
|
|
|
380
359
|
type SupportedVuePointerEvent = typeof supportedPointerEvents[number];
|
|
381
360
|
type TresPointerEventName = 'click' | 'contextmenu' | 'pointermove' | 'pointerenter' | 'pointerleave' | 'pointerover' | 'pointerout' | 'dblclick' | 'pointerdown' | 'pointerup' | 'pointercancel' | 'lostpointercapture' | 'wheel';
|
|
382
361
|
type TresPointerEvent = PointerEvent<MouseEvent>;
|
|
383
|
-
type PointerEventHandlers = { [key in SupportedVuePointerEvent]: (event: TresPointerEvent) => void };
|
|
362
|
+
type PointerEventHandlers = { [key in SupportedVuePointerEvent]: (event: TresPointerEvent) => void; };
|
|
384
363
|
//#endregion
|
|
385
364
|
//#region src/types/index.d.ts
|
|
386
|
-
type AttachFnType = (parent: any, self: TresInstance) => () => void;
|
|
387
|
-
type AttachType = string | AttachFnType;
|
|
388
|
-
type DisposeType = ((self: TresInstance) => void) | boolean | 'default' | null;
|
|
389
|
-
type ConstructorRepresentation = new (...args: any[]) => any;
|
|
390
|
-
type NonFunctionKeys<P> = { [K in keyof P]-?: P[K] extends ((...args: any[]) => any) ? never : K }[keyof P];
|
|
391
|
-
type Overwrite<P, O> = Omit<P, NonFunctionKeys<O>> & O;
|
|
392
|
-
type Properties<T> = Pick<T, NonFunctionKeys<T>>;
|
|
393
|
-
type Mutable<P> = { [K in keyof P]: P[K] | Readonly<P[K]
|
|
394
|
-
type Args<T> = T extends ConstructorRepresentation ? ConstructorParameters<T> : any[];
|
|
395
|
-
interface TresCatalogue {
|
|
365
|
+
export type AttachFnType = (parent: any, self: TresInstance) => () => void;
|
|
366
|
+
export type AttachType = string | AttachFnType;
|
|
367
|
+
export type DisposeType = ((self: TresInstance) => void) | boolean | 'default' | null;
|
|
368
|
+
export type ConstructorRepresentation = new (...args: any[]) => any;
|
|
369
|
+
export type NonFunctionKeys<P> = { [K in keyof P]-?: P[K] extends ((...args: any[]) => any) ? never : K; }[keyof P];
|
|
370
|
+
export type Overwrite<P, O> = Omit<P, NonFunctionKeys<O>> & O;
|
|
371
|
+
export type Properties<T> = Pick<T, NonFunctionKeys<T>>;
|
|
372
|
+
export type Mutable<P> = { [K in keyof P]: P[K] | Readonly<P[K]>; };
|
|
373
|
+
export type Args<T> = T extends ConstructorRepresentation ? ConstructorParameters<T> : any[];
|
|
374
|
+
export interface TresCatalogue {
|
|
396
375
|
[name: string]: ConstructorRepresentation;
|
|
397
376
|
}
|
|
398
|
-
type TresCamera = THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
|
377
|
+
export type TresCamera = THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
|
399
378
|
/**
|
|
400
379
|
* Represents the properties of an instance.
|
|
401
380
|
*
|
|
402
381
|
* @template T - The type of the object.
|
|
403
382
|
* @template P - The type of the arguments.
|
|
404
383
|
*/
|
|
405
|
-
interface InstanceProps<T = any, P = any> {
|
|
384
|
+
export interface InstanceProps<T = any, P = any> {
|
|
406
385
|
args?: Args<P>;
|
|
407
386
|
object?: T;
|
|
408
387
|
visible?: boolean;
|
|
@@ -414,7 +393,7 @@ interface TresBaseObject {
|
|
|
414
393
|
dispose?: () => void;
|
|
415
394
|
[prop: string]: any;
|
|
416
395
|
}
|
|
417
|
-
interface LocalState {
|
|
396
|
+
export interface LocalState {
|
|
418
397
|
type: string;
|
|
419
398
|
root: TresContext;
|
|
420
399
|
memoizedProps: {
|
|
@@ -427,11 +406,11 @@ interface LocalState {
|
|
|
427
406
|
attach?: AttachType;
|
|
428
407
|
previousAttach: any;
|
|
429
408
|
}
|
|
430
|
-
interface TresObject3D extends THREE.Object3D<THREE.Object3DEventMap> {
|
|
409
|
+
export interface TresObject3D extends THREE.Object3D<THREE.Object3DEventMap> {
|
|
431
410
|
geometry?: THREE.BufferGeometry & TresBaseObject;
|
|
432
411
|
material?: THREE.Material & TresBaseObject;
|
|
433
412
|
}
|
|
434
|
-
type TresObject = TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.Material | THREE.Fog) & {
|
|
413
|
+
export type TresObject = TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.Material | THREE.Fog) & {
|
|
435
414
|
__tres?: LocalState;
|
|
436
415
|
};
|
|
437
416
|
/**
|
|
@@ -439,15 +418,15 @@ type TresObject = TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.
|
|
|
439
418
|
* This provides better TypeScript intellisense and type checking
|
|
440
419
|
* when accessing specific material properties
|
|
441
420
|
*/
|
|
442
|
-
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;
|
|
443
|
-
type TresInstance = TresObject & {
|
|
421
|
+
export 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;
|
|
422
|
+
export type TresInstance = TresObject & {
|
|
444
423
|
__tres: LocalState;
|
|
445
424
|
};
|
|
446
|
-
type TresPrimitive = TresInstance & {
|
|
425
|
+
export type TresPrimitive = TresInstance & {
|
|
447
426
|
object: TresInstance;
|
|
448
427
|
isPrimitive: true;
|
|
449
428
|
};
|
|
450
|
-
interface TresScene extends THREE.Scene {
|
|
429
|
+
export interface TresScene extends THREE.Scene {
|
|
451
430
|
__tres: {
|
|
452
431
|
root: TresContext;
|
|
453
432
|
objects: TresObject[];
|
|
@@ -455,53 +434,54 @@ interface TresScene extends THREE.Scene {
|
|
|
455
434
|
};
|
|
456
435
|
}
|
|
457
436
|
interface MathRepresentation {
|
|
458
|
-
set(...args: number[]
|
|
437
|
+
set(...args: number[]): any;
|
|
459
438
|
}
|
|
460
439
|
interface VectorRepresentation extends MathRepresentation {
|
|
461
440
|
setScalar(s: number): any;
|
|
462
441
|
}
|
|
463
|
-
|
|
442
|
+
type MathTypes = MathRepresentation | THREE.Euler | THREE.Color;
|
|
443
|
+
export interface VectorCoordinates {
|
|
464
444
|
x: number;
|
|
465
445
|
y: number;
|
|
466
446
|
z: number;
|
|
467
447
|
}
|
|
468
|
-
type MathType<T extends
|
|
448
|
+
export type MathType<T extends MathTypes> = 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']>;
|
|
469
449
|
type VectorLike$1<VectorClass extends THREE.Vector2 | THREE.Vector3 | THREE.Vector4> = VectorClass | Parameters<VectorClass['set']> | Readonly<Parameters<VectorClass['set']>> | Parameters<VectorClass['setScalar']>[0];
|
|
470
|
-
type TresVector2 = VectorLike$1<THREE.Vector2>;
|
|
471
|
-
type TresVector3 = VectorLike$1<THREE.Vector3>;
|
|
472
|
-
type TresVector4 = VectorLike$1<THREE.Vector4>;
|
|
473
|
-
type TresColor = ConstructorParameters<typeof THREE.Color> | THREE.Color | number | string;
|
|
474
|
-
type TresColorArray = typeof THREE.Color | [color: THREE.ColorRepresentation];
|
|
475
|
-
type TresLayers = THREE.Layers | Parameters<THREE.Layers['set']>[0];
|
|
476
|
-
type TresQuaternion = THREE.Quaternion | Parameters<THREE.Quaternion['set']>;
|
|
477
|
-
type TresEuler = THREE.Euler;
|
|
478
|
-
type TresControl = THREE.EventDispatcher & {
|
|
450
|
+
export type TresVector2 = VectorLike$1<THREE.Vector2>;
|
|
451
|
+
export type TresVector3 = VectorLike$1<THREE.Vector3>;
|
|
452
|
+
export type TresVector4 = VectorLike$1<THREE.Vector4>;
|
|
453
|
+
export type TresColor = ConstructorParameters<typeof THREE.Color> | THREE.Color | number | string;
|
|
454
|
+
export type TresColorArray = typeof THREE.Color | [color: THREE.ColorRepresentation];
|
|
455
|
+
export type TresLayers = THREE.Layers | Parameters<THREE.Layers['set']>[0];
|
|
456
|
+
export type TresQuaternion = THREE.Quaternion | Parameters<THREE.Quaternion['set']>;
|
|
457
|
+
export type TresEuler = THREE.Euler;
|
|
458
|
+
export type TresControl = THREE.EventDispatcher & {
|
|
479
459
|
enabled: boolean;
|
|
480
460
|
};
|
|
481
|
-
type TresContextWithClock = TresContext & {
|
|
461
|
+
export type TresContextWithClock = TresContext & {
|
|
482
462
|
delta: number;
|
|
483
463
|
elapsed: number;
|
|
484
464
|
};
|
|
485
|
-
type WithMathProps<P> = { [K in keyof P]: P[K] extends
|
|
465
|
+
export type WithMathProps<P> = { [K in keyof P]: P[K] extends MathTypes ? MathType<P[K]> : P[K]; };
|
|
486
466
|
interface RaycastableRepresentation {
|
|
487
467
|
raycast: (raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) => void;
|
|
488
468
|
}
|
|
489
469
|
type EventProps<P> = P extends RaycastableRepresentation ? Partial<PointerEventHandlers> : unknown;
|
|
490
|
-
interface VueProps {
|
|
470
|
+
export interface VueProps {
|
|
491
471
|
children?: VNode[];
|
|
492
472
|
ref?: VNodeRef;
|
|
493
473
|
key?: string | number | symbol;
|
|
494
474
|
}
|
|
495
|
-
type ElementProps<T extends ConstructorRepresentation, P = InstanceType<T>> = Partial<Overwrite<P, WithMathProps<P> & VueProps & EventProps<P>>>;
|
|
496
|
-
type ThreeElement<T extends ConstructorRepresentation> = Mutable<Overwrite<ElementProps<T>, Omit<InstanceProps<InstanceType<T>, T>, 'object'>>>;
|
|
475
|
+
export type ElementProps<T extends ConstructorRepresentation, P = InstanceType<T>> = Partial<Overwrite<P, WithMathProps<P> & VueProps & EventProps<P>>>;
|
|
476
|
+
export type ThreeElement<T extends ConstructorRepresentation> = Mutable<Overwrite<ElementProps<T>, Omit<InstanceProps<InstanceType<T>, T>, 'object'>>>;
|
|
497
477
|
type ThreeExports = typeof THREE;
|
|
498
|
-
type ThreeInstancesImpl = { [K in keyof ThreeExports as Uncapitalize<K>]: ThreeExports[K] extends ConstructorRepresentation ? ThreeElement<ThreeExports[K]> : never };
|
|
499
|
-
interface ThreeInstances extends ThreeInstancesImpl {
|
|
478
|
+
type ThreeInstancesImpl = { [K in keyof ThreeExports as Uncapitalize<K>]: ThreeExports[K] extends ConstructorRepresentation ? ThreeElement<ThreeExports[K]> : never; };
|
|
479
|
+
export interface ThreeInstances extends ThreeInstancesImpl {
|
|
500
480
|
primitive: Omit<ThreeElement<any>, 'args'> & {
|
|
501
481
|
object: object;
|
|
502
482
|
};
|
|
503
483
|
}
|
|
504
|
-
type TresComponents = { [K in keyof ThreeInstances as `Tres${Capitalize<string & K>}`]: DefineComponent<ThreeInstances[K]
|
|
484
|
+
export type TresComponents = { [K in keyof ThreeInstances as `Tres${Capitalize<string & K>}`]: DefineComponent<ThreeInstances[K]>; };
|
|
505
485
|
declare module 'vue' {
|
|
506
486
|
interface GlobalComponents extends TresComponents {
|
|
507
487
|
primitive: DefineComponent<TresPrimitive>;
|
|
@@ -509,7 +489,7 @@ declare module 'vue' {
|
|
|
509
489
|
}
|
|
510
490
|
//#endregion
|
|
511
491
|
//#region src/utils/graph.d.ts
|
|
512
|
-
interface TresObjectMap {
|
|
492
|
+
export interface TresObjectMap {
|
|
513
493
|
nodes: {
|
|
514
494
|
[name: string]: TresObject;
|
|
515
495
|
};
|
|
@@ -521,11 +501,11 @@ interface TresObjectMap {
|
|
|
521
501
|
};
|
|
522
502
|
scene?: Scene;
|
|
523
503
|
}
|
|
524
|
-
declare function buildGraph(object: Object3D | TresObject): TresObjectMap;
|
|
504
|
+
export declare function buildGraph(object: Object3D | TresObject): TresObjectMap;
|
|
525
505
|
//#endregion
|
|
526
506
|
//#region src/composables/useLoader/component.vue.d.ts
|
|
527
507
|
declare const __VLS_export$3: <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_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
528
|
-
props:
|
|
508
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
529
509
|
/**
|
|
530
510
|
* The THREE.js loader to use
|
|
531
511
|
*/
|
|
@@ -549,20 +529,20 @@ declare const __VLS_export$3: <T extends TresObjectMap>(__VLS_props: NonNullable
|
|
|
549
529
|
attrs: any;
|
|
550
530
|
slots: {
|
|
551
531
|
default?: (props: {
|
|
552
|
-
state:
|
|
532
|
+
state: T;
|
|
553
533
|
isLoading: boolean;
|
|
554
534
|
error: unknown;
|
|
555
535
|
}) => any;
|
|
556
536
|
};
|
|
557
537
|
emit: ((evt: "error", error: unknown) => void) & ((evt: "loaded", result: T) => void);
|
|
558
|
-
}>) =>
|
|
559
|
-
__ctx?: Awaited<typeof __VLS_setup
|
|
538
|
+
}>) => import("vue").VNode & {
|
|
539
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
560
540
|
};
|
|
561
541
|
declare const _default$3: typeof __VLS_export$3;
|
|
562
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
542
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
563
543
|
//#endregion
|
|
564
544
|
//#region src/composables/useGraph/index.d.ts
|
|
565
|
-
declare const useGraph: (object: MaybeRef<TresObject | undefined>) =>
|
|
545
|
+
export declare const useGraph: (object: MaybeRef<TresObject | undefined>) => import("vue").ComputedRef<TresObjectMap | undefined>;
|
|
566
546
|
//#endregion
|
|
567
547
|
//#region src/utils/createPriorityEventHook.d.ts
|
|
568
548
|
type Callback<T> = Parameters<EventHookOff<T>>[0];
|
|
@@ -571,7 +551,7 @@ type PriorityEventHookOn<T> = (fn: Callback<T>, priority?: number) => {
|
|
|
571
551
|
};
|
|
572
552
|
//#endregion
|
|
573
553
|
//#region src/composables/useTres/index.d.ts
|
|
574
|
-
interface TresPartialContext extends Omit<TresContext, 'renderer' | 'camera'> {
|
|
554
|
+
export interface TresPartialContext extends Omit<TresContext, 'renderer' | 'camera'> {
|
|
575
555
|
/**
|
|
576
556
|
* The renderer instance
|
|
577
557
|
*
|
|
@@ -603,17 +583,17 @@ interface TresPartialContext extends Omit<TresContext, 'renderer' | 'camera'> {
|
|
|
603
583
|
*/
|
|
604
584
|
advance: () => void;
|
|
605
585
|
}
|
|
606
|
-
declare function useTres(): TresPartialContext;
|
|
586
|
+
export declare function useTres(): TresPartialContext;
|
|
607
587
|
//#endregion
|
|
608
588
|
//#region src/composables/useLoop/index.d.ts
|
|
609
|
-
type LoopContext = RafLoopContext & TresPartialContext;
|
|
589
|
+
export type LoopContext = RafLoopContext & TresPartialContext;
|
|
610
590
|
/**
|
|
611
591
|
* Composable that provides control over the render loop and animation lifecycle.
|
|
612
592
|
*/
|
|
613
|
-
declare const useLoop: () => {
|
|
593
|
+
export declare const useLoop: () => {
|
|
614
594
|
stop: () => void;
|
|
615
595
|
start: () => void;
|
|
616
|
-
isActive: Readonly<
|
|
596
|
+
isActive: Readonly<import("vue").ShallowRef<boolean>>;
|
|
617
597
|
onBeforeRender: PriorityEventHookOn<LoopContext>;
|
|
618
598
|
onRender: PriorityEventHookOn<LoopContext>;
|
|
619
599
|
render: (fn: RenderFunction) => void;
|
|
@@ -629,7 +609,7 @@ interface TresCustomRendererOptions {
|
|
|
629
609
|
* Logger utility for TresJS
|
|
630
610
|
* @module logger
|
|
631
611
|
*/
|
|
632
|
-
declare const isProd: boolean;
|
|
612
|
+
export declare const isProd: boolean;
|
|
633
613
|
type OneOrMore<T> = {
|
|
634
614
|
0: T;
|
|
635
615
|
} & Array<T>;
|
|
@@ -637,18 +617,18 @@ type OneOrMore<T> = {
|
|
|
637
617
|
* Logs an error message with the TresJS prefix
|
|
638
618
|
* @param args - Arguments to log
|
|
639
619
|
*/
|
|
640
|
-
declare function logError(...args: OneOrMore<any>): void;
|
|
620
|
+
export declare function logError(...args: OneOrMore<any>): void;
|
|
641
621
|
/**
|
|
642
622
|
* Logs a warning message with the TresJS prefix
|
|
643
623
|
* @param args - Arguments to log
|
|
644
624
|
*/
|
|
645
|
-
declare function logWarning(...args: OneOrMore<any>): void;
|
|
625
|
+
export declare function logWarning(...args: OneOrMore<any>): void;
|
|
646
626
|
/**
|
|
647
627
|
* Logs a message with the TresJS prefix (only in development mode)
|
|
648
628
|
* @param name - Name of the message
|
|
649
629
|
* @param value - Value to log
|
|
650
630
|
*/
|
|
651
|
-
declare function logMessage(name: string, value: any): void;
|
|
631
|
+
export declare function logMessage(name: string, value: any): void;
|
|
652
632
|
//#endregion
|
|
653
633
|
//#region src/utils/index.d.ts
|
|
654
634
|
declare function disposeObject3D(object: TresObject): void;
|
|
@@ -664,8 +644,8 @@ interface Vector3PropInterface extends Vector2PropInterface {
|
|
|
664
644
|
z?: number;
|
|
665
645
|
}
|
|
666
646
|
type VectorFlexibleParams = Vector3 | number[] | Vector3PropInterface | number;
|
|
667
|
-
declare function normalizeVectorFlexibleParam(value: VectorFlexibleParams): Array<number>;
|
|
668
|
-
declare function normalizeColor(value: Color | Array<number> | string | number | ColorRepresentation): Color;
|
|
647
|
+
export declare function normalizeVectorFlexibleParam(value: VectorFlexibleParams): Array<number>;
|
|
648
|
+
export declare function normalizeColor(value: Color | Array<number> | string | number | ColorRepresentation): Color;
|
|
669
649
|
//#endregion
|
|
670
650
|
//#region src/utils/template-compiler-options.d.ts
|
|
671
651
|
declare const templateCompilerOptions: {
|
|
@@ -713,17 +693,17 @@ type ContextEmits = {
|
|
|
713
693
|
render: [context: TresContext];
|
|
714
694
|
beforeLoop: [context: TresContextWithClock];
|
|
715
695
|
loop: [context: TresContextWithClock];
|
|
716
|
-
} & { [key in TresPointerEventName]: [event: TresPointerEvent] };
|
|
696
|
+
} & { [key in TresPointerEventName]: [event: TresPointerEvent]; };
|
|
717
697
|
type __VLS_Props$1 = ContextProps & {
|
|
718
698
|
canvas: HTMLCanvasElement;
|
|
719
699
|
};
|
|
720
700
|
type __VLS_Slots$2 = {
|
|
721
701
|
default: () => any;
|
|
722
702
|
};
|
|
723
|
-
declare const __VLS_base$2:
|
|
724
|
-
context:
|
|
703
|
+
declare const __VLS_base$2: import("vue").DefineComponent<__VLS_Props$1, {
|
|
704
|
+
context: import("vue").ShallowRef<TresContext, TresContext>;
|
|
725
705
|
dispose: () => void;
|
|
726
|
-
}, {}, {}, {},
|
|
706
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
727
707
|
render: (context: TresContext) => any;
|
|
728
708
|
click: (event: TresPointerEvent) => any;
|
|
729
709
|
contextmenu: (event: TresPointerEvent) => any;
|
|
@@ -743,7 +723,7 @@ declare const __VLS_base$2: vue20.DefineComponent<__VLS_Props$1, {
|
|
|
743
723
|
pointermissed: (event: TresPointerEvent) => any;
|
|
744
724
|
beforeLoop: (context: TresContextWithClock) => any;
|
|
745
725
|
loop: (context: TresContextWithClock) => any;
|
|
746
|
-
}, string,
|
|
726
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
747
727
|
onRender?: ((context: TresContext) => any) | undefined;
|
|
748
728
|
onClick?: ((event: TresPointerEvent) => any) | undefined;
|
|
749
729
|
onContextmenu?: ((event: TresPointerEvent) => any) | undefined;
|
|
@@ -763,7 +743,7 @@ declare const __VLS_base$2: vue20.DefineComponent<__VLS_Props$1, {
|
|
|
763
743
|
onPointermissed?: ((event: TresPointerEvent) => any) | undefined;
|
|
764
744
|
onBeforeLoop?: ((context: TresContextWithClock) => any) | undefined;
|
|
765
745
|
onLoop?: ((context: TresContextWithClock) => any) | undefined;
|
|
766
|
-
}>, {}, {}, {}, {}, string,
|
|
746
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
767
747
|
declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
768
748
|
declare const _default$1: typeof __VLS_export$2;
|
|
769
749
|
type __VLS_WithSlots$2<T, S> = T & {
|
|
@@ -782,7 +762,7 @@ interface TresCanvasInstance {
|
|
|
782
762
|
type __VLS_Slots$1 = {
|
|
783
763
|
default: () => any;
|
|
784
764
|
};
|
|
785
|
-
declare const __VLS_base$1:
|
|
765
|
+
declare const __VLS_base$1: import("vue").DefineComponent<ContextProps, TresCanvasInstance, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
786
766
|
render: (context: TresContext) => any;
|
|
787
767
|
click: (event: TresPointerEvent) => any;
|
|
788
768
|
contextmenu: (event: TresPointerEvent) => any;
|
|
@@ -802,7 +782,7 @@ declare const __VLS_base$1: vue20.DefineComponent<ContextProps, TresCanvasInstan
|
|
|
802
782
|
pointermissed: (event: TresPointerEvent) => any;
|
|
803
783
|
beforeLoop: (context: TresContextWithClock) => any;
|
|
804
784
|
loop: (context: TresContextWithClock) => any;
|
|
805
|
-
}, string,
|
|
785
|
+
}, string, import("vue").PublicProps, Readonly<ContextProps> & Readonly<{
|
|
806
786
|
onRender?: ((context: TresContext) => any) | undefined;
|
|
807
787
|
onClick?: ((event: TresPointerEvent) => any) | undefined;
|
|
808
788
|
onContextmenu?: ((event: TresPointerEvent) => any) | undefined;
|
|
@@ -825,10 +805,10 @@ declare const __VLS_base$1: vue20.DefineComponent<ContextProps, TresCanvasInstan
|
|
|
825
805
|
}>, {
|
|
826
806
|
alpha: boolean;
|
|
827
807
|
logarithmicDepthBuffer: boolean;
|
|
828
|
-
toneMapping:
|
|
808
|
+
toneMapping: import("three").ToneMapping;
|
|
829
809
|
depth: boolean;
|
|
830
810
|
stencil: boolean;
|
|
831
|
-
clearColor:
|
|
811
|
+
clearColor: import("three").ColorRepresentation;
|
|
832
812
|
windowSize: boolean;
|
|
833
813
|
enableProvideBridge: boolean;
|
|
834
814
|
customRendererOptions: TresCustomRendererOptions;
|
|
@@ -837,10 +817,10 @@ declare const __VLS_base$1: vue20.DefineComponent<ContextProps, TresCanvasInstan
|
|
|
837
817
|
failIfMajorPerformanceCaveat: boolean;
|
|
838
818
|
clearAlpha: number;
|
|
839
819
|
shadows: boolean;
|
|
840
|
-
shadowMapType:
|
|
820
|
+
shadowMapType: import("three").ShadowMapType;
|
|
841
821
|
useLegacyLights: boolean;
|
|
842
822
|
renderMode: "always" | "on-demand" | "manual";
|
|
843
|
-
}, {}, {}, {}, string,
|
|
823
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
844
824
|
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
845
825
|
declare const _default: typeof __VLS_export$1;
|
|
846
826
|
type __VLS_WithSlots$1<T, S> = T & {
|
|
@@ -860,7 +840,7 @@ declare var __VLS_7: {};
|
|
|
860
840
|
type __VLS_Slots = {} & {
|
|
861
841
|
default?: (props: typeof __VLS_7) => any;
|
|
862
842
|
};
|
|
863
|
-
declare const __VLS_base:
|
|
843
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
864
844
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
865
845
|
declare const _default$2: typeof __VLS_export;
|
|
866
846
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -870,29 +850,29 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
870
850
|
};
|
|
871
851
|
//#endregion
|
|
872
852
|
//#region src/core/catalogue.d.ts
|
|
873
|
-
declare const catalogue: Ref<TresCatalogue>;
|
|
874
|
-
declare const extend: (objects: any) => any;
|
|
853
|
+
export declare const catalogue: Ref<TresCatalogue>;
|
|
854
|
+
export declare const extend: (objects: any) => any;
|
|
875
855
|
//#endregion
|
|
876
856
|
//#region src/devtools/DevtoolsMessenger.d.ts
|
|
877
|
-
type DevtoolsMessageType = 'performance' | 'context' | 'asset-load';
|
|
878
|
-
interface AssetLoadData {
|
|
857
|
+
export type DevtoolsMessageType = 'performance' | 'context' | 'asset-load';
|
|
858
|
+
export interface AssetLoadData {
|
|
879
859
|
url: string;
|
|
880
860
|
type: string;
|
|
881
861
|
loaded: boolean;
|
|
882
862
|
size: number;
|
|
883
863
|
asset: HTMLImageElement | HTMLScriptElement | HTMLLinkElement | Blob | ArrayBuffer | null;
|
|
884
864
|
}
|
|
885
|
-
interface DevtoolsMessage<T = any> {
|
|
865
|
+
export interface DevtoolsMessage<T = any> {
|
|
886
866
|
type: DevtoolsMessageType;
|
|
887
867
|
data: T;
|
|
888
868
|
timestamp?: number;
|
|
889
869
|
}
|
|
890
|
-
type DevtoolsSubscriber = (message: DevtoolsMessage) => void;
|
|
870
|
+
export type DevtoolsSubscriber = (message: DevtoolsMessage) => void;
|
|
891
871
|
/**
|
|
892
872
|
* Messenger class for communicating with Tres DevTools
|
|
893
873
|
* This class will be attached to window.__TRES__DEVTOOLS__
|
|
894
874
|
*/
|
|
895
|
-
declare class DevtoolsMessenger {
|
|
875
|
+
export declare class DevtoolsMessenger {
|
|
896
876
|
private subscribers;
|
|
897
877
|
private messageQueue;
|
|
898
878
|
private maxQueueSize;
|
|
@@ -929,30 +909,30 @@ declare class DevtoolsMessenger {
|
|
|
929
909
|
}
|
|
930
910
|
//#endregion
|
|
931
911
|
//#region src/devtools/plugin.d.ts
|
|
932
|
-
declare function registerTresDevtools(app: App, tres: TresContext): void;
|
|
912
|
+
export declare function registerTresDevtools(app: App, tres: TresContext): void;
|
|
933
913
|
//#endregion
|
|
934
914
|
//#region src/directives/vDistanceTo.d.ts
|
|
935
|
-
declare const vDistanceTo: {
|
|
915
|
+
export declare const vDistanceTo: {
|
|
936
916
|
updated: (el: TresObject, binding: Ref<TresObject>) => void;
|
|
937
917
|
unmounted: (el: TresObject) => void;
|
|
938
918
|
};
|
|
939
919
|
//#endregion
|
|
940
920
|
//#region src/directives/vLightHelper.d.ts
|
|
941
|
-
declare const vLightHelper: {
|
|
921
|
+
export declare const vLightHelper: {
|
|
942
922
|
mounted: (el: TresObject) => void;
|
|
943
923
|
updated: (el: TresObject) => void;
|
|
944
924
|
unmounted: (el: TresObject) => void;
|
|
945
925
|
};
|
|
946
926
|
//#endregion
|
|
947
927
|
//#region src/directives/vLog.d.ts
|
|
948
|
-
declare const vLog: {
|
|
928
|
+
export declare const vLog: {
|
|
949
929
|
mounted: (el: TresObject, binding: {
|
|
950
930
|
arg: string;
|
|
951
931
|
}) => void;
|
|
952
932
|
};
|
|
953
933
|
//#endregion
|
|
954
934
|
//#region src/utils/createTimer.d.ts
|
|
955
|
-
interface TresTimer {
|
|
935
|
+
export interface TresTimer {
|
|
956
936
|
getDelta: () => number;
|
|
957
937
|
getElapsed: () => number;
|
|
958
938
|
update: () => void;
|
|
@@ -967,7 +947,7 @@ interface TresTimer {
|
|
|
967
947
|
* - On older versions: uses `Clock` with `start`/`stop`.
|
|
968
948
|
*
|
|
969
949
|
*/
|
|
970
|
-
declare function createTimer(): TresTimer;
|
|
950
|
+
export declare function createTimer(): TresTimer;
|
|
971
951
|
//#endregion
|
|
972
952
|
//#region src/utils/is/three.d.ts
|
|
973
953
|
/**
|
|
@@ -985,7 +965,7 @@ declare function createTimer(): TresTimer;
|
|
|
985
965
|
* }
|
|
986
966
|
* ```
|
|
987
967
|
*/
|
|
988
|
-
declare const isObject3D: (value: unknown) => value is Object3D<
|
|
968
|
+
export declare const isObject3D: (value: unknown) => value is Object3D<import("three").Object3DEventMap>;
|
|
989
969
|
/**
|
|
990
970
|
* Type guard to check if a value is a Three.js Mesh
|
|
991
971
|
* @param value - The value to check
|
|
@@ -997,7 +977,7 @@ declare const isObject3D: (value: unknown) => value is Object3D<THREE.Object3DEv
|
|
|
997
977
|
* // TypeScript knows value is Mesh here
|
|
998
978
|
* value.geometry // OK
|
|
999
979
|
*/
|
|
1000
|
-
declare const isMesh: (value: unknown) => value is Mesh<BufferGeometry<
|
|
980
|
+
export declare const isMesh: (value: unknown) => value is Mesh<BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, Material<import("three").MaterialEventMap> | Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>;
|
|
1001
981
|
/**
|
|
1002
982
|
* Type guard to check if a value is a Three.js Camera
|
|
1003
983
|
* @param value - The value to check
|
|
@@ -1013,37 +993,37 @@ declare const isMesh: (value: unknown) => value is Mesh<BufferGeometry<THREE.Nor
|
|
|
1013
993
|
* }
|
|
1014
994
|
* ```
|
|
1015
995
|
*/
|
|
1016
|
-
declare const isCamera: (value: unknown) => value is Camera;
|
|
996
|
+
export declare const isCamera: (value: unknown) => value is Camera;
|
|
1017
997
|
/**
|
|
1018
998
|
* Type guard to check if a value is a Three.js OrthographicCamera
|
|
1019
999
|
* @param value - The value to check
|
|
1020
1000
|
* @returns True if the value is a Three.js OrthographicCamera instance, false otherwise
|
|
1021
1001
|
*/
|
|
1022
|
-
declare const isOrthographicCamera: (value: unknown) => value is OrthographicCamera;
|
|
1002
|
+
export declare const isOrthographicCamera: (value: unknown) => value is OrthographicCamera;
|
|
1023
1003
|
/**
|
|
1024
1004
|
* Type guard to check if a value is a Three.js PerspectiveCamera
|
|
1025
1005
|
* @param value - The value to check
|
|
1026
1006
|
* @returns True if the value is a Three.js PerspectiveCamera instance, false otherwise
|
|
1027
1007
|
*/
|
|
1028
|
-
declare const isPerspectiveCamera: (value: unknown) => value is PerspectiveCamera;
|
|
1008
|
+
export declare const isPerspectiveCamera: (value: unknown) => value is PerspectiveCamera;
|
|
1029
1009
|
/**
|
|
1030
1010
|
* Type guard to check if a value is a Three.js Color
|
|
1031
1011
|
* @param value - The value to check
|
|
1032
1012
|
* @returns True if the value is a Three.js Color instance, false otherwise
|
|
1033
1013
|
*/
|
|
1034
|
-
declare const isColor: (value: unknown) => value is Color;
|
|
1014
|
+
export declare const isColor: (value: unknown) => value is Color;
|
|
1035
1015
|
/**
|
|
1036
1016
|
* Type guard to check if a value is a Three.js ColorRepresentation
|
|
1037
1017
|
* @param value - The value to check
|
|
1038
1018
|
* @returns True if the value is a Three.js ColorRepresentation instance, false otherwise
|
|
1039
1019
|
*/
|
|
1040
|
-
declare const isColorRepresentation: (value: unknown) => value is ColorRepresentation;
|
|
1020
|
+
export declare const isColorRepresentation: (value: unknown) => value is ColorRepresentation;
|
|
1041
1021
|
/**
|
|
1042
1022
|
* Type guard to check if a value is a Three.js Layers
|
|
1043
1023
|
* @param value - The value to check
|
|
1044
1024
|
* @returns True if the value is a Three.js Layers instance, false otherwise
|
|
1045
1025
|
*/
|
|
1046
|
-
declare const isLayers: (value: unknown) => value is Layers;
|
|
1026
|
+
export declare const isLayers: (value: unknown) => value is Layers;
|
|
1047
1027
|
/**
|
|
1048
1028
|
* Type guard to check if a value is a Three.js BufferGeometry
|
|
1049
1029
|
* @param value - The value to check
|
|
@@ -1059,7 +1039,7 @@ declare const isLayers: (value: unknown) => value is Layers;
|
|
|
1059
1039
|
* }
|
|
1060
1040
|
* ```
|
|
1061
1041
|
*/
|
|
1062
|
-
declare const isBufferGeometry: (value: unknown) => value is BufferGeometry<
|
|
1042
|
+
export declare const isBufferGeometry: (value: unknown) => value is BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>;
|
|
1063
1043
|
/**
|
|
1064
1044
|
* Type guard to check if a value is a Three.js Material
|
|
1065
1045
|
* @param value - The value to check
|
|
@@ -1075,7 +1055,7 @@ declare const isBufferGeometry: (value: unknown) => value is BufferGeometry<THRE
|
|
|
1075
1055
|
* }
|
|
1076
1056
|
* ```
|
|
1077
1057
|
*/
|
|
1078
|
-
declare const isMaterial: (value: unknown) => value is Material<
|
|
1058
|
+
export declare const isMaterial: (value: unknown) => value is Material<import("three").MaterialEventMap>;
|
|
1079
1059
|
/**
|
|
1080
1060
|
* Type guard to check if a value is a Three.js Light
|
|
1081
1061
|
* @param value - The value to check
|
|
@@ -1091,7 +1071,7 @@ declare const isMaterial: (value: unknown) => value is Material<THREE.MaterialEv
|
|
|
1091
1071
|
* }
|
|
1092
1072
|
* ```
|
|
1093
1073
|
*/
|
|
1094
|
-
declare const isLight: (value: unknown) => value is Light;
|
|
1074
|
+
export declare const isLight: (value: unknown) => value is Light;
|
|
1095
1075
|
/**
|
|
1096
1076
|
* Type guard to check if a value is a Three.js Fog
|
|
1097
1077
|
* @param value - The value to check
|
|
@@ -1107,7 +1087,7 @@ declare const isLight: (value: unknown) => value is Light;
|
|
|
1107
1087
|
* }
|
|
1108
1088
|
* ```
|
|
1109
1089
|
*/
|
|
1110
|
-
declare const isFog: (value: unknown) => value is Fog;
|
|
1090
|
+
export declare const isFog: (value: unknown) => value is Fog;
|
|
1111
1091
|
/**
|
|
1112
1092
|
* Type guard to check if a value is a Three.js Scene
|
|
1113
1093
|
* @param value - The value to check
|
|
@@ -1123,36 +1103,36 @@ declare const isFog: (value: unknown) => value is Fog;
|
|
|
1123
1103
|
* }
|
|
1124
1104
|
* ```
|
|
1125
1105
|
*/
|
|
1126
|
-
declare const isScene: (value: unknown) => value is Scene<
|
|
1106
|
+
export declare const isScene: (value: unknown) => value is Scene<import("three").Object3DEventMap>;
|
|
1127
1107
|
/**
|
|
1128
1108
|
* Type guard to check if a value is a Three.js Group
|
|
1129
1109
|
* @param value - The value to check
|
|
1130
1110
|
* @returns True if the value is a Three.js Group instance, false otherwise
|
|
1131
1111
|
* ```
|
|
1132
1112
|
*/
|
|
1133
|
-
declare const isGroup: (value: unknown) => value is Group<
|
|
1113
|
+
export declare const isGroup: (value: unknown) => value is Group<import("three").Object3DEventMap>;
|
|
1134
1114
|
//#endregion
|
|
1135
1115
|
//#region src/utils/is/tres.d.ts
|
|
1136
1116
|
interface VectorLike {
|
|
1137
1117
|
set: (...args: any[]) => void;
|
|
1138
1118
|
constructor?: (...args: any[]) => any;
|
|
1139
1119
|
}
|
|
1140
|
-
declare const isVectorLike: (value: unknown) => value is VectorLike;
|
|
1120
|
+
export declare const isVectorLike: (value: unknown) => value is VectorLike;
|
|
1141
1121
|
interface Copyable {
|
|
1142
1122
|
copy: (...args: any[]) => void;
|
|
1143
1123
|
constructor?: (...args: any[]) => any;
|
|
1144
1124
|
}
|
|
1145
|
-
declare const isCopyable: (value: unknown) => value is Copyable;
|
|
1125
|
+
export declare const isCopyable: (value: unknown) => value is Copyable;
|
|
1146
1126
|
interface ClassInstance {
|
|
1147
1127
|
constructor?: (...args: any[]) => any;
|
|
1148
1128
|
}
|
|
1149
|
-
declare const isClassInstance: (object: unknown) => object is ClassInstance;
|
|
1129
|
+
export declare const isClassInstance: (object: unknown) => object is ClassInstance;
|
|
1150
1130
|
/**
|
|
1151
1131
|
* Type guard to check if a value is a TresCamera
|
|
1152
1132
|
* @param value - The value to check
|
|
1153
1133
|
* @returns True if the value is a TresCamera instance, false otherwise
|
|
1154
1134
|
*/
|
|
1155
|
-
declare const isTresCamera: (value: unknown) => value is TresCamera;
|
|
1135
|
+
export declare const isTresCamera: (value: unknown) => value is TresCamera;
|
|
1156
1136
|
/**
|
|
1157
1137
|
* Type guard to check if a value is a TresObject
|
|
1158
1138
|
* @param value - The value to check
|
|
@@ -1169,7 +1149,7 @@ declare const isTresCamera: (value: unknown) => value is TresCamera;
|
|
|
1169
1149
|
* TresObject is a union type that represents the core Three.js objects that can be used in TresJS.
|
|
1170
1150
|
* This includes Object3D, BufferGeometry, Material, and Fog instances.
|
|
1171
1151
|
*/
|
|
1172
|
-
declare const isTresObject: (value: unknown) => value is TresObject;
|
|
1152
|
+
export declare const isTresObject: (value: unknown) => value is TresObject;
|
|
1173
1153
|
/**
|
|
1174
1154
|
* Type guard to check if a value is a TresPrimitive
|
|
1175
1155
|
* @param value - The value to check
|
|
@@ -1186,7 +1166,7 @@ declare const isTresObject: (value: unknown) => value is TresObject;
|
|
|
1186
1166
|
* TresPrimitive is a special type in TresJS that represents primitive objects
|
|
1187
1167
|
* that can be used directly in the scene without needing to be wrapped in a Three.js object.
|
|
1188
1168
|
*/
|
|
1189
|
-
declare const isTresPrimitive: (value: unknown) => value is TresPrimitive;
|
|
1169
|
+
export declare const isTresPrimitive: (value: unknown) => value is TresPrimitive;
|
|
1190
1170
|
/**
|
|
1191
1171
|
* Type guard to check if a value is a TresInstance (has __tres property)
|
|
1192
1172
|
* @param value - The value to check
|
|
@@ -1200,7 +1180,7 @@ declare const isTresPrimitive: (value: unknown) => value is TresPrimitive;
|
|
|
1200
1180
|
* }
|
|
1201
1181
|
* ```
|
|
1202
1182
|
*/
|
|
1203
|
-
declare const isTresInstance: (value: unknown) => value is TresInstance;
|
|
1183
|
+
export declare const isTresInstance: (value: unknown) => value is TresInstance;
|
|
1204
1184
|
/**
|
|
1205
1185
|
* Type guard to check if a value is a Three.js WebGPU `Renderer`.
|
|
1206
1186
|
*
|
|
@@ -1219,25 +1199,25 @@ declare const isTresInstance: (value: unknown) => value is TresInstance;
|
|
|
1219
1199
|
* }
|
|
1220
1200
|
* ```
|
|
1221
1201
|
*/
|
|
1222
|
-
declare const isWebGPURenderer: (value: unknown) => value is Renderer;
|
|
1202
|
+
export declare const isWebGPURenderer: (value: unknown) => value is Renderer;
|
|
1223
1203
|
/**
|
|
1224
1204
|
* Type guard to check if a value is a Three.js `WebGLRenderer`.
|
|
1225
1205
|
* @param value - The value to check
|
|
1226
1206
|
* @returns True if the value is a `WebGLRenderer` instance, false otherwise
|
|
1227
1207
|
* @see {@link isWebGPURenderer}
|
|
1228
1208
|
*/
|
|
1229
|
-
declare const isWebGLRenderer: (value: unknown) => value is WebGLRenderer & {
|
|
1209
|
+
export declare const isWebGLRenderer: (value: unknown) => value is WebGLRenderer & {
|
|
1230
1210
|
isWebGLRenderer: true;
|
|
1231
1211
|
};
|
|
1232
1212
|
//#endregion
|
|
1233
1213
|
//#region src/index.d.ts
|
|
1234
|
-
interface TresOptions {
|
|
1214
|
+
export interface TresOptions {
|
|
1235
1215
|
extends?: Record<string, unknown>;
|
|
1236
1216
|
}
|
|
1237
|
-
interface TresPlugin {
|
|
1217
|
+
export interface TresPlugin {
|
|
1238
1218
|
[key: string]: any;
|
|
1239
1219
|
install: (app: App, options?: TresOptions) => void;
|
|
1240
1220
|
}
|
|
1241
1221
|
declare const plugin: TresPlugin;
|
|
1242
1222
|
//#endregion
|
|
1243
|
-
export {
|
|
1223
|
+
export { _default as TresCanvas, _default$1 as TresCanvasContext, type TresCanvasEmits, type TresCanvasInstance, type TresCanvasProps, type TresContext, type TresCustomRendererOptions, type TresPointerEvent, _default$2 as TresPortal, _default$3 as UseLoader, type VectorFlexibleParams, plugin as default, disposeObject3D as dispose, templateCompilerOptions, useTresContext, useTresContextProvider };
|