@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.
- package/dist/chunk-QpvadvMP.js +30 -0
- package/dist/template-compiler-options.d.mts +17 -0
- package/dist/template-compiler-options.mjs +18 -0
- package/dist/tres.d.ts +1056 -0
- package/dist/tres.js +2349 -5573
- package/package.json +21 -26
- package/components.d.ts +0 -1
- package/composables.d.ts +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/src/components/TresCanvas.vue.d.ts +0 -94
- package/dist/src/components/index.d.ts +0 -2
- package/dist/src/composables/index.d.ts +0 -9
- package/dist/src/composables/useCamera/index.d.ts +0 -43
- package/dist/src/composables/useCreateRafLoop/index.d.ts +0 -14
- package/dist/src/composables/useEventManager/index.d.ts +0 -10
- package/dist/src/composables/useGraph/index.d.ts +0 -3
- package/dist/src/composables/useLoader/component.vue.d.ts +0 -38
- package/dist/src/composables/useLoader/index.d.ts +0 -51
- package/dist/src/composables/useLoop/index.d.ts +0 -14
- package/dist/src/composables/useRenderer/pixelRatio.d.ts +0 -4
- package/dist/src/composables/useRenderer/useRendererManager.d.ts +0 -194
- package/dist/src/composables/useSizes/index.d.ts +0 -11
- package/dist/src/composables/useTres/index.d.ts +0 -37
- package/dist/src/composables/useTresContextProvider/index.d.ts +0 -24
- package/dist/src/core/catalogue.d.ts +0 -9
- package/dist/src/core/nodeOps.d.ts +0 -4
- package/dist/src/core/revision.d.ts +0 -1
- package/dist/src/devtools/DevtoolsMessenger.d.ts +0 -53
- package/dist/src/devtools/highlight.d.ts +0 -7
- package/dist/src/devtools/index.d.ts +0 -2
- package/dist/src/devtools/inspectorHandlers.d.ts +0 -60
- package/dist/src/devtools/plugin.d.ts +0 -10
- package/dist/src/devtools/setupDevtools.d.ts +0 -14
- package/dist/src/devtools/types.d.ts +0 -90
- package/dist/src/devtools/utils.d.ts +0 -7
- package/dist/src/directives/index.d.ts +0 -4
- package/dist/src/directives/vDistanceTo.d.ts +0 -6
- package/dist/src/directives/vLightHelper.d.ts +0 -6
- package/dist/src/directives/vLog.d.ts +0 -6
- package/dist/src/index.d.ts +0 -25
- package/dist/src/types/index.d.ts +0 -137
- package/dist/src/utils/array.d.ts +0 -6
- package/dist/src/utils/createPriorityEventHook.d.ts +0 -15
- package/dist/src/utils/graph.d.ts +0 -15
- package/dist/src/utils/index.d.ts +0 -19
- package/dist/src/utils/is/dom.d.ts +0 -1
- package/dist/src/utils/is/index.d.ts +0 -4
- package/dist/src/utils/is/three.d.ts +0 -162
- package/dist/src/utils/is/tres.d.ts +0 -70
- package/dist/src/utils/is/typed.d.ts +0 -1
- package/dist/src/utils/is/util.d.ts +0 -1
- package/dist/src/utils/logger.d.ts +0 -25
- package/dist/src/utils/makeMap.d.ts +0 -9
- package/dist/src/utils/normalize.d.ts +0 -17
- package/dist/src/utils/perf.d.ts +0 -7
- package/dist/src/utils/pointerEvents.d.ts +0 -10
- package/dist/src/utils/primitive/createRetargetingProxy.d.ts +0 -1
- package/dist/src/utils/string.d.ts +0 -1
- package/dist/src/utils/template-compiler-options.d.ts +0 -8
- package/dist/src/utils/test-utils.d.ts +0 -2
- package/dist/src/utils/three.d.ts +0 -9
- package/types.d.ts +0 -1
- package/utils.d.ts +0 -1
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { BufferGeometry, Camera, Color, ColorRepresentation, Fog, Group, Light, Material, Mesh, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Layers } from 'three';
|
|
2
|
-
/**
|
|
3
|
-
* Type guard to check if a value is a Three.js Object3D
|
|
4
|
-
* @param value - The value to check
|
|
5
|
-
* @returns True if the value is a Three.js Object3D instance, false otherwise
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const value = new THREE.Object3D()
|
|
9
|
-
* if (isObject3D(value)) {
|
|
10
|
-
* // TypeScript knows value is Object3D here
|
|
11
|
-
* value.position // OK
|
|
12
|
-
* value.rotation // OK
|
|
13
|
-
* value.scale // OK
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare const isObject3D: (value: unknown) => value is Object3D<import('three').Object3DEventMap>;
|
|
18
|
-
/**
|
|
19
|
-
* Type guard to check if a value is a Three.js Mesh
|
|
20
|
-
* @param value - The value to check
|
|
21
|
-
* @returns True if the value is a Three.js Mesh instance, false otherwise
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const value = new THREE.Mesh()
|
|
25
|
-
* if (isMesh(value)) {
|
|
26
|
-
* // TypeScript knows value is Mesh here
|
|
27
|
-
* value.geometry // OK
|
|
28
|
-
*/
|
|
29
|
-
export declare const isMesh: (value: unknown) => value is Mesh<BufferGeometry<import('three').NormalBufferAttributes, import('three').BufferGeometryEventMap>, Material | Material[], import('three').Object3DEventMap>;
|
|
30
|
-
/**
|
|
31
|
-
* Type guard to check if a value is a Three.js Camera
|
|
32
|
-
* @param value - The value to check
|
|
33
|
-
* @returns True if the value is a Three.js Camera instance, false otherwise
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const value = new THREE.PerspectiveCamera()
|
|
37
|
-
* if (isCamera(value)) {
|
|
38
|
-
* // TypeScript knows value is Camera here
|
|
39
|
-
* value.fov // OK
|
|
40
|
-
* value.near // OK
|
|
41
|
-
* value.far // OK
|
|
42
|
-
* }
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare const isCamera: (value: unknown) => value is Camera;
|
|
46
|
-
/**
|
|
47
|
-
* Type guard to check if a value is a Three.js OrthographicCamera
|
|
48
|
-
* @param value - The value to check
|
|
49
|
-
* @returns True if the value is a Three.js OrthographicCamera instance, false otherwise
|
|
50
|
-
*/
|
|
51
|
-
export declare const isOrthographicCamera: (value: unknown) => value is OrthographicCamera;
|
|
52
|
-
/**
|
|
53
|
-
* Type guard to check if a value is a Three.js PerspectiveCamera
|
|
54
|
-
* @param value - The value to check
|
|
55
|
-
* @returns True if the value is a Three.js PerspectiveCamera instance, false otherwise
|
|
56
|
-
*/
|
|
57
|
-
export declare const isPerspectiveCamera: (value: unknown) => value is PerspectiveCamera;
|
|
58
|
-
/**
|
|
59
|
-
* Type guard to check if a value is a Three.js Color
|
|
60
|
-
* @param value - The value to check
|
|
61
|
-
* @returns True if the value is a Three.js Color instance, false otherwise
|
|
62
|
-
*/
|
|
63
|
-
export declare const isColor: (value: unknown) => value is Color;
|
|
64
|
-
/**
|
|
65
|
-
* Type guard to check if a value is a Three.js ColorRepresentation
|
|
66
|
-
* @param value - The value to check
|
|
67
|
-
* @returns True if the value is a Three.js ColorRepresentation instance, false otherwise
|
|
68
|
-
*/
|
|
69
|
-
export declare const isColorRepresentation: (value: unknown) => value is ColorRepresentation;
|
|
70
|
-
/**
|
|
71
|
-
* Type guard to check if a value is a Three.js Layers
|
|
72
|
-
* @param value - The value to check
|
|
73
|
-
* @returns True if the value is a Three.js Layers instance, false otherwise
|
|
74
|
-
*/
|
|
75
|
-
export declare const isLayers: (value: unknown) => value is Layers;
|
|
76
|
-
/**
|
|
77
|
-
* Type guard to check if a value is a Three.js BufferGeometry
|
|
78
|
-
* @param value - The value to check
|
|
79
|
-
* @returns True if the value is a Three.js BufferGeometry instance, false otherwise
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* const value = new THREE.BufferGeometry()
|
|
83
|
-
* if (isBufferGeometry(value)) {
|
|
84
|
-
* // TypeScript knows value is BufferGeometry here
|
|
85
|
-
* value.attributes // OK
|
|
86
|
-
* value.index // OK
|
|
87
|
-
* value.computeVertexNormals() // OK
|
|
88
|
-
* }
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
export declare const isBufferGeometry: (value: unknown) => value is BufferGeometry<import('three').NormalBufferAttributes, import('three').BufferGeometryEventMap>;
|
|
92
|
-
/**
|
|
93
|
-
* Type guard to check if a value is a Three.js Material
|
|
94
|
-
* @param value - The value to check
|
|
95
|
-
* @returns True if the value is a Three.js Material instance, false otherwise
|
|
96
|
-
* @example
|
|
97
|
-
* ```ts
|
|
98
|
-
* const value = new THREE.MeshStandardMaterial()
|
|
99
|
-
* if (isMaterial(value)) {
|
|
100
|
-
* // TypeScript knows value is Material here
|
|
101
|
-
* value.color // OK
|
|
102
|
-
* value.metalness // OK
|
|
103
|
-
* value.roughness // OK
|
|
104
|
-
* }
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
export declare const isMaterial: (value: unknown) => value is Material;
|
|
108
|
-
/**
|
|
109
|
-
* Type guard to check if a value is a Three.js Light
|
|
110
|
-
* @param value - The value to check
|
|
111
|
-
* @returns True if the value is a Three.js Light instance, false otherwise
|
|
112
|
-
* @example
|
|
113
|
-
* ```ts
|
|
114
|
-
* const value = new THREE.DirectionalLight()
|
|
115
|
-
* if (isLight(value)) {
|
|
116
|
-
* // TypeScript knows value is Light here
|
|
117
|
-
* value.intensity // OK
|
|
118
|
-
* value.color // OK
|
|
119
|
-
* value.position // OK
|
|
120
|
-
* }
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
export declare const isLight: (value: unknown) => value is Light<import('three').LightShadow<Camera> | undefined>;
|
|
124
|
-
/**
|
|
125
|
-
* Type guard to check if a value is a Three.js Fog
|
|
126
|
-
* @param value - The value to check
|
|
127
|
-
* @returns True if the value is a Three.js Fog instance, false otherwise
|
|
128
|
-
* @example
|
|
129
|
-
* ```ts
|
|
130
|
-
* const value = new THREE.Fog(0x000000, 1, 1000)
|
|
131
|
-
* if (isFog(value)) {
|
|
132
|
-
* // TypeScript knows value is Fog here
|
|
133
|
-
* value.color // OK
|
|
134
|
-
* value.near // OK
|
|
135
|
-
* value.far // OK
|
|
136
|
-
* }
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
139
|
-
export declare const isFog: (value: unknown) => value is Fog;
|
|
140
|
-
/**
|
|
141
|
-
* Type guard to check if a value is a Three.js Scene
|
|
142
|
-
* @param value - The value to check
|
|
143
|
-
* @returns True if the value is a Three.js Scene instance, false otherwise
|
|
144
|
-
* @example
|
|
145
|
-
* ```ts
|
|
146
|
-
* const value = new THREE.Scene()
|
|
147
|
-
* if (isScene(value)) {
|
|
148
|
-
* // TypeScript knows value is Scene here
|
|
149
|
-
* value.children // OK
|
|
150
|
-
* value.add(new THREE.Object3D()) // OK
|
|
151
|
-
* value.remove(new THREE.Object3D()) // OK
|
|
152
|
-
* }
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
|
-
export declare const isScene: (value: unknown) => value is Scene;
|
|
156
|
-
/**
|
|
157
|
-
* Type guard to check if a value is a Three.js Group
|
|
158
|
-
* @param value - The value to check
|
|
159
|
-
* @returns True if the value is a Three.js Group instance, false otherwise
|
|
160
|
-
* ```
|
|
161
|
-
*/
|
|
162
|
-
export declare const isGroup: (value: unknown) => value is Group<import('three').Object3DEventMap>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { TresCamera, TresInstance, TresObject, TresPrimitive } from '../../types';
|
|
2
|
-
interface VectorLike {
|
|
3
|
-
set: (...args: any[]) => void;
|
|
4
|
-
constructor?: (...args: any[]) => any;
|
|
5
|
-
}
|
|
6
|
-
export declare const isVectorLike: (value: unknown) => value is VectorLike;
|
|
7
|
-
interface Copyable {
|
|
8
|
-
copy: (...args: any[]) => void;
|
|
9
|
-
constructor?: (...args: any[]) => any;
|
|
10
|
-
}
|
|
11
|
-
export declare const isCopyable: (value: unknown) => value is Copyable;
|
|
12
|
-
interface ClassInstance {
|
|
13
|
-
constructor?: (...args: any[]) => any;
|
|
14
|
-
}
|
|
15
|
-
export declare const isClassInstance: (object: unknown) => object is ClassInstance;
|
|
16
|
-
/**
|
|
17
|
-
* Type guard to check if a value is a TresCamera
|
|
18
|
-
* @param value - The value to check
|
|
19
|
-
* @returns True if the value is a TresCamera instance, false otherwise
|
|
20
|
-
*/
|
|
21
|
-
export declare const isTresCamera: (value: unknown) => value is TresCamera;
|
|
22
|
-
/**
|
|
23
|
-
* Type guard to check if a value is a TresObject
|
|
24
|
-
* @param value - The value to check
|
|
25
|
-
* @returns True if the value is a TresObject (Object3D | BufferGeometry | Material | Fog), false otherwise
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const value = new THREE.Mesh()
|
|
29
|
-
* if (isTresObject(value)) {
|
|
30
|
-
* // TypeScript knows value is TresObject here
|
|
31
|
-
* // You can use common properties and methods shared by all TresObjects
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
* @remarks
|
|
35
|
-
* TresObject is a union type that represents the core Three.js objects that can be used in TresJS.
|
|
36
|
-
* This includes Object3D, BufferGeometry, Material, and Fog instances.
|
|
37
|
-
*/
|
|
38
|
-
export declare const isTresObject: (value: unknown) => value is TresObject;
|
|
39
|
-
/**
|
|
40
|
-
* Type guard to check if a value is a TresPrimitive
|
|
41
|
-
* @param value - The value to check
|
|
42
|
-
* @returns True if the value is a TresPrimitive instance, false otherwise
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* const value = { isPrimitive: true }
|
|
46
|
-
* if (isTresPrimitive(value)) {
|
|
47
|
-
* // TypeScript knows value is TresPrimitive here
|
|
48
|
-
* // You can use properties and methods specific to TresPrimitives
|
|
49
|
-
* }
|
|
50
|
-
* ```
|
|
51
|
-
* @remarks
|
|
52
|
-
* TresPrimitive is a special type in TresJS that represents primitive objects
|
|
53
|
-
* that can be used directly in the scene without needing to be wrapped in a Three.js object.
|
|
54
|
-
*/
|
|
55
|
-
export declare const isTresPrimitive: (value: unknown) => value is TresPrimitive;
|
|
56
|
-
/**
|
|
57
|
-
* Type guard to check if a value is a TresInstance (has __tres property)
|
|
58
|
-
* @param value - The value to check
|
|
59
|
-
* @returns True if the value is a TresInstance (has __tres property), false otherwise
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* const value = new THREE.Mesh()
|
|
63
|
-
* if (isTresInstance(value)) {
|
|
64
|
-
* // TypeScript knows value is TresInstance here
|
|
65
|
-
* // You can safely access value.__tres
|
|
66
|
-
* }
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare const isTresInstance: (value: unknown) => value is TresInstance;
|
|
70
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isBoolean, isEqual, isFunction, isNumber, isObject, isString, isUndefined } from 'radashi';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createTypeGuard: <T>(property: keyof T) => (value: unknown) => value is T;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger utility for TresJS
|
|
3
|
-
* @module logger
|
|
4
|
-
*/
|
|
5
|
-
export declare const isProd: boolean;
|
|
6
|
-
type OneOrMore<T> = {
|
|
7
|
-
0: T;
|
|
8
|
-
} & Array<T>;
|
|
9
|
-
/**
|
|
10
|
-
* Logs an error message with the TresJS prefix
|
|
11
|
-
* @param args - Arguments to log
|
|
12
|
-
*/
|
|
13
|
-
export declare function logError(...args: OneOrMore<any>): void;
|
|
14
|
-
/**
|
|
15
|
-
* Logs a warning message with the TresJS prefix
|
|
16
|
-
* @param args - Arguments to log
|
|
17
|
-
*/
|
|
18
|
-
export declare function logWarning(...args: OneOrMore<any>): void;
|
|
19
|
-
/**
|
|
20
|
-
* Logs a message with the TresJS prefix (only in development mode)
|
|
21
|
-
* @param name - Name of the message
|
|
22
|
-
* @param value - Value to log
|
|
23
|
-
*/
|
|
24
|
-
export declare function logMessage(name: string, value: any): void;
|
|
25
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make a map and return a function for checking if a key
|
|
3
|
-
* is in that map.
|
|
4
|
-
* IMPORTANT: all calls of this function must be prefixed with
|
|
5
|
-
* \/\*#\_\_PURE\_\_\*\/
|
|
6
|
-
* So that rollup can tree-shake them if necessary.
|
|
7
|
-
*/
|
|
8
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
9
|
-
export declare function makeMap(str: string): (key: string) => boolean;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ColorRepresentation, Color, Vector3 } from 'three';
|
|
2
|
-
export type SizeFlexibleParams = number[] | {
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
};
|
|
6
|
-
export interface Vector2PropInterface {
|
|
7
|
-
x?: number;
|
|
8
|
-
y?: number;
|
|
9
|
-
width?: number;
|
|
10
|
-
height?: number;
|
|
11
|
-
}
|
|
12
|
-
export interface Vector3PropInterface extends Vector2PropInterface {
|
|
13
|
-
z?: number;
|
|
14
|
-
}
|
|
15
|
-
export type VectorFlexibleParams = Vector3 | number[] | Vector3PropInterface | number;
|
|
16
|
-
export declare function normalizeVectorFlexibleParam(value: VectorFlexibleParams): Array<number>;
|
|
17
|
-
export declare function normalizeColor(value: Color | Array<number> | string | number | ColorRepresentation): Color;
|
package/dist/src/utils/perf.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Scene } from 'three';
|
|
2
|
-
import { TresObject } from './../types';
|
|
3
|
-
export declare function calculateMemoryUsage(object: TresObject | Scene): number;
|
|
4
|
-
export declare function boundedPush<T>(arr: T[], value: T, max: number): void;
|
|
5
|
-
export declare function bytesToKB(bytes: number): string;
|
|
6
|
-
export declare function bytesToMB(bytes: number): string;
|
|
7
|
-
export declare function bytesToGB(bytes: number): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PointerEvent } from '@pmndrs/pointer-events';
|
|
2
|
-
export declare const supportedPointerEvents: readonly ["onClick", "onContextmenu", "onPointermove", "onPointerenter", "onPointerleave", "onPointerover", "onPointerout", "onDblclick", "onPointerdown", "onPointerup", "onPointercancel", "onLostpointercapture", "onWheel"];
|
|
3
|
-
export type SupportedVuePointerEvent = typeof supportedPointerEvents[number];
|
|
4
|
-
export type TresPointerEventName = 'click' | 'contextmenu' | 'pointermove' | 'pointerenter' | 'pointerleave' | 'pointerover' | 'pointerout' | 'dblclick' | 'pointerdown' | 'pointerup' | 'pointercancel' | 'lostpointercapture' | 'wheel';
|
|
5
|
-
export declare const pointerEventsMapVueToThree: Record<SupportedVuePointerEvent, TresPointerEventName>;
|
|
6
|
-
export declare const isSupportedPointerEvent: (event: string) => event is SupportedVuePointerEvent;
|
|
7
|
-
export type TresPointerEvent = PointerEvent<MouseEvent>;
|
|
8
|
-
export type PointerEventHandlers = {
|
|
9
|
-
[key in SupportedVuePointerEvent]: (event: TresPointerEvent) => void;
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function createRetargetingProxy<T extends Record<string | number | symbol, any>, K extends keyof T & string & symbol>(target: T, getters?: Record<string | number | symbol, (t: T) => unknown>, setters?: Record<K, (val: T[K], t: T, proxy: T, setTarget: (newTarget: T) => void) => boolean>): T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { camel } from 'radashi';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
2
|
-
/**
|
|
3
|
-
* Recursively searches for an Object3D with the specified UUID within a Three.js scene graph.
|
|
4
|
-
*
|
|
5
|
-
* @param node - The root Object3D to start searching from
|
|
6
|
-
* @param uuid - The unique identifier of the object to find
|
|
7
|
-
* @returns The Object3D with the matching UUID, or undefined if not found
|
|
8
|
-
*/
|
|
9
|
-
export declare const getObjectByUuid: (node: Object3D, uuid: string) => Object3D | undefined;
|
package/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/src/types/index.js'
|
package/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../../dist/src/utils/index.js'
|