@tresjs/core 3.7.0-next.0 → 3.8.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/index.d.ts +3 -18
- package/dist/{components → src/components}/TresCanvas.vue.d.ts +11 -9
- package/dist/src/components/index.d.ts +3 -0
- package/dist/{composables → src/composables}/useCamera/index.d.ts +472 -433
- package/dist/{composables → src/composables}/useLogger.d.ts +5 -2
- package/dist/{composables → src/composables}/usePointerEventHandler/index.d.ts +4 -3
- package/dist/{composables → src/composables}/useRenderLoop/index.d.ts +3 -2
- package/dist/{composables → src/composables}/useRenderer/index.d.ts +8 -8
- package/dist/src/composables/useSizes/index.d.ts +12 -0
- package/dist/{composables → src/composables}/useTexture/index.d.ts +2 -1
- package/dist/{composables → src/composables}/useTresContextProvider/index.d.ts +6 -9
- package/dist/{core → src/core}/catalogue.d.ts +3 -2
- package/dist/src/core/nodeOps.d.ts +4 -0
- package/dist/{core → src/core}/renderer.d.ts +1 -1
- package/dist/src/devtools/highlight.d.ts +7 -0
- package/dist/src/devtools/index.d.ts +1 -0
- package/dist/src/devtools/plugin.d.ts +16 -0
- package/dist/src/devtools/utils.d.ts +7 -0
- package/dist/src/directives/index.d.ts +6 -0
- package/dist/src/directives/vAlwaysLookAt.d.ts +7 -0
- package/dist/src/directives/vDistanceTo.d.ts +7 -0
- package/dist/src/directives/vLightHelper.d.ts +7 -0
- package/dist/src/directives/vLog.d.ts +7 -0
- package/dist/src/index.d.ts +19 -0
- package/dist/{types → src/types}/index.d.ts +3 -2
- package/dist/{utils → src/utils}/index.d.ts +8 -8
- package/dist/{utils → src/utils}/normalize.d.ts +2 -2
- package/dist/{utils → src/utils}/perf.d.ts +3 -2
- package/dist/src/utils/test-utils.d.ts +1 -0
- package/dist/tres.js +999 -462
- package/dist/tres.umd.cjs +3 -3
- package/package.json +14 -13
- package/dist/components/index.d.ts +0 -2
- package/dist/composables/useLoader/index.d.ts +0 -44
- package/dist/composables/useRaycaster/index.d.ts +0 -18
- package/dist/composables/useSeek/index.d.ts +0 -19
- package/dist/core/nodeOps.d.ts +0 -3
- package/dist/utils/test-utils.d.ts +0 -1
- /package/dist/{composables → src/composables}/index.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRenderer/const.d.ts +0 -0
- /package/dist/{core → src/core}/revision.d.ts +0 -0
- /package/dist/{utils → src/utils}/template-compiler-options.d.ts +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export declare const isProd: boolean;
|
|
2
|
+
type OneOrMore<T> = {
|
|
3
|
+
0: T;
|
|
4
|
+
} & Array<T>;
|
|
2
5
|
interface LoggerComposition {
|
|
3
|
-
logError: (
|
|
4
|
-
logWarning: (
|
|
6
|
+
logError: (...args: OneOrMore<any>) => void;
|
|
7
|
+
logWarning: (...args: OneOrMore<any>) => void;
|
|
5
8
|
logMessage: (name: string, value: any) => void;
|
|
6
9
|
}
|
|
7
10
|
export declare function useLogger(): LoggerComposition;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { TresContext } from '../useTresContextProvider';
|
|
2
|
+
import { TresScene } from 'src/types';
|
|
3
|
+
import { Intersection, Event, Object3D } from 'three';
|
|
4
|
+
|
|
4
5
|
type CallbackFn = (intersection: Intersection<Object3D<Event>>, event: PointerEvent) => void;
|
|
5
6
|
type CallbackFnPointerLeave = (object: Object3D<Event>, event: PointerEvent) => void;
|
|
6
7
|
export interface EventProps {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { EventHookOn, Fn } from '@vueuse/core';
|
|
2
|
-
import type { Ref } from 'vue';
|
|
3
1
|
import { Clock } from 'three';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import { EventHookOn, Fn } from '@vueuse/core';
|
|
4
|
+
|
|
4
5
|
export interface RenderLoop {
|
|
5
6
|
delta: number;
|
|
6
7
|
elapsed: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { RendererPresetsType } from './const';
|
|
2
|
+
import { TresContext } from '../useTresContextProvider';
|
|
3
|
+
import { TresColor } from '../../types';
|
|
4
|
+
import { MaybeRefOrGetter } from '@vueuse/core';
|
|
5
|
+
import { MaybeRef } from 'vue';
|
|
6
|
+
import { WebGLRenderer, Scene, ToneMapping, ColorSpace, ShadowMapType, WebGLRendererParameters } from 'three';
|
|
7
|
+
|
|
8
8
|
type TransformToMaybeRefOrGetter<T> = {
|
|
9
9
|
[K in keyof T]: MaybeRefOrGetter<T[K]> | MaybeRefOrGetter<T[K]>;
|
|
10
10
|
};
|
|
@@ -83,7 +83,7 @@ export declare function useRenderer({ scene, canvas, options, disableRender, con
|
|
|
83
83
|
contextParts: Pick<TresContext, 'sizes' | 'camera'>;
|
|
84
84
|
disableRender: MaybeRefOrGetter<boolean>;
|
|
85
85
|
}): {
|
|
86
|
-
renderer: import(
|
|
86
|
+
renderer: import('vue').ShallowRef<WebGLRenderer>;
|
|
87
87
|
};
|
|
88
88
|
export type UseRendererReturn = ReturnType<typeof useRenderer>;
|
|
89
89
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MaybeRefOrGetter, MaybeRef, ComputedRef, Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface SizesType {
|
|
4
|
+
height: Readonly<Ref<number>>;
|
|
5
|
+
width: Readonly<Ref<number>>;
|
|
6
|
+
aspectRatio: ComputedRef<number>;
|
|
7
|
+
}
|
|
8
|
+
export default function useSizes(windowSize: MaybeRefOrGetter<boolean>, canvas: MaybeRef<HTMLCanvasElement>, debounceMs?: number): {
|
|
9
|
+
height: Readonly<Ref<number>>;
|
|
10
|
+
width: Readonly<Ref<number>>;
|
|
11
|
+
aspectRatio: ComputedRef<number>;
|
|
12
|
+
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { SizesType } from '../useSizes';
|
|
2
|
+
import { UseRendererOptions } from '../useRenderer';
|
|
3
|
+
import { ComputedRef, DeepReadonly, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef } from 'vue';
|
|
4
|
+
import { Camera, EventDispatcher, Scene, WebGLRenderer, Raycaster } from 'three';
|
|
5
|
+
|
|
5
6
|
export interface TresContext {
|
|
6
7
|
scene: ShallowRef<Scene>;
|
|
7
|
-
sizes:
|
|
8
|
-
height: Ref<number>;
|
|
9
|
-
width: Ref<number>;
|
|
10
|
-
aspectRatio: ComputedRef<number>;
|
|
11
|
-
};
|
|
8
|
+
sizes: SizesType;
|
|
12
9
|
extend: (objects: any) => void;
|
|
13
10
|
camera: ComputedRef<Camera | undefined>;
|
|
14
11
|
cameras: DeepReadonly<Ref<Camera[]>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { TresCatalogue } from '../types';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
|
|
3
4
|
export declare const catalogue: Ref<TresCatalogue>;
|
|
4
5
|
export declare const extend: (objects: any) => any;
|
|
5
6
|
declare const _default: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registerTresDevtools } from './plugin';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TresContext } from '../composables';
|
|
2
|
+
import { App as DevtoolsApp } from '@vue/devtools-api';
|
|
3
|
+
|
|
4
|
+
export interface Tags {
|
|
5
|
+
label: string;
|
|
6
|
+
textColor: number;
|
|
7
|
+
backgroundColor: number;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SceneGraphObject {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
children: SceneGraphObject[];
|
|
14
|
+
tags: Tags[];
|
|
15
|
+
}
|
|
16
|
+
export declare function registerTresDevtools(app: DevtoolsApp, tres: TresContext): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as templateCompilerOptions } from './utils/template-compiler-options';
|
|
2
|
+
import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize';
|
|
3
|
+
import { App } from 'vue';
|
|
4
|
+
|
|
5
|
+
export * from './composables';
|
|
6
|
+
export * from './core/catalogue';
|
|
7
|
+
export * from './components';
|
|
8
|
+
export * from './types';
|
|
9
|
+
export * from './directives';
|
|
10
|
+
export interface TresOptions {
|
|
11
|
+
extends?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface TresPlugin {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
install: (app: App, options?: TresOptions) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const plugin: TresPlugin;
|
|
18
|
+
export default plugin;
|
|
19
|
+
export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EventProps as PointerEventHandlerEventProps } from '../composables/usePointerEventHandler';
|
|
2
|
+
import { DefineComponent, VNode, VNodeRef } from 'vue';
|
|
3
|
+
|
|
2
4
|
import type * as THREE from 'three';
|
|
3
|
-
import type { EventProps as PointerEventHandlerEventProps } from '../composables/usePointerEventHandler';
|
|
4
5
|
export type AttachFnType<O = any> = (parent: any, self: O) => () => void;
|
|
5
6
|
export type AttachType<O = any> = string | AttachFnType<O>;
|
|
6
7
|
export type ConstructorRepresentation = new (...args: any[]) => any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Object3D } from 'three';
|
|
1
|
+
import { MeshBasicMaterial, Vector3, Mesh, Scene, Object3D } from 'three';
|
|
2
|
+
|
|
2
3
|
export declare function toSetMethodName(key: string): string;
|
|
3
4
|
export declare const merge: (target: any, source: any) => any;
|
|
4
5
|
export declare const isHTMLTag: (key: string) => boolean;
|
|
@@ -14,10 +15,9 @@ export declare function deepArrayEqual(arr1: any[], arr2: any[]): boolean;
|
|
|
14
15
|
* TypeSafe version of Array.isArray
|
|
15
16
|
*/
|
|
16
17
|
export declare const isArray: (a: any) => a is any[] | readonly any[];
|
|
17
|
-
export declare function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export declare function
|
|
23
|
-
export default disposeObject3D;
|
|
18
|
+
export declare function editSceneObject(scene: Scene, objectUuid: string, propertyPath: string[], value: any): void;
|
|
19
|
+
export declare function createHighlightMaterial(): MeshBasicMaterial;
|
|
20
|
+
export declare function animateHighlight(highlightMesh: Mesh, startTime: number): void;
|
|
21
|
+
export declare function stopHighlightAnimation(): void;
|
|
22
|
+
export declare function createHighlightMesh(object: Object3D): Mesh;
|
|
23
|
+
export declare function extractBindingPosition(binding: any): Vector3;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { TresObject } from './../types';
|
|
2
|
+
import { Scene } from 'three';
|
|
3
|
+
|
|
3
4
|
export declare function calculateMemoryUsage(object: TresObject | Scene): number;
|
|
4
5
|
export declare function bytesToKB(bytes: number): string;
|
|
5
6
|
export declare function bytesToMB(bytes: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withSetup(composable: any): (import('vue').App<Element> | undefined)[];
|