@tresjs/core 5.0.0-next.0 → 5.0.0-next.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/src/components/TresCanvas.vue.d.ts +66 -64
- package/dist/src/composables/index.d.ts +4 -9
- package/dist/src/composables/useCamera/index.d.ts +42 -8555
- package/dist/src/composables/useEventManager/index.d.ts +10 -0
- package/dist/src/composables/useLoader/index.d.ts +1 -0
- package/dist/src/composables/useRenderer/useRendererManager.d.ts +187 -0
- package/dist/src/composables/useTres/index.d.ts +37 -0
- package/dist/src/composables/useTresContextProvider/index.d.ts +10 -60
- package/dist/src/core/loop.d.ts +0 -2
- package/dist/src/devtools/inspectorHandlers.d.ts +60 -0
- package/dist/src/devtools/plugin.d.ts +3 -7
- package/dist/src/devtools/setupDevtools.d.ts +13 -1
- package/dist/src/devtools/types.d.ts +90 -0
- package/dist/src/types/index.d.ts +3 -69
- package/dist/src/utils/createPriorityEventHook.d.ts +1 -1
- package/dist/src/utils/is.d.ts +47 -3
- package/dist/src/utils/pointerEvents.d.ts +10 -0
- package/dist/tres.js +2582 -1998
- package/package.json +6 -3
- package/dist/src/composables/useRaycaster/index.d.ts +0 -16
- package/dist/src/composables/useRenderer/const.d.ts +0 -18
- package/dist/src/composables/useRenderer/index.d.ts +0 -91
- package/dist/src/composables/useSeek/index.d.ts +0 -20
- package/dist/src/composables/useTexture/component.vue.d.ts +0 -29
- package/dist/src/composables/useTexture/index.d.ts +0 -103
- package/dist/src/composables/useTresEventManager/index.d.ts +0 -25
- package/dist/src/composables/useTresReady/createReadyEventHook/index.d.ts +0 -4
- package/dist/src/composables/useTresReady/index.d.ts +0 -7
package/dist/src/utils/is.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TresObject, TresPrimitive } from 'src/types';
|
|
2
|
-
import { BufferGeometry,
|
|
1
|
+
import { TresCamera, TresInstance, TresObject, TresPrimitive } from 'src/types';
|
|
2
|
+
import { BufferGeometry, Color, ColorRepresentation, Fog, Light, Material, Object3D, OrthographicCamera, PerspectiveCamera, Scene, Layers } from 'three';
|
|
3
3
|
/**
|
|
4
4
|
* Type guard to check if a value is undefined
|
|
5
5
|
* @param value - The value to check
|
|
@@ -134,7 +134,36 @@ export declare function isObject3D(value: unknown): value is Object3D;
|
|
|
134
134
|
* }
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
|
-
export declare function isCamera(value: unknown): value is
|
|
137
|
+
export declare function isCamera(value: unknown): value is TresCamera;
|
|
138
|
+
export declare function isColor(value: unknown): value is Color;
|
|
139
|
+
export declare function isColorRepresentation(value: unknown): value is ColorRepresentation;
|
|
140
|
+
interface VectorLike {
|
|
141
|
+
set: (...args: any[]) => void;
|
|
142
|
+
constructor?: (...args: any[]) => any;
|
|
143
|
+
}
|
|
144
|
+
export declare function isVectorLike(value: unknown): value is VectorLike;
|
|
145
|
+
interface Copyable {
|
|
146
|
+
copy: (...args: any[]) => void;
|
|
147
|
+
constructor?: (...args: any[]) => any;
|
|
148
|
+
}
|
|
149
|
+
export declare function isCopyable(value: unknown): value is Copyable;
|
|
150
|
+
interface ClassInstance {
|
|
151
|
+
constructor?: (...args: any[]) => any;
|
|
152
|
+
}
|
|
153
|
+
export declare function isClassInstance(object: unknown): object is ClassInstance;
|
|
154
|
+
export declare function isLayers(value: unknown): value is Layers;
|
|
155
|
+
/**
|
|
156
|
+
* Type guard to check if a value is a Three.js OrthographicCamera
|
|
157
|
+
* @param value - The value to check
|
|
158
|
+
* @returns True if the value is a Three.js OrthographicCamera instance, false otherwise
|
|
159
|
+
*/
|
|
160
|
+
export declare function isOrthographicCamera(value: unknown): value is OrthographicCamera;
|
|
161
|
+
/**
|
|
162
|
+
* Type guard to check if a value is a Three.js PerspectiveCamera
|
|
163
|
+
* @param value - The value to check
|
|
164
|
+
* @returns True if the value is a Three.js PerspectiveCamera instance, false otherwise
|
|
165
|
+
*/
|
|
166
|
+
export declare function isPerspectiveCamera(value: unknown): value is PerspectiveCamera;
|
|
138
167
|
/**
|
|
139
168
|
* Type guard to check if a value is a Three.js BufferGeometry
|
|
140
169
|
* @param value - The value to check
|
|
@@ -249,3 +278,18 @@ export declare function isTresObject(value: unknown): value is TresObject;
|
|
|
249
278
|
* that can be used directly in the scene without needing to be wrapped in a Three.js object.
|
|
250
279
|
*/
|
|
251
280
|
export declare function isTresPrimitive(value: unknown): value is TresPrimitive;
|
|
281
|
+
/**
|
|
282
|
+
* Type guard to check if a value is a TresInstance (has __tres property)
|
|
283
|
+
* @param value - The value to check
|
|
284
|
+
* @returns True if the value is a TresInstance (has __tres property), false otherwise
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* const value = new THREE.Mesh()
|
|
288
|
+
* if (isTresInstance(value)) {
|
|
289
|
+
* // TypeScript knows value is TresInstance here
|
|
290
|
+
* // You can safely access value.__tres
|
|
291
|
+
* }
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
export declare function isTresInstance(value: unknown): value is TresInstance;
|
|
295
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
};
|