@tresjs/cientos 4.0.0-next.0 → 4.0.0-next.1

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 (107) hide show
  1. package/dist/composables/useOnDemandInvalidation.d.ts +3 -0
  2. package/dist/core/abstractions/AnimatedSprite/Atlas.d.ts +38 -0
  3. package/dist/core/abstractions/AnimatedSprite/AtlasAnimationDefinitionParser.d.ts +10 -0
  4. package/dist/core/abstractions/AnimatedSprite/StringOps.d.ts +2 -0
  5. package/dist/core/abstractions/AnimatedSprite/component.vue.d.ts +130 -0
  6. package/dist/core/abstractions/GlobalAudio.d.ts +1 -1
  7. package/dist/core/abstractions/Lensflare/RandUtils.d.ts +2 -2
  8. package/dist/core/abstractions/Lensflare/component.vue.d.ts +13 -12
  9. package/dist/core/abstractions/Lensflare/constants.d.ts +2 -1
  10. package/dist/core/abstractions/Lensflare/index.d.ts +5 -4
  11. package/dist/core/abstractions/Levioso.vue.d.ts +16 -14
  12. package/dist/core/abstractions/MouseParallax.vue.d.ts +22 -11
  13. package/dist/core/abstractions/PositionalAudio.vue.d.ts +69 -0
  14. package/dist/core/abstractions/Reflector.vue.d.ts +12 -9
  15. package/dist/core/abstractions/Text3D.vue.d.ts +8 -6
  16. package/dist/core/abstractions/index.d.ts +11 -8
  17. package/dist/core/abstractions/useAnimations.d.ts +4 -4
  18. package/dist/core/abstractions/useFBO/component.vue.d.ts +6 -5
  19. package/dist/core/abstractions/useFBO/index.d.ts +5 -5
  20. package/dist/core/abstractions/useSurfaceSampler/component.vue.d.ts +8 -5
  21. package/dist/core/abstractions/useSurfaceSampler/index.d.ts +167 -139
  22. package/dist/core/controls/CameraControls.vue.d.ts +4135 -3850
  23. package/dist/core/controls/KeyboardControls.vue.d.ts +44 -90
  24. package/dist/core/controls/MapControls.vue.d.ts +9498 -4
  25. package/dist/core/controls/OrbitControls.vue.d.ts +5897 -5651
  26. package/dist/core/controls/PointerLockControls.vue.d.ts +6 -5
  27. package/dist/core/controls/ScrollControls.vue.d.ts +25 -21
  28. package/dist/core/controls/TransformControls.vue.d.ts +11 -5
  29. package/dist/core/controls/index.d.ts +9 -8
  30. package/dist/core/index.d.ts +0 -1
  31. package/dist/core/loaders/SVG/component.vue.d.ts +14 -13
  32. package/dist/core/loaders/index.d.ts +4 -3
  33. package/dist/core/loaders/useFBX/component.vue.d.ts +9 -9
  34. package/dist/core/loaders/useFBX/index.d.ts +2 -1
  35. package/dist/core/loaders/useGLTF/component.vue.d.ts +16 -16
  36. package/dist/core/loaders/useGLTF/index.d.ts +14 -9
  37. package/dist/core/loaders/useProgress.d.ts +2 -1
  38. package/dist/core/loaders/useVideoTexture.d.ts +1 -0
  39. package/dist/core/materials/customShaderMaterial/index.vue.d.ts +6 -4
  40. package/dist/core/materials/holographicMaterial/HolographicMaterialParameters.d.ts +41 -0
  41. package/dist/core/materials/holographicMaterial/index.vue.d.ts +86 -0
  42. package/dist/core/materials/holographicMaterial/material.d.ts +27 -0
  43. package/dist/core/materials/index.d.ts +7 -5
  44. package/dist/core/materials/meshGlassMaterial/index.vue.d.ts +3 -3
  45. package/dist/core/materials/meshGlassMaterial/material.d.ts +2 -2
  46. package/dist/core/materials/{blurPass.d.ts → meshReflectionMaterial/BlurPass.d.ts} +8 -6
  47. package/dist/core/materials/{convolutionMaterial.d.ts → meshReflectionMaterial/ConvolutionMaterial.d.ts} +1 -0
  48. package/dist/core/materials/meshReflectionMaterial/index.vue.d.ts +171 -40
  49. package/dist/core/materials/meshReflectionMaterial/material.d.ts +33 -36
  50. package/dist/core/materials/meshWobbleMaterial/index.vue.d.ts +8 -6
  51. package/dist/core/materials/meshWobbleMaterial/material.d.ts +2 -2
  52. package/dist/core/misc/BakeShadows.d.ts +1 -1
  53. package/dist/core/misc/Stats.d.ts +2 -2
  54. package/dist/core/misc/StatsGl.d.ts +1 -1
  55. package/dist/core/misc/html/HTML.vue.d.ts +13 -8
  56. package/dist/core/misc/html/utils.d.ts +3 -3
  57. package/dist/core/misc/index.d.ts +3 -3
  58. package/dist/core/misc/useGLTFExporter.d.ts +2 -1
  59. package/dist/core/shapes/Box.vue.d.ts +13 -10
  60. package/dist/core/shapes/CatmullRomCurve3.vue.d.ts +6 -3
  61. package/dist/core/shapes/Circle.vue.d.ts +13 -10
  62. package/dist/core/shapes/Cone.vue.d.ts +13 -10
  63. package/dist/core/shapes/Cylinder.vue.d.ts +60 -0
  64. package/dist/core/shapes/Dodecahedron.vue.d.ts +13 -10
  65. package/dist/core/shapes/Icosahedron.vue.d.ts +13 -10
  66. package/dist/core/shapes/Line2.vue.d.ts +7 -4
  67. package/dist/core/shapes/Octahedron.vue.d.ts +13 -10
  68. package/dist/core/shapes/Plane.vue.d.ts +13 -10
  69. package/dist/core/shapes/Ring.vue.d.ts +13 -10
  70. package/dist/core/shapes/RoundedBox.vue.d.ts +13 -10
  71. package/dist/core/shapes/Sphere.vue.d.ts +13 -10
  72. package/dist/core/shapes/Superformula.vue.d.ts +26 -23
  73. package/dist/core/shapes/Tetrahedron.vue.d.ts +13 -10
  74. package/dist/core/shapes/Torus.vue.d.ts +13 -10
  75. package/dist/core/shapes/TorusKnot.vue.d.ts +13 -10
  76. package/dist/core/shapes/Tube.vue.d.ts +13 -11
  77. package/dist/core/shapes/index.d.ts +20 -18
  78. package/dist/core/staging/Backdrop.vue.d.ts +9 -5
  79. package/dist/core/staging/ContactShadows.vue.d.ts +173 -0
  80. package/dist/core/staging/Fit.vue.d.ts +59 -0
  81. package/dist/core/staging/Ocean.vue.d.ts +15 -12
  82. package/dist/core/staging/Precipitation.vue.d.ts +10 -7
  83. package/dist/core/staging/Sky.vue.d.ts +5 -4
  84. package/dist/core/staging/Smoke.vue.d.ts +7 -6
  85. package/dist/core/staging/Sparkles/ShaderData.d.ts +4 -3
  86. package/dist/core/staging/Sparkles/ShaderDataBuilder.d.ts +7 -7
  87. package/dist/core/staging/Sparkles/component.vue.d.ts +21 -19
  88. package/dist/core/staging/Sparkles/useEmptyDataTexture.d.ts +1 -0
  89. package/dist/core/staging/Stars.vue.d.ts +7 -7
  90. package/dist/core/staging/index.d.ts +13 -10
  91. package/dist/core/staging/useEnvironment/component.vue.d.ts +64 -0
  92. package/dist/core/staging/useEnvironment/const.d.ts +28 -0
  93. package/dist/core/staging/useEnvironment/envSence.d.ts +9 -0
  94. package/dist/core/staging/useEnvironment/index.d.ts +5 -3
  95. package/dist/core/staging/useEnvironment/lightformer/index.vue.d.ts +56 -0
  96. package/dist/trescientos.js +7493 -6606
  97. package/dist/trescientos.umd.cjs +562 -424
  98. package/dist/utils/Gradient.d.ts +3 -2
  99. package/dist/utils/index.d.ts +1 -0
  100. package/dist/utils/types.d.ts +4 -0
  101. package/package.json +28 -28
  102. package/dist/core/directives/index.d.ts +0 -5
  103. package/dist/core/directives/vAlwaysLookAt.d.ts +0 -4
  104. package/dist/core/directives/vDistanceTo.d.ts +0 -4
  105. package/dist/core/directives/vLightHelper.d.ts +0 -5
  106. package/dist/core/directives/vLog.d.ts +0 -3
  107. package/dist/core/misc/useTweakPane/index.d.ts +0 -10
@@ -0,0 +1,3 @@
1
+ export declare function useOnDemandInvalidation(props: Record<string, any>): {
2
+ invalidateOnDemand: () => void;
3
+ };
@@ -0,0 +1,38 @@
1
+ import { Texture } from 'three';
2
+
3
+ export declare function getTextureAndAtlasAsync(imagePathOrImageData: string, atlasPathOrAtlasish: string | Atlasish): Promise<[Texture, Atlas]>;
4
+ export interface AtlasFrame {
5
+ name: string;
6
+ width: number;
7
+ height: number;
8
+ offsetX: number;
9
+ offsetY: number;
10
+ repeatX: number;
11
+ repeatY: number;
12
+ }
13
+ export interface Atlas {
14
+ frames: AtlasFrame[];
15
+ animations: Record<string, AtlasFrame[]>;
16
+ }
17
+ export declare function getAtlas(atlasish: Atlasish, textureWidth: number, textureHeight: number): Atlas;
18
+ export declare function getAtlasFrames(atlas: Atlas, animationNameOrFrameNumber: string | number | [number, number], reversed: boolean): AtlasFrame[];
19
+ export declare function getNullAtlasFrame(): AtlasFrame;
20
+ export type AtlasData = TexturePackerFrameDataArray | TexturePackerFrameDataObject;
21
+ export type Atlasish = AtlasData | [number, number] | number;
22
+ interface TexturePackerFrameData {
23
+ filename: string;
24
+ frame: {
25
+ x: number;
26
+ y: number;
27
+ w: number;
28
+ h: number;
29
+ };
30
+ }
31
+ interface TexturePackerFrameDataArray {
32
+ frames: TexturePackerFrameData[];
33
+ }
34
+ interface TexturePackerFrameDataObject {
35
+ frames: Record<string, TexturePackerFrameData>;
36
+ }
37
+ export declare function setAtlasDefinitions(atlas: Atlas, definitions?: Record<string, string>): void;
38
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Expand an animation definition string into an array of numbers.
3
+ * @param definitionStr - A comma-separated string of frame numbers with optional parentheses-surrounded durations.
4
+ * @example - expand("0,2") === [0,2]
5
+ * @example - expand("2(10)") === [2,2,2,2,2,2,2,2,2,2]
6
+ * @example - expand("1-4") === [1,2,3,4]
7
+ * @example - expand("10-5(2)") === [10,10,9,9,8,8,7,7,6,6,5,5]
8
+ * @example - expand("1-4(3),10(2)") === [1,1,1,2,2,2,3,3,3,4,4,4,10,10]
9
+ */
10
+ export declare function expand(definitionStr: string): number[];
@@ -0,0 +1,2 @@
1
+ export declare function stripUnderscoresNumbersFromEnd(str: string): string;
2
+ export declare function getNumbersFromEnd(str: string): number | null;
@@ -0,0 +1,130 @@
1
+ import { TresVector2 } from '@tresjs/core';
2
+ import { Intersection } from 'three';
3
+ import { Atlasish } from './Atlas';
4
+
5
+ export interface AnimatedSpriteProps {
6
+ /** URL of the image texture or an image dataURL. This prop is not reactive. */
7
+ image: string;
8
+ /**
9
+ * If `string`, the URL of the JSON atlas.
10
+ * If `number`, the number of columns in the texture.
11
+ * If `[number, number]`, the number of columns/rows in the texture.
12
+ * If `AtlasData`, the atlas as a JS object.
13
+ * This prop is not reactive.
14
+ */
15
+ atlas: string | Atlasish;
16
+ /**
17
+ * Specify playback frame order and repeated frames (delays). `definitions` is a record where keys are atlas animation names and values are strings containing an animation definition.
18
+ * A "animation definition" comma-separated string of frame numbers with optional parentheses-surrounded durations.
19
+ * Here is how various definition strings convert to arrays of frames for playback:
20
+ * "0,2,1" - [0,2,1], i.e., play frame 0, 2, then 1.
21
+ * "2(10)" - [2,2,2,2,2,2,2,2,2,2], i.e., play from 2 10 times.
22
+ * "1-4" - [1,2,3,4]
23
+ * "10-5(2)" - [10,10,9,9,8,8,7,7,6,6,5,5]
24
+ * "1-4(3),10(2)" - [1,1,1,2,2,2,3,3,3,4,4,4,10,10]
25
+ */
26
+ definitions?: Record<string, string>;
27
+ /** Desired frames per second of the animation. */
28
+ fps?: number;
29
+ /** Whether or not the animation should loop. */
30
+ loop?: boolean;
31
+ /** If `string`, name of the animation to play. If `[number, number]`, start and end frames of the animation. If `number`, frame number to display. */
32
+ animation?: string | [number, number] | number;
33
+ /** Event callback when the animation ends. */
34
+ paused?: boolean;
35
+ /** Whether to play the animation in reverse. */
36
+ reversed?: boolean;
37
+ /** Whether the sprite should be flipped, left to right. */
38
+ flipX?: boolean;
39
+ /** For a non-looping animation, when the animation ends, whether to display the zeroth frame. */
40
+ resetOnEnd?: boolean;
41
+ /** Whether to display the object as a THREE.Sprite. [See THREE.Sprite](https://threejs.org/docs/?q=sprite#api/en/objects/Sprite) */
42
+ asSprite?: boolean;
43
+ /** Anchor point of the object. A value of [0.5, 0.5] corresponds to the center. [0, 0] is left, bottom. */
44
+ center?: TresVector2;
45
+ /** Alpha test value for the material. [See THREE.Material.alphaTest](https://threejs.org/docs/#api/en/materials/Material.alphaTest) */
46
+ alphaTest?: number;
47
+ /** Depth test value for the material. [See THREE.Material.depthTest](https://threejs.org/docs/#api/en/materials/Material.depthTest) */
48
+ depthTest?: boolean;
49
+ /** Depth write value for the material. [See THREE.Material.depthWrite](https://threejs.org/docs/#api/en/materials/Material.depthWrite) */
50
+ depthWrite?: boolean;
51
+ }
52
+ declare function __VLS_template(): {
53
+ default?(_: {}): any;
54
+ };
55
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<AnimatedSpriteProps>, {
56
+ fps: number;
57
+ loop: boolean;
58
+ animation: number;
59
+ paused: boolean;
60
+ reversed: boolean;
61
+ flipX: boolean;
62
+ resetOnEnd: boolean;
63
+ asSprite: boolean;
64
+ center: () => number[];
65
+ alphaTest: number;
66
+ depthTest: boolean;
67
+ depthWrite: boolean;
68
+ }>, {
69
+ instance: import('vue').ShallowRef<any>;
70
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
71
+ frame: (frameName: string) => void;
72
+ end: (frameName: string) => void;
73
+ loop: (frameName: string) => void;
74
+ click: (event: Intersection<import('three').Object3D<import('three').Object3DEventMap>>) => void;
75
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<AnimatedSpriteProps>, {
76
+ fps: number;
77
+ loop: boolean;
78
+ animation: number;
79
+ paused: boolean;
80
+ reversed: boolean;
81
+ flipX: boolean;
82
+ resetOnEnd: boolean;
83
+ asSprite: boolean;
84
+ center: () => number[];
85
+ alphaTest: number;
86
+ depthTest: boolean;
87
+ depthWrite: boolean;
88
+ }>>> & {
89
+ onClick?: ((event: Intersection<import('three').Object3D<import('three').Object3DEventMap>>) => any) | undefined;
90
+ onLoop?: ((frameName: string) => any) | undefined;
91
+ onFrame?: ((frameName: string) => any) | undefined;
92
+ onEnd?: ((frameName: string) => any) | undefined;
93
+ }, {
94
+ loop: boolean;
95
+ depthTest: boolean;
96
+ depthWrite: boolean;
97
+ alphaTest: number;
98
+ center: TresVector2;
99
+ fps: number;
100
+ animation: string | [number, number] | number;
101
+ paused: boolean;
102
+ reversed: boolean;
103
+ flipX: boolean;
104
+ resetOnEnd: boolean;
105
+ asSprite: boolean;
106
+ }, {}>;
107
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
108
+ export default _default;
109
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
110
+ type __VLS_TypePropsToRuntimeProps<T> = {
111
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
112
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
113
+ } : {
114
+ type: import('vue').PropType<T[K]>;
115
+ required: true;
116
+ };
117
+ };
118
+ type __VLS_WithDefaults<P, D> = {
119
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
120
+ default: D[K];
121
+ }> : P[K];
122
+ };
123
+ type __VLS_Prettify<T> = {
124
+ [K in keyof T]: T[K];
125
+ } & {};
126
+ type __VLS_WithTemplateSlots<T, S> = T & {
127
+ new (): {
128
+ $slots: S;
129
+ };
130
+ };
@@ -47,4 +47,4 @@ export interface AudioProps {
47
47
  */
48
48
  playbackRate?: number;
49
49
  }
50
- export declare const GlobalAudio: import("vue").DefineComponent<AudioProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AudioProps>, {}, {}>;
50
+ export declare const GlobalAudio: import('vue').DefineComponent<AudioProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AudioProps>, {}, {}>;
@@ -6,8 +6,8 @@ export default class RandUtils {
6
6
  private _getGenerator;
7
7
  /**
8
8
  * Create a new seeded pseudorandom number generator.
9
- * @param [seed=0] - the seed for the generator
10
- * @param [getSeededRandomGenerator=getMulberry32] - a function that returns a pseudorandom number generator
9
+ * @param [seed] - the seed for the generator
10
+ * @param [getSeededRandomGenerator] - a function that returns a pseudorandom number generator
11
11
  * @constructor
12
12
  */
13
13
  constructor(seed?: number, getSeededRandomGenerator?: (seed: number) => () => number);
@@ -1,7 +1,8 @@
1
1
  import { Lensflare } from 'three/examples/jsm/objects/Lensflare';
2
- import type { Texture } from 'three';
3
- import type { TresColor } from '@tresjs/core';
4
- import type { LensflareElementProps, SeedProps } from '.';
2
+ import { Texture } from 'three';
3
+ import { TresColor } from '@tresjs/core';
4
+ import { LensflareElementProps, SeedProps } from '.';
5
+
5
6
  export interface LensflareProps {
6
7
  /**
7
8
  * scale of the lensflare
@@ -12,8 +13,8 @@ export interface LensflareProps {
12
13
  */
13
14
  elements?: Partial<LensflareElementProps>[];
14
15
  /**
15
- * random seed for generating random seeded elements
16
- */
16
+ * random seed for generating random seeded elements
17
+ */
17
18
  seed?: number;
18
19
  /**
19
20
  * specifications for generating random seeded elements
@@ -36,7 +37,7 @@ export interface LensflareProps {
36
37
  */
37
38
  texture?: Texture | string[];
38
39
  }
39
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<LensflareProps>, {
40
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<LensflareProps>, {
40
41
  scale: number;
41
42
  elements: undefined;
42
43
  seed: undefined;
@@ -46,8 +47,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
46
47
  size: undefined;
47
48
  texture: undefined;
48
49
  }>, {
49
- value: import("vue").ShallowRef<Lensflare | undefined>;
50
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<LensflareProps>, {
50
+ instance: import('vue').ShallowRef<Lensflare | undefined>;
51
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<LensflareProps>, {
51
52
  scale: number;
52
53
  elements: undefined;
53
54
  seed: undefined;
@@ -57,14 +58,14 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
57
58
  size: undefined;
58
59
  texture: undefined;
59
60
  }>>>, {
60
- color: import("three").ColorRepresentation | [r: number, g: number, b: number];
61
- texture: string[] | Texture;
61
+ color: TresColor;
62
+ texture: Texture | string[];
62
63
  scale: number;
63
- elements: Partial<LensflareElementProps>[];
64
+ distance: number;
64
65
  size: number;
66
+ elements: Partial<LensflareElementProps>[];
65
67
  seed: number;
66
68
  seedProps: SeedProps[];
67
- distance: number;
68
69
  }, {}>;
69
70
  export default _default;
70
71
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,4 +1,5 @@
1
- import type { LensflareElementProps, SeedProps } from '.';
1
+ import { LensflareElementProps, SeedProps } from '.';
2
+
2
3
  export declare const TEXTURE_PATH = "https://raw.githubusercontent.com/Tresjs/assets/93976c7d63ac83d4a254a41a10b2362bc17e90c9/textures/lensflare/";
3
4
  export declare const circle = "https://raw.githubusercontent.com/Tresjs/assets/93976c7d63ac83d4a254a41a10b2362bc17e90c9/textures/lensflare/circle.png";
4
5
  export declare const circleBlur = "https://raw.githubusercontent.com/Tresjs/assets/93976c7d63ac83d4a254a41a10b2362bc17e90c9/textures/lensflare/circleBlur.png";
@@ -1,6 +1,7 @@
1
- import type { Texture } from 'three';
2
- import type { TresColor } from '@tresjs/core';
3
- import Lensflare from './component.vue';
1
+ import { Texture } from 'three';
2
+ import { TresColor } from '@tresjs/core';
3
+ import { default as Lensflare } from './component.vue';
4
+
4
5
  export { Lensflare };
5
6
  export interface SeedProps {
6
7
  texture: string[];
@@ -25,7 +26,7 @@ export interface SeedProps {
25
26
  * @param seedProps - `undefined` or an array of SeedProps for generating random seeded properties
26
27
  * @param systemDefaultElement - default values to "fill in" any remaining missing props
27
28
  * @returns LensflareElementProps[] - An array of complete props
28
- **/
29
+ */
29
30
  export declare const partialLensflarePropsArrayToLensflarePropsArray: (elements: Partial<LensflareElementProps>[] | undefined, userDefaultElement: Partial<LensflareElementProps>, seed?: number | undefined, seedProps?: SeedProps[] | undefined, systemDefaultElement?: LensflareElementProps) => LensflareElementProps[];
30
31
  export interface LensflareElementProps {
31
32
  texture: Texture | string;
@@ -1,20 +1,23 @@
1
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
- speed: number;
3
- rotationFactor?: number | undefined;
4
- floatFactor?: number | undefined;
5
- range?: [number, number] | undefined;
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ speed?: number;
6
+ rotationFactor?: number;
7
+ floatFactor?: number;
8
+ range?: [number, number];
6
9
  }>, {
7
10
  speed: number;
8
11
  rotationFactor: number;
9
12
  floatFactor: number;
10
13
  range: () => number[];
11
14
  }>, {
12
- value: import("vue").ShallowRef<any>;
13
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
14
- speed: number;
15
- rotationFactor?: number | undefined;
16
- floatFactor?: number | undefined;
17
- range?: [number, number] | undefined;
15
+ instance: import('vue').ShallowRef<any>;
16
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
17
+ speed?: number;
18
+ rotationFactor?: number;
19
+ floatFactor?: number;
20
+ range?: [number, number];
18
21
  }>, {
19
22
  speed: number;
20
23
  rotationFactor: number;
@@ -25,9 +28,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
25
28
  rotationFactor: number;
26
29
  floatFactor: number;
27
30
  range: [number, number];
28
- }, {}>, {
29
- default?(_: {}): any;
30
- }>;
31
+ }, {}>;
32
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
31
33
  export default _default;
32
34
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
33
35
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -9,33 +9,44 @@ export interface MouseParallaxProps {
9
9
  disabled?: boolean;
10
10
  /**
11
11
  * The factor to multiply the mouse movement by.
12
- * @type {number}
12
+ * @type {number | [number, number]}
13
13
  * @default 2.5
14
14
  * @memberof MouseParallaxProps
15
15
  *
16
- **/
17
- factor?: number;
16
+ */
17
+ factor?: number | [number, number];
18
18
  /**
19
- * The factor to multiply the mouse movement by.
20
- * @type {number}
19
+ * The factor to smooth the mouse movement by.
20
+ * @type {number | [number, number]}
21
21
  * @default 2.5
22
22
  * @memberof MouseParallaxProps
23
23
  *
24
- **/
25
- ease?: number;
24
+ */
25
+ ease?: number | [number, number];
26
+ /**
27
+ * Whether to apply the parallax effect to the local canvas.
28
+ * @type {boolean}
29
+ * @default false
30
+ * @memberof MouseParallaxProps
31
+ *
32
+ */
33
+ local?: boolean;
26
34
  }
27
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MouseParallaxProps>, {
35
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MouseParallaxProps>, {
28
36
  disabled: boolean;
29
37
  factor: number;
30
38
  ease: number;
31
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MouseParallaxProps>, {
39
+ local: boolean;
40
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<MouseParallaxProps>, {
32
41
  disabled: boolean;
33
42
  factor: number;
34
43
  ease: number;
44
+ local: boolean;
35
45
  }>>>, {
36
46
  disabled: boolean;
37
- factor: number;
38
- ease: number;
47
+ factor: number | [number, number];
48
+ ease: number | [number, number];
49
+ local: boolean;
39
50
  }, {}>;
40
51
  export default _default;
41
52
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -0,0 +1,69 @@
1
+ import { PositionalAudio } from 'three';
2
+
3
+ export interface PositionalAudioProps {
4
+ ready: boolean;
5
+ url: string;
6
+ distance?: number;
7
+ helper?: boolean;
8
+ loop?: boolean;
9
+ autoplay?: boolean;
10
+ innerAngle?: number;
11
+ outerAngle?: number;
12
+ outerGain?: number;
13
+ }
14
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PositionalAudioProps>, {
15
+ ready: boolean;
16
+ helper: boolean;
17
+ distance: number;
18
+ loop: boolean;
19
+ autoplay: boolean;
20
+ innerAngle: number;
21
+ outerAngle: number;
22
+ outerGain: number;
23
+ }>, {
24
+ root: import('vue').ShallowRef<PositionalAudio | null>;
25
+ play: () => void;
26
+ stop: () => void;
27
+ pause: () => void;
28
+ dispose: () => void;
29
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
30
+ isPlaying: (...args: any[]) => void;
31
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<PositionalAudioProps>, {
32
+ ready: boolean;
33
+ helper: boolean;
34
+ distance: number;
35
+ loop: boolean;
36
+ autoplay: boolean;
37
+ innerAngle: number;
38
+ outerAngle: number;
39
+ outerGain: number;
40
+ }>>> & {
41
+ onIsPlaying?: ((...args: any[]) => any) | undefined;
42
+ }, {
43
+ ready: boolean;
44
+ distance: number;
45
+ helper: boolean;
46
+ loop: boolean;
47
+ autoplay: boolean;
48
+ innerAngle: number;
49
+ outerAngle: number;
50
+ outerGain: number;
51
+ }, {}>;
52
+ export default _default;
53
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
54
+ type __VLS_TypePropsToRuntimeProps<T> = {
55
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
56
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
57
+ } : {
58
+ type: import('vue').PropType<T[K]>;
59
+ required: true;
60
+ };
61
+ };
62
+ type __VLS_WithDefaults<P, D> = {
63
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
64
+ default: D[K];
65
+ }> : P[K];
66
+ };
67
+ type __VLS_Prettify<T> = {
68
+ [K in keyof T]: T[K];
69
+ } & {};
@@ -1,5 +1,6 @@
1
- import type { TresColor } from '@tresjs/core';
2
- import { Reflector } from 'three/examples/jsm/objects/Reflector.js';
1
+ import { TresColor } from '@tresjs/core';
2
+ import { Reflector } from 'three-stdlib';
3
+
3
4
  export interface ReflectorProps {
4
5
  /**
5
6
  * The color of the reflector.
@@ -56,7 +57,10 @@ export interface ReflectorProps {
56
57
  */
57
58
  shader?: object;
58
59
  }
59
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ReflectorProps>, {
60
+ declare function __VLS_template(): {
61
+ default?(_: {}): any;
62
+ };
63
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ReflectorProps>, {
60
64
  color: string;
61
65
  textureWidth: number;
62
66
  textureHeight: number;
@@ -64,8 +68,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
64
68
  multisample: number;
65
69
  shader: any;
66
70
  }>, {
67
- reflectorRef: import("vue").ShallowRef<Reflector | undefined>;
68
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ReflectorProps>, {
71
+ instance: import('vue').ShallowRef<Reflector | undefined>;
72
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ReflectorProps>, {
69
73
  color: string;
70
74
  textureWidth: number;
71
75
  textureHeight: number;
@@ -73,15 +77,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
73
77
  multisample: number;
74
78
  shader: any;
75
79
  }>>>, {
76
- color: import("three").ColorRepresentation | [r: number, g: number, b: number];
80
+ color: TresColor;
77
81
  textureWidth: number;
78
82
  textureHeight: number;
79
83
  clipBias: number;
80
84
  multisample: number;
81
85
  shader: object;
82
- }, {}>, {
83
- default?(_: {}): any;
84
- }>;
86
+ }, {}>;
87
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
85
88
  export default _default;
86
89
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
87
90
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -114,7 +114,10 @@ export interface Text3DProps {
114
114
  */
115
115
  needUpdates?: boolean;
116
116
  }
117
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Text3DProps>, {
117
+ declare function __VLS_template(): {
118
+ default?(_: {}): any;
119
+ };
120
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Text3DProps>, {
118
121
  size: number;
119
122
  height: number;
120
123
  curveSegments: number;
@@ -126,8 +129,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
126
129
  center: boolean;
127
130
  needUpdates: boolean;
128
131
  }>, {
129
- value: import("vue").ShallowRef<any>;
130
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Text3DProps>, {
132
+ instance: import('vue').ShallowRef<any>;
133
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Text3DProps>, {
131
134
  size: number;
132
135
  height: number;
133
136
  curveSegments: number;
@@ -149,9 +152,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
149
152
  bevelOffset: number;
150
153
  bevelSegments: number;
151
154
  needUpdates: boolean;
152
- }, {}>, {
153
- default?(_: {}): any;
154
- }>;
155
+ }, {}>;
156
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
155
157
  export default _default;
156
158
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
157
159
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,13 +1,16 @@
1
- import Text3D from './Text3D.vue';
1
+ import { default as Text3D } from './Text3D.vue';
2
2
  import { useAnimations } from './useAnimations';
3
- import Levioso from './Levioso.vue';
4
- import Reflector from './Reflector.vue';
5
- import MouseParallax from './MouseParallax.vue';
3
+ import { default as Levioso } from './Levioso.vue';
4
+ import { default as Reflector } from './Reflector.vue';
5
+ import { default as MouseParallax } from './MouseParallax.vue';
6
6
  import { GlobalAudio } from './GlobalAudio';
7
- import Lensflare from './Lensflare/component.vue';
8
- import Fbo from './useFBO/component.vue';
9
- import Sampler from './useSurfaceSampler/component.vue';
7
+ import { default as Lensflare } from './Lensflare/component.vue';
8
+ import { default as Fbo } from './useFBO/component.vue';
9
+ import { default as Sampler } from './useSurfaceSampler/component.vue';
10
+ import { default as AnimatedSprite } from './AnimatedSprite/component.vue';
11
+ import { default as PositionalAudio } from './PositionalAudio.vue';
12
+
10
13
  export * from './useFBO/';
11
14
  export * from './useSurfaceSampler';
12
15
  export * from '../staging/useEnvironment';
13
- export { Text3D, useAnimations, MouseParallax, Levioso, Reflector, Lensflare, GlobalAudio, Fbo, Sampler, };
16
+ export { Text3D, useAnimations, MouseParallax, Levioso, Reflector, Lensflare, GlobalAudio, Fbo, Sampler, AnimatedSprite, PositionalAudio, };
@@ -1,6 +1,6 @@
1
- import type { AnimationAction, AnimationClip, Object3D, Scene } from 'three';
2
- import { AnimationMixer } from 'three';
3
- import type { Ref } from 'vue';
1
+ import { AnimationAction, AnimationClip, Object3D, Scene, AnimationMixer } from 'three';
2
+ import { Ref } from 'vue';
3
+
4
4
  /**
5
5
  * Creates an AnimationMixer and returns it.
6
6
  *
@@ -11,7 +11,7 @@ import type { Ref } from 'vue';
11
11
  * @return {*}
12
12
  */
13
13
  export declare function useAnimations<T extends AnimationClip>(animations: T[], modelRef?: Scene | Ref<Object3D | undefined | null>): {
14
- actions: import("vue").ShallowReactive<{
14
+ actions: import('vue').ShallowReactive<{
15
15
  [key: string]: AnimationAction;
16
16
  }>;
17
17
  mixer: AnimationMixer;
@@ -1,14 +1,15 @@
1
- import type { FboOptions } from '.';
2
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FboOptions>, {
1
+ import { FboOptions } from '.';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FboOptions>, {
3
4
  depth: boolean;
4
5
  settings: undefined;
5
6
  }>, {
6
- value: import("vue").Ref<import("three").WebGLRenderTarget<import("three").Texture> | null>;
7
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FboOptions>, {
7
+ instance: import('vue').Ref<import('three').WebGLRenderTarget<import('three').Texture> | null>;
8
+ }, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FboOptions>, {
8
9
  depth: boolean;
9
10
  settings: undefined;
10
11
  }>>>, {
11
- settings: import("three").WebGLRenderTargetOptions;
12
+ settings: import('three').RenderTargetOptions;
12
13
  depth: boolean;
13
14
  }, {}>;
14
15
  export default _default;
@@ -1,10 +1,10 @@
1
- import type { WebGLRenderTargetOptions } from 'three';
2
- import { WebGLRenderTarget } from 'three';
3
- import type { Ref } from 'vue';
1
+ import { RenderTargetOptions, WebGLRenderTarget } from 'three';
2
+ import { Ref } from 'vue';
3
+
4
4
  export interface FboOptions {
5
5
  width?: number;
6
6
  height?: number;
7
7
  depth?: boolean;
8
- settings?: WebGLRenderTargetOptions;
8
+ settings?: RenderTargetOptions;
9
9
  }
10
- export declare function useFBO(options: FboOptions): Ref<WebGLRenderTarget<import("three").Texture> | null>;
10
+ export declare function useFBO(options: FboOptions): Ref<WebGLRenderTarget<import('three').Texture> | null>;