Skip to content

Commit 11bd428

Browse files
authored
fix(types): stub TextureEncoding (#347)
1 parent da07863 commit 11bd428

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

src/objects/Reflector.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Mesh, BufferGeometry, Color, TextureEncoding, WebGLRenderTarget, PerspectiveCamera } from 'three'
1+
import { Mesh, BufferGeometry, Color, WebGLRenderTarget, PerspectiveCamera } from 'three'
2+
import { TextureEncoding } from '../types/shared'
23

34
export interface ReflectorOptions {
45
color?: Color | string | number

src/objects/Refractor.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Mesh, BufferGeometry, Color, TextureEncoding, WebGLRenderTarget, PerspectiveCamera } from 'three'
1+
import { Mesh, BufferGeometry, Color, WebGLRenderTarget, PerspectiveCamera } from 'three'
2+
import { TextureEncoding } from '../types/shared'
23

34
export interface RefractorOptions {
45
color?: Color | string | number

src/objects/Water2.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { BufferGeometry, Color, Mesh, ShaderMaterial, Texture, TextureEncoding, Vector2 } from 'three'
1+
import { BufferGeometry, Color, Mesh, ShaderMaterial, Texture, Vector2 } from 'three'
2+
import { TextureEncoding } from '../types/shared'
23

34
export interface Water2Options {
45
color?: Color | string | number

src/types/shared.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ export type TypedArrayConstructors =
1919
| Uint32Array['constructor']
2020
| Float32Array['constructor']
2121
| Float64Array['constructor']
22+
23+
type LinearEncoding = 3000
24+
type sRGBEncoding = 3001
25+
/**
26+
* Stub for `TextureEncoding` type since it was removed in r162.
27+
*/
28+
export type TextureEncoding = LinearEncoding | sRGBEncoding

0 commit comments

Comments
 (0)