@tresjs/core 3.8.1 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/TresCanvas.vue.d.ts +5 -5
- package/dist/src/composables/useCamera/index.d.ts +2412 -2412
- package/dist/src/composables/useLoader/index.d.ts +2 -2
- package/dist/src/composables/usePointerEventHandler/index.d.ts +1 -1
- package/dist/src/composables/useRaycaster/index.d.ts +1 -1
- package/dist/src/composables/useRenderer/index.d.ts +1 -7
- package/dist/src/composables/useSeek/index.d.ts +1 -1
- package/dist/src/composables/useSizes/index.d.ts +1 -1
- package/dist/src/core/renderer.d.ts +1 -1
- package/dist/src/directives/index.d.ts +2 -1
- package/dist/src/directives/vRotate.d.ts +13 -0
- package/dist/src/types/index.d.ts +4 -4
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/normalize.d.ts +1 -1
- package/dist/tres.js +274 -258
- package/dist/tres.umd.cjs +2 -2
- package/package.json +24 -20
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Loader, Object3D } from 'three';
|
|
2
2
|
|
|
3
3
|
export interface TresLoader<T> extends Loader {
|
|
4
|
-
load(url: string, onLoad?: (result: T) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void)
|
|
5
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void)
|
|
4
|
+
load: (url: string, onLoad?: (result: T) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void) => unknown;
|
|
5
|
+
loadAsync: (url: string, onProgress?: (event: ProgressEvent) => void) => Promise<T>;
|
|
6
6
|
}
|
|
7
7
|
export type LoaderProto<T> = new (...args: any) => TresLoader<T extends unknown ? any : T>;
|
|
8
8
|
export type LoaderReturnType<T, L extends LoaderProto<T>> = T extends unknown ? Awaited<ReturnType<InstanceType<L>['loadAsync']>> : T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TresContext } from '../useTresContextProvider';
|
|
2
2
|
import { TresScene } from 'src/types';
|
|
3
|
-
import {
|
|
3
|
+
import { Event, Intersection, Object3D } from 'three';
|
|
4
4
|
|
|
5
5
|
type CallbackFn = (intersection: Intersection<Object3D<Event>>, event: PointerEvent) => void;
|
|
6
6
|
type CallbackFnPointerLeave = (object: Object3D<Event>, event: PointerEvent) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TresContext } from '../useTresContextProvider';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { Intersection, Object3D, Object3DEventMap } from 'three';
|
|
4
4
|
|
|
5
5
|
export type Intersects = Intersection<Object3D<Object3DEventMap>>[];
|
|
6
6
|
interface PointerMoveEventPayload {
|
|
@@ -3,7 +3,7 @@ import { TresContext } from '../useTresContextProvider';
|
|
|
3
3
|
import { TresColor } from '../../types';
|
|
4
4
|
import { MaybeRefOrGetter } from '@vueuse/core';
|
|
5
5
|
import { MaybeRef } from 'vue';
|
|
6
|
-
import { WebGLRenderer,
|
|
6
|
+
import { WebGLRenderer, ColorSpace, Scene, ShadowMapType, ToneMapping, WebGLRendererParameters } from 'three';
|
|
7
7
|
|
|
8
8
|
type TransformToMaybeRefOrGetter<T> = {
|
|
9
9
|
[K in keyof T]: MaybeRefOrGetter<T[K]> | MaybeRefOrGetter<T[K]>;
|
|
@@ -70,12 +70,6 @@ export interface UseRendererOptions extends TransformToMaybeRefOrGetter<WebGLRen
|
|
|
70
70
|
windowSize?: MaybeRefOrGetter<boolean | string>;
|
|
71
71
|
preset?: MaybeRefOrGetter<RendererPresetsType>;
|
|
72
72
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Reactive three.js WebGLRenderer instance
|
|
75
|
-
*
|
|
76
|
-
* @param canvas
|
|
77
|
-
* @param {UseRendererOptions} [options]
|
|
78
|
-
*/
|
|
79
73
|
export declare function useRenderer({ scene, canvas, options, disableRender, contextParts: { sizes, camera }, }: {
|
|
80
74
|
canvas: MaybeRef<HTMLCanvasElement>;
|
|
81
75
|
scene: Scene;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { vRotate } from './vRotate';
|
|
1
2
|
import { vDistanceTo } from './vDistanceTo';
|
|
2
3
|
import { vAlwaysLookAt } from './vAlwaysLookAt';
|
|
3
4
|
import { vLightHelper } from './vLightHelper';
|
|
4
5
|
import { vLog } from './vLog';
|
|
5
6
|
|
|
6
|
-
export { vLog, vLightHelper, vAlwaysLookAt, vDistanceTo };
|
|
7
|
+
export { vLog, vLightHelper, vAlwaysLookAt, vDistanceTo, vRotate };
|
|
@@ -108,10 +108,10 @@ export interface EventHandlers {
|
|
|
108
108
|
onWheel?: (event: ThreeEvent<WheelEvent>) => void;
|
|
109
109
|
}
|
|
110
110
|
interface MathRepresentation {
|
|
111
|
-
set(...args: number[] | [THREE.ColorRepresentation])
|
|
111
|
+
set: (...args: number[] | [THREE.ColorRepresentation]) => any;
|
|
112
112
|
}
|
|
113
113
|
interface VectorRepresentation extends MathRepresentation {
|
|
114
|
-
setScalar(s: number)
|
|
114
|
+
setScalar: (s: number) => any;
|
|
115
115
|
}
|
|
116
116
|
export interface VectorCoordinates {
|
|
117
117
|
x: number;
|
|
@@ -130,11 +130,11 @@ type WithMathProps<P> = {
|
|
|
130
130
|
[K in keyof P]: P[K] extends MathRepresentation | THREE.Euler ? MathType<P[K]> : P[K];
|
|
131
131
|
};
|
|
132
132
|
interface RaycastableRepresentation {
|
|
133
|
-
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[])
|
|
133
|
+
raycast: (raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) => void;
|
|
134
134
|
}
|
|
135
135
|
type EventProps<P> = P extends RaycastableRepresentation ? Partial<EventHandlers> : unknown;
|
|
136
136
|
export interface VueProps<P> {
|
|
137
|
-
children?: VNode[];
|
|
137
|
+
children?: VNode<P>[];
|
|
138
138
|
ref?: VNodeRef;
|
|
139
139
|
key?: string | number | symbol;
|
|
140
140
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MeshBasicMaterial, Vector3, Mesh,
|
|
1
|
+
import { MeshBasicMaterial, Vector3, Mesh, Object3D, Scene } from 'three';
|
|
2
2
|
|
|
3
3
|
export declare function toSetMethodName(key: string): string;
|
|
4
4
|
export declare const merge: (target: any, source: any) => any;
|