Skip to content

Commit

Permalink
fix(types): stub TextureEncoding (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 authored Mar 3, 2024
1 parent da07863 commit 11bd428
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/objects/Reflector.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Mesh, BufferGeometry, Color, TextureEncoding, WebGLRenderTarget, PerspectiveCamera } from 'three'
import { Mesh, BufferGeometry, Color, WebGLRenderTarget, PerspectiveCamera } from 'three'
import { TextureEncoding } from '../types/shared'

export interface ReflectorOptions {
color?: Color | string | number
Expand Down
3 changes: 2 additions & 1 deletion src/objects/Refractor.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Mesh, BufferGeometry, Color, TextureEncoding, WebGLRenderTarget, PerspectiveCamera } from 'three'
import { Mesh, BufferGeometry, Color, WebGLRenderTarget, PerspectiveCamera } from 'three'
import { TextureEncoding } from '../types/shared'

export interface RefractorOptions {
color?: Color | string | number
Expand Down
3 changes: 2 additions & 1 deletion src/objects/Water2.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BufferGeometry, Color, Mesh, ShaderMaterial, Texture, TextureEncoding, Vector2 } from 'three'
import { BufferGeometry, Color, Mesh, ShaderMaterial, Texture, Vector2 } from 'three'
import { TextureEncoding } from '../types/shared'

export interface Water2Options {
color?: Color | string | number
Expand Down
7 changes: 7 additions & 0 deletions src/types/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ export type TypedArrayConstructors =
| Uint32Array['constructor']
| Float32Array['constructor']
| Float64Array['constructor']

type LinearEncoding = 3000
type sRGBEncoding = 3001
/**
* Stub for `TextureEncoding` type since it was removed in r162.
*/
export type TextureEncoding = LinearEncoding | sRGBEncoding

0 comments on commit 11bd428

Please sign in to comment.