Changing OrbitControls to TypeScript. dispatchEvent error: Argument of type 'any' is not assignable to parameter of type 'never'

I try to change OrbitControls to TypeScript. How to solve this error:

error TS2345: Argument of type ‘any’ is not assignable to parameter of type ‘never’.
this.dispatchEvent( this._startEvent );

Minimal code that can reproduce the problem:

import {
    EventDispatcher
} from 'three';

const _startEvent = { type: 'start' };

const STATE = {
    NONE: - 1
};

let state = STATE.NONE;

class OrbitControls extends EventDispatcher {

    constructor( object, domElement ) {

        super();

    }

    onMouseDown( event ) {

        if ( state !== STATE.NONE ) {

            this.dispatchEvent( this._startEvent );

        }

    }
}

export { OrbitControls };
1 Like

Thank you very much! That repository has all classes that I need. I can just copy/paste them to my projects.

They have solved the problem of this topic like this by adding @ts-ignore:

      // @ts-ignore
      scope.dispatchEvent(changeEvent)