Skip to content

Commit

Permalink
types-extra Refactor MeshAssignableMaterial and `PointsAssignable…
Browse files Browse the repository at this point in the history
…Material` types (#200)

Make them more explicit.
  • Loading branch information
Vatroslav Vrbanic committed Dec 18, 2022
1 parent b63f9c4 commit f5dce29
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/lib/types/types-extra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,22 @@ export type get_props<T> = OnlyWritableNonFunctionProps<T>
export type RemoveFirst<T extends unknown[]> = T extends [unknown, ...infer R] ? R : T
export type RemoveLast<T extends unknown[]> = T extends [...infer H, unknown] ? H : T

export type MeshAssignableMaterial = THREE.Material | THREE.Material[]
export type PointsAssignableMaterial = THREE.Material | THREE.Material[] | THREE.PointsMaterial
export type MeshAssignableMaterial =
| THREE.MeshBasicMaterial
| THREE.MeshDepthMaterial
| THREE.MeshDistanceMaterial
| THREE.MeshLambertMaterial
| THREE.MeshMatcapMaterial
| THREE.MeshNormalMaterial
| THREE.MeshPhongMaterial
| THREE.MeshPhysicalMaterial
| THREE.MeshStandardMaterial
| THREE.MeshToonMaterial
| THREE.RawShaderMaterial
| THREE.ShaderMaterial
| THREE.ShadowMaterial

export type PointsAssignableMaterial = THREE.PointsMaterial | MeshAssignableMaterial

// Animation

Expand Down

0 comments on commit f5dce29

Please sign in to comment.