diff --git a/components.d.ts b/components.d.ts index 95e629eac..eaae2efbe 100644 --- a/components.d.ts +++ b/components.d.ts @@ -1 +1 @@ -export * from './dist/components/index.js' +export * from './dist/src/components/index.js' diff --git a/composables.d.ts b/composables.d.ts index 0cfe53c3d..365506fb3 100644 --- a/composables.d.ts +++ b/composables.d.ts @@ -1 +1 @@ -export * from './dist/composables/index.js' +export * from './dist/src/composables/index.js' diff --git a/package.json b/package.json index 9fafc9455..c867bd913 100644 --- a/package.json +++ b/package.json @@ -21,16 +21,16 @@ "import": "./dist/tres.js" }, "./components": { - "types": "./dist/components/index.d.ts" + "types": "./dist/src/components/index.d.ts" }, "./composables": { - "types": "./dist/composables/index.d.ts" + "types": "./dist/src/composables/index.d.ts" }, "./types": { - "types": "./dist/types/index.d.ts" + "types": "./dist/src/types/index.d.ts" }, "./utils": { - "types": "./dist/utils/index.d.ts" + "types": "./dist/src/utils/index.d.ts" }, "./*": "./*" }, diff --git a/src/composables/useLoader/index.ts b/src/composables/useLoader/index.ts index 8f69fc144..ccd55bb3a 100644 --- a/src/composables/useLoader/index.ts +++ b/src/composables/useLoader/index.ts @@ -1,8 +1,8 @@ import { isArray } from '@alvarosabu/utils' -import type { Object3D } from 'three' +import type { Loader, Object3D } from 'three' import { useLogger } from '../useLogger' -export interface TresLoader extends THREE.Loader { +export interface TresLoader extends Loader { load( url: string, onLoad?: (result: T) => void, diff --git a/src/composables/useRaycaster/index.ts b/src/composables/useRaycaster/index.ts index 26329cc00..b46b5fec2 100644 --- a/src/composables/useRaycaster/index.ts +++ b/src/composables/useRaycaster/index.ts @@ -1,5 +1,5 @@ import { Vector2 } from 'three' -import type { Object3D, type Intersection } from 'three' +import type { Object3D, Intersection, Object3DEventMap } from 'three' import type { Ref } from 'vue' import { computed, onUnmounted } from 'vue' import type { EventHook } from '@vueuse/core' @@ -7,7 +7,7 @@ import { createEventHook, useElementBounding, usePointer } from '@vueuse/core' import { type TresContext } from '../useTresContextProvider' -export type Intersects = Intersection>[] +export type Intersects = Intersection>[] interface PointerMoveEventPayload { intersects?: Intersects event: PointerEvent @@ -19,7 +19,7 @@ interface PointerClickEventPayload { } export const useRaycaster = ( - objects: Ref, + objects: Ref, { renderer, camera, raycaster }: Pick, ) => { // having a separate computed makes useElementBounding work diff --git a/src/composables/useSeek/index.ts b/src/composables/useSeek/index.ts index b98be6499..2ff29fcbd 100644 --- a/src/composables/useSeek/index.ts +++ b/src/composables/useSeek/index.ts @@ -1,3 +1,4 @@ +import type { Scene, Object3D } from 'three' import { useLogger } from '../useLogger' /** @@ -7,10 +8,10 @@ import { useLogger } from '../useLogger' * @interface UseSeekReturn */ export interface UseSeekReturn { - seek: (parent: THREE.Scene | THREE.Object3D, property: string, value: string) => THREE.Object3D | null - seekByName: (parent: THREE.Scene | THREE.Object3D, value: string) => THREE.Object3D | null - seekAll: (parent: THREE.Scene | THREE.Object3D, property: string, value: string) => THREE.Object3D[] - seekAllByName: (parent: THREE.Scene | THREE.Object3D, value: string) => THREE.Object3D[] + seek: (parent: Scene | Object3D, property: string, value: string) => Object3D | null + seekByName: (parent: Scene | Object3D, value: string) => Object3D | null + seekAll: (parent: Scene | Object3D, property: string, value: string) => Object3D[] + seekAllByName: (parent: Scene | Object3D, value: string) => Object3D[] } /** @@ -25,13 +26,13 @@ export function useSeek(): UseSeekReturn { /** * Returns a child object of the parent given a property * - * @param {(THREE.Scene | THREE.Object3D)} parent + * @param {(Scene | Object3D)} parent * @param {string} property * @param {string} value - * @return {*} {(THREE.Object3D | null)} + * @return {*} {(Object3D | null)} */ - function seek(parent: THREE.Scene | THREE.Object3D, property: string, value: string): THREE.Object3D | null { - let foundChild: THREE.Object3D | null = null + function seek(parent: Scene | Object3D, property: string, value: string): Object3D | null { + let foundChild: Object3D | null = null parent.traverse((child) => { if ((child as any)[property] === value) { @@ -49,13 +50,13 @@ export function useSeek(): UseSeekReturn { /** * Returns an array of child objects of the parent given a property * - * @param {(THREE.Scene | THREE.Object3D)} parent + * @param {(Scene | Object3D)} parent * @param {string} property * @param {string} value - * @return {*} {(THREE.Object3D[])} + * @return {*} {(Object3D[])} */ - function seekAll(parent: THREE.Scene | THREE.Object3D, property: string, value: string): THREE.Object3D[] { - const foundChildren: THREE.Object3D[] = [] + function seekAll(parent: Scene | Object3D, property: string, value: string): Object3D[] { + const foundChildren: Object3D[] = [] parent.traverse((child) => { if ((child as any)[property].includes(value)) { @@ -73,22 +74,22 @@ export function useSeek(): UseSeekReturn { /** * Returns a child object of the parent given a child.name * - * @param {(THREE.Scene | THREE.Object3D)} parent + * @param {(Scene | Object3D)} parent * @param {string} value - * @return {*} {(THREE.Object3D | null)} + * @return {*} {(Object3D | null)} */ - function seekByName(parent: THREE.Scene | THREE.Object3D, value: string): THREE.Object3D | null { + function seekByName(parent: Scene | Object3D, value: string): Object3D | null { return seek(parent, 'name', value) } /** * Returns an array of child objects of the parent given a child.name * - * @param {(THREE.Scene | THREE.Object3D)} parent + * @param {(Scene | Object3D)} parent * @param {string} value - * @return {*} {(THREE.Object3D[])} + * @return {*} {(Object3D[])} */ - function seekAllByName(parent: THREE.Scene | THREE.Object3D, value: string): THREE.Object3D[] { + function seekAllByName(parent: Scene | Object3D, value: string): Object3D[] { return seekAll(parent, 'name', value) } diff --git a/types.d.ts b/types.d.ts index 0dad9454a..9551693c9 100644 --- a/types.d.ts +++ b/types.d.ts @@ -1 +1 @@ -export * from './dist/types/index.js' +export * from './dist/src/types/index.js' diff --git a/utils.d.ts b/utils.d.ts index 6dde10dee..3143f3664 100644 --- a/utils.d.ts +++ b/utils.d.ts @@ -1 +1 @@ -export * from './dist/utils/index.js' +export * from './dist/src/utils/index.js'