three-stdlib icon indicating copy to clipboard operation
three-stdlib copied to clipboard

type errors on `addEventListener` for any class that extends from `EventDispatcher`

Open RodrigoHamuy opened this issue 1 year ago • 0 comments

  • @types/three version: from 0.168.0
  • three-stdlib version: 2.34.0

Problem description:

@types/three introduced on v168 the breaking change that unknown events can no longer be dispatched in EventDispatcher (source).

Relevant code:

So now this will throw TS errors:

import { OrbitControls } from "three-stdlib";

const orbit = new OrbitControls();

orbit.addEventListener("start", ()=> console.log('started'));
// Argument of type 'string' is not assignable to parameter of type 'never'.

RodrigoHamuy avatar Nov 28 '24 22:11 RodrigoHamuy