TypeScript: module augmentation, add methods and properties to Object3D

Hello there,

I’m having troubles augmenting definitions for the "three" module.

I’d like to add methods and attributes on THREE.Object3D. I’ve tried many variations of the following example, but none of them seem to work:

augment.d.ts:

/// <reference types="three" />

declare namespace THREE {
    export interface Object3D {
        addBehaviour (klass: any): any;
        getEntity (): any;
    }
}

Usage:

53

Anyone has experience augmenting THREE definitions on TypeScript?
Cheers!

I’m trying to do the same, my best effort so far was:

But then for some reason the original import goes missing, and only the interface declaration is seen by the code. Which leads to the error: 'Object3D' only refers to a type, but is being used as a value here.