@tresjs/core 3.7.0-next.0 → 3.7.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.
Files changed (38) hide show
  1. package/dist/index.d.ts +3 -18
  2. package/dist/{components → src/components}/TresCanvas.vue.d.ts +4 -3
  3. package/dist/{composables → src/composables}/useRenderer/index.d.ts +1 -1
  4. package/dist/src/devtools/highlight.d.ts +7 -0
  5. package/dist/src/devtools/index.d.ts +1 -0
  6. package/dist/src/devtools/plugin.d.ts +15 -0
  7. package/dist/src/devtools/utils.d.ts +7 -0
  8. package/dist/src/directives/index.d.ts +5 -0
  9. package/dist/src/directives/vAlwaysLookAt.d.ts +6 -0
  10. package/dist/src/directives/vDistanceTo.d.ts +6 -0
  11. package/dist/src/directives/vLightHelper.d.ts +6 -0
  12. package/dist/src/directives/vLog.d.ts +6 -0
  13. package/dist/src/index.d.ts +18 -0
  14. package/dist/{utils → src/utils}/index.d.ts +8 -8
  15. package/dist/tres.js +1010 -468
  16. package/dist/tres.umd.cjs +3 -3
  17. package/package.json +1 -1
  18. /package/dist/{components → src/components}/index.d.ts +0 -0
  19. /package/dist/{composables → src/composables}/index.d.ts +0 -0
  20. /package/dist/{composables → src/composables}/useCamera/index.d.ts +0 -0
  21. /package/dist/{composables → src/composables}/useLoader/index.d.ts +0 -0
  22. /package/dist/{composables → src/composables}/useLogger.d.ts +0 -0
  23. /package/dist/{composables → src/composables}/usePointerEventHandler/index.d.ts +0 -0
  24. /package/dist/{composables → src/composables}/useRaycaster/index.d.ts +0 -0
  25. /package/dist/{composables → src/composables}/useRenderLoop/index.d.ts +0 -0
  26. /package/dist/{composables → src/composables}/useRenderer/const.d.ts +0 -0
  27. /package/dist/{composables → src/composables}/useSeek/index.d.ts +0 -0
  28. /package/dist/{composables → src/composables}/useTexture/index.d.ts +0 -0
  29. /package/dist/{composables → src/composables}/useTresContextProvider/index.d.ts +0 -0
  30. /package/dist/{core → src/core}/catalogue.d.ts +0 -0
  31. /package/dist/{core → src/core}/nodeOps.d.ts +0 -0
  32. /package/dist/{core → src/core}/renderer.d.ts +0 -0
  33. /package/dist/{core → src/core}/revision.d.ts +0 -0
  34. /package/dist/{types → src/types}/index.d.ts +0 -0
  35. /package/dist/{utils → src/utils}/normalize.d.ts +0 -0
  36. /package/dist/{utils → src/utils}/perf.d.ts +0 -0
  37. /package/dist/{utils → src/utils}/template-compiler-options.d.ts +0 -0
  38. /package/dist/{utils → src/utils}/test-utils.d.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,18 +1,3 @@
1
- import type { App } from 'vue';
2
- import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize';
3
- import { dispose } from './utils/';
4
- import templateCompilerOptions from './utils/template-compiler-options';
5
- export * from './composables';
6
- export * from './core/catalogue';
7
- export * from './components';
8
- export * from './types';
9
- export interface TresOptions {
10
- extends?: Record<string, unknown>;
11
- }
12
- export interface TresPlugin {
13
- [key: string]: any;
14
- install: (app: App, options?: TresOptions) => void;
15
- }
16
- declare const plugin: TresPlugin;
17
- export default plugin;
18
- export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, dispose, };
1
+ export * from './src/index'
2
+ import Tres from './src/index'
3
+ export default Tres
@@ -1,5 +1,4 @@
1
1
  import type { WebGLRendererParameters, ColorSpace, ShadowMapType, ToneMapping } from 'three';
2
- import type { Ref } from 'vue';
3
2
  import { type TresContext } from '../composables';
4
3
  import type { RendererPresetsType } from '../composables/useRenderer/const';
5
4
  import type { TresCamera } from '../types/';
@@ -29,7 +28,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
29
28
  logarithmicDepthBuffer: undefined;
30
29
  failIfMajorPerformanceCaveat: undefined;
31
30
  }>, {
32
- context: Ref<TresContext | null> | import("vue").ShallowRef<TresContext | null>;
31
+ context: import("vue").ShallowRef<TresContext | null>;
33
32
  dispose: () => void;
34
33
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TresCanvasProps>, {
35
34
  alpha: undefined;
@@ -57,7 +56,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
57
56
  disableRender: boolean;
58
57
  }, {}>, Readonly<{
59
58
  default(): any;
60
- }>>;
59
+ }> & {
60
+ default(): any;
61
+ }>;
61
62
  export default _default;
62
63
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
63
64
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -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("vue").Ref<WebGLRenderer> | import("vue").ShallowRef<WebGLRenderer>;
86
+ renderer: import("vue").ShallowRef<WebGLRenderer>;
87
87
  };
88
88
  export type UseRendererReturn = ReturnType<typeof useRenderer>;
89
89
  export {};
@@ -0,0 +1,7 @@
1
+ import * as THREE from 'three';
2
+ export declare class HightlightMesh extends THREE.Mesh {
3
+ type: string;
4
+ createTime: number;
5
+ constructor(...args: THREE.Mesh['args']);
6
+ onBeforeRender(): void;
7
+ }
@@ -0,0 +1 @@
1
+ export { registerTresDevtools } from './plugin';
@@ -0,0 +1,15 @@
1
+ import type { App as DevtoolsApp } from '@vue/devtools-api';
2
+ import type { TresContext } from '../composables';
3
+ export interface Tags {
4
+ label: string;
5
+ textColor: number;
6
+ backgroundColor: number;
7
+ tooltip?: string;
8
+ }
9
+ export interface SceneGraphObject {
10
+ id: string;
11
+ label: string;
12
+ children: SceneGraphObject[];
13
+ tags: Tags[];
14
+ }
15
+ export declare function registerTresDevtools(app: DevtoolsApp, tres: TresContext): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shows a toast or console.log
3
+ *
4
+ * @param message - message to log
5
+ * @param type - different color of the tooltip
6
+ */
7
+ export declare function toastMessage(message: string, type?: 'normal' | 'error' | 'warn' | undefined): void;
@@ -0,0 +1,5 @@
1
+ import { vLog } from './vLog';
2
+ import { vLightHelper } from './vLightHelper';
3
+ import { vAlwaysLookAt } from './vAlwaysLookAt';
4
+ import { vDistanceTo } from './vDistanceTo';
5
+ export { vLog, vLightHelper, vAlwaysLookAt, vDistanceTo };
@@ -0,0 +1,6 @@
1
+ import type { Object3D } from 'three';
2
+ import type { Ref } from 'vue';
3
+ import type { TresVector3 } from '../types';
4
+ export declare const vAlwaysLookAt: {
5
+ updated: (el: Object3D, binding: Ref<TresVector3>) => void;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { Ref } from 'vue';
2
+ import type { TresObject } from '../types';
3
+ export declare const vDistanceTo: {
4
+ updated: (el: TresObject, binding: Ref<TresObject>) => void;
5
+ unmounted: (el: TresObject) => void;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { TresObject } from '../types';
2
+ export declare const vLightHelper: {
3
+ mounted: (el: TresObject) => void;
4
+ updated: (el: TresObject) => void;
5
+ unmounted: (el: TresObject) => void;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { TresObject } from '../types';
2
+ export declare const vLog: {
3
+ mounted: (el: TresObject, binding: {
4
+ arg: string;
5
+ }) => void;
6
+ };
@@ -0,0 +1,18 @@
1
+ import type { App } from 'vue';
2
+ import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize';
3
+ import templateCompilerOptions from './utils/template-compiler-options';
4
+ export * from './composables';
5
+ export * from './core/catalogue';
6
+ export * from './components';
7
+ export * from './types';
8
+ export * from './directives';
9
+ export interface TresOptions {
10
+ extends?: Record<string, unknown>;
11
+ }
12
+ export interface TresPlugin {
13
+ [key: string]: any;
14
+ install: (app: App, options?: TresOptions) => void;
15
+ }
16
+ declare const plugin: TresPlugin;
17
+ export default plugin;
18
+ export { normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, };
@@ -1,4 +1,5 @@
1
- import { Object3D } from 'three';
1
+ import { MeshBasicMaterial, Vector3 } from 'three';
2
+ import type { Mesh, Scene, Object3D } from 'three';
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 dispose<TresObj extends {
18
- dispose?: () => void;
19
- type?: string;
20
- [key: string]: any;
21
- }>(obj: TresObj): void;
22
- export declare function disposeObject3D(object: Object3D): void;
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;