@react-three/drei 9.99.5 → 9.99.6

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/core/Center.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { Group } from 'three';
1
+ import { Box3, Vector3, Sphere, Group, Object3D } from 'three';
2
2
  import { ForwardRefComponent } from '../helpers/ts-utils';
3
3
  export type OnCenterCallbackProps = {
4
- parent: THREE.Object3D;
5
- container: THREE.Object3D;
4
+ parent: Object3D;
5
+ container: Object3D;
6
6
  width: number;
7
7
  height: number;
8
8
  depth: number;
9
- boundingBox: THREE.Box3;
10
- boundingSphere: THREE.Sphere;
11
- center: THREE.Vector3;
9
+ boundingBox: Box3;
10
+ boundingSphere: Sphere;
11
+ center: Vector3;
12
12
  verticalAlignment: number;
13
13
  horizontalAlignment: number;
14
14
  depthAlignment: number;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Object3DNode } from '@react-three/fiber';
3
- import { Scene } from 'three';
3
+ import { Texture, Scene } from 'three';
4
4
  import { GroundProjectedEnv as GroundProjectedEnvImpl } from 'three-stdlib';
5
5
  import { PresetsType } from '../helpers/environment-assets';
6
6
  import { EnvironmentLoaderProps } from './useEnvironment';
@@ -12,9 +12,9 @@ export type EnvironmentProps = {
12
12
  resolution?: number;
13
13
  background?: boolean | 'only';
14
14
  blur?: number;
15
- map?: THREE.Texture;
15
+ map?: Texture;
16
16
  preset?: PresetsType;
17
- scene?: Scene | React.MutableRefObject<THREE.Scene>;
17
+ scene?: Scene | React.MutableRefObject<Scene>;
18
18
  ground?: boolean | {
19
19
  radius?: number;
20
20
  height?: number;
@@ -1,3 +1,4 @@
1
+ import { ShaderMaterial } from 'three';
1
2
  import { ReactThreeFiber } from '@react-three/fiber';
2
3
  import { ForwardRefComponent } from '../helpers/ts-utils';
3
4
  declare global {
@@ -7,4 +8,4 @@ declare global {
7
8
  }
8
9
  }
9
10
  }
10
- export declare const MeshDiscardMaterial: ForwardRefComponent<JSX.IntrinsicElements['shaderMaterial'], THREE.ShaderMaterial>;
11
+ export declare const MeshDiscardMaterial: ForwardRefComponent<JSX.IntrinsicElements['shaderMaterial'], ShaderMaterial>;
package/core/Trail.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ColorRepresentation, Object3D } from 'three';
2
+ import { ColorRepresentation, Mesh, Object3D } from 'three';
3
3
  import { MeshLineGeometry as MeshLineGeometryImpl } from 'meshline';
4
4
  import { ForwardRefComponent } from '../helpers/ts-utils';
5
5
  type Settings = {
@@ -16,6 +16,6 @@ type TrailProps = {
16
16
  target?: React.MutableRefObject<Object3D>;
17
17
  } & Partial<Settings>;
18
18
  export declare function useTrail(target: Object3D, settings: Partial<Settings>): React.MutableRefObject<Float32Array | undefined>;
19
- export type MeshLineGeometry = THREE.Mesh & MeshLineGeometryImpl;
19
+ export type MeshLineGeometry = Mesh & MeshLineGeometryImpl;
20
20
  export declare const Trail: ForwardRefComponent<React.PropsWithChildren<TrailProps>, MeshLineGeometry>;
21
21
  export {};
@@ -1,10 +1,13 @@
1
- import { Texture, Loader, CubeTexture, TextureEncoding } from 'three';
1
+ import { Texture, Loader, CubeTexture } from 'three';
2
2
  import { PresetsType } from '../helpers/environment-assets';
3
+ declare const LinearEncoding = 3000;
4
+ declare const sRGBEncoding = 3001;
3
5
  export type EnvironmentLoaderProps = {
4
6
  files?: string | string[];
5
7
  path?: string;
6
8
  preset?: PresetsType;
7
9
  extensions?: (loader: Loader) => void;
8
- encoding?: TextureEncoding;
10
+ encoding?: typeof LinearEncoding | typeof sRGBEncoding;
9
11
  };
10
12
  export declare function useEnvironment({ files, path, preset, encoding, extensions, }?: Partial<EnvironmentLoaderProps>): Texture | CubeTexture | (CubeTexture & Record<"colorSpace", unknown>);
13
+ export {};
@@ -5,6 +5,8 @@ import { presetsObj } from '../helpers/environment-assets.js';
5
5
 
6
6
  const CUBEMAP_ROOT = 'https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/';
7
7
  const isArray = arr => Array.isArray(arr);
8
+ const LinearEncoding = 3000;
9
+ const sRGBEncoding = 3001;
8
10
  function useEnvironment({
9
11
  files = ['/px.png', '/nx.png', '/py.png', '/ny.png', '/pz.png', '/nz.png'],
10
12
  path = '',
@@ -37,8 +39,6 @@ function useEnvironment({
37
39
  // @ts-ignore
38
40
  loaderResult[0] : loaderResult;
39
41
  texture.mapping = isCubeMap ? CubeReflectionMapping : EquirectangularReflectionMapping;
40
- const sRGBEncoding = 3001;
41
- const LinearEncoding = 3000;
42
42
  if ('colorSpace' in texture) texture.colorSpace = (encoding !== null && encoding !== void 0 ? encoding : isCubeMap) ? 'srgb' : 'srgb-linear';else texture.encoding = (encoding !== null && encoding !== void 0 ? encoding : isCubeMap) ? sRGBEncoding : LinearEncoding;
43
43
  return texture;
44
44
  }
@@ -1,2 +1,3 @@
1
1
  import * as React from 'react';
2
- export declare function useIntersect<T extends THREE.Object3D>(onChange: (visible: boolean) => void): React.MutableRefObject<T>;
2
+ import { Object3D } from 'three';
3
+ export declare function useIntersect<T extends Object3D>(onChange: (visible: boolean) => void): React.MutableRefObject<T>;
@@ -1,2 +1,2 @@
1
1
  import { Texture } from 'three';
2
- export declare function useMatcapTexture(id?: number | string, format?: number, onLoad?: (texture: Texture | Texture[]) => void): [THREE.Texture, string, number];
2
+ export declare function useMatcapTexture(id?: number | string, format?: number, onLoad?: (texture: Texture | Texture[]) => void): [Texture, string, number];