@tresjs/cientos 5.0.0-next.5 → 5.0.0-next.7

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.
@@ -51,7 +51,7 @@ export interface GLTFModelProps {
51
51
  decoderPath?: string;
52
52
  }
53
53
  declare const _default: import('vue').DefineComponent<GLTFModelProps, {
54
- instance: import('vue').Ref<import('three-stdlib').GLTF, import('three-stdlib').GLTF>;
54
+ instance: import('vue').Ref<import('three-stdlib').GLTF | null, import('three-stdlib').GLTF | null>;
55
55
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<GLTFModelProps> & Readonly<{}>, {
56
56
  castShadow: boolean;
57
57
  receiveShadow: boolean;
@@ -1,5 +1,5 @@
1
1
  import { TresObject } from '@tresjs/core';
2
- import { MaybeRef } from 'vue';
2
+ import { ComputedRef, MaybeRef, Ref } from 'vue';
3
3
  import { GLTF } from 'three-stdlib';
4
4
  export interface UseGLTFOptions {
5
5
  /**
@@ -12,6 +12,11 @@ export interface UseGLTFOptions {
12
12
  * @type {string}
13
13
  */
14
14
  decoderPath?: string;
15
+ /**
16
+ * A traverse function applied to the scene upon loading the model.
17
+ * @type {Function}
18
+ */
19
+ traverse?: (child: TresObject) => void;
15
20
  }
16
21
  /**
17
22
  * Vue composable for loading GLTF models in TresJS
@@ -30,22 +35,9 @@ export interface UseGLTFOptions {
30
35
  * @returns {{ state: GLTF, isLoading: boolean, execute: () => Promise<void> }} Object containing the model state, loading state and reload function
31
36
  */
32
37
  export declare function useGLTF(path: MaybeRef<string>, options?: UseGLTFOptions): {
33
- nodes: import('vue').ComputedRef<{
34
- [name: string]: TresObject;
35
- }>;
36
- materials: import('vue').ComputedRef<{
37
- [name: string]: import('@tresjs/core').TresMaterial;
38
- }>;
39
- state: import('vue').Ref<GLTF, GLTF>;
40
- isReady: import('vue').Ref<boolean>;
41
- isLoading: import('vue').Ref<boolean>;
42
- error: import('vue').Ref<unknown>;
43
- execute: (delay?: number, args_0: string) => Promise<GLTF>;
44
- then<TResult1 = import('@vueuse/core').UseAsyncStateReturnBase<GLTF, [string], true>, TResult2 = never>(onfulfilled?: ((value: import('@vueuse/core').UseAsyncStateReturnBase<GLTF, [string], true>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseLike<TResult1 | TResult2>;
45
- load: (path: string) => void;
46
- progress: {
47
- loaded: number;
48
- total: number;
49
- percentage: number;
50
- };
38
+ state: Ref<GLTF | null>;
39
+ isLoading: Ref<boolean>;
40
+ execute: (delay?: number, ...args: any[]) => Promise<GLTF>;
41
+ nodes: ComputedRef<Record<string, any>>;
42
+ materials: ComputedRef<Record<string, any>>;
51
43
  };
@@ -91,7 +91,7 @@ interface SVGProps {
91
91
  depth?: 'renderOrder' | 'flat' | 'offsetZ' | number;
92
92
  }
93
93
  declare const _default: import('vue').DefineComponent<SVGProps, {
94
- instance: import('vue').Ref<import('three-stdlib').SVGResult, import('three-stdlib').SVGResult>;
94
+ instance: import('vue').Ref<import('three-stdlib').SVGResult | null, import('three-stdlib').SVGResult | null>;
95
95
  layers: import('vue').ComputedRef<import('.').SVGLayer[]>;
96
96
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SVGProps> & Readonly<{}>, {
97
97
  depth: "renderOrder" | "flat" | "offsetZ" | number;
@@ -1,4 +1,4 @@
1
- import { MaybeRef } from 'vue';
1
+ import { ComputedRef, MaybeRef, Ref } from 'vue';
2
2
  import { BufferGeometry, MeshBasicMaterialParameters } from 'three';
3
3
  import { SVGResult } from 'three-stdlib';
4
4
  export interface UseSVGOptions {
@@ -57,18 +57,9 @@ export interface SVGLayer {
57
57
  * @returns Object containing the SVG state, loading state, processed layers and disposal function
58
58
  */
59
59
  export declare function useSVG(path: MaybeRef<string>, options?: UseSVGOptions): {
60
- layers: import('vue').ComputedRef<SVGLayer[]>;
60
+ state: Ref<SVGResult | null>;
61
+ isLoading: Ref<boolean>;
62
+ execute: (delay?: number, ...args: any[]) => Promise<SVGResult>;
63
+ layers: ComputedRef<SVGLayer[]>;
61
64
  dispose: () => void;
62
- state: import('vue').Ref<SVGResult, SVGResult>;
63
- isReady: import('vue').Ref<boolean>;
64
- isLoading: import('vue').Ref<boolean>;
65
- error: import('vue').Ref<unknown>;
66
- execute: (delay?: number, args_0: string) => Promise<SVGResult>;
67
- then<TResult1 = import('@vueuse/core').UseAsyncStateReturnBase<SVGResult, [string], true>, TResult2 = never>(onfulfilled?: ((value: import('@vueuse/core').UseAsyncStateReturnBase<SVGResult, [string], true>) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): PromiseLike<TResult1 | TResult2>;
68
- load: (path: string) => void;
69
- progress: {
70
- loaded: number;
71
- total: number;
72
- percentage: number;
73
- };
74
65
  };