diff --git a/src/core/OrbitControls.tsx b/src/core/OrbitControls.tsx index bb35a3fc7..d6cbceba5 100644 --- a/src/core/OrbitControls.tsx +++ b/src/core/OrbitControls.tsx @@ -1,12 +1,14 @@ import { EventManager, ReactThreeFiber, useFrame, useThree } from '@react-three/fiber' import * as React from 'react' -import type { Camera, Event, OrthographicCamera, PerspectiveCamera } from 'three' +import { Camera, Event, OrthographicCamera, PerspectiveCamera } from 'three' import { OrbitControls as OrbitControlsImpl } from 'three-stdlib' import { ForwardRefComponent } from '../helpers/ts-utils' -export type OrbitControlsChangeEvent = Event & { - target: EventTarget & { object: Camera } -} +type ExtractCallback = T extends { addEventListener(event: E, callback: infer C): void } + ? C + : never + +export type OrbitControlsChangeEvent = Parameters>[0] export type OrbitControlsProps = Omit< ReactThreeFiber.Overwrite<