diff --git a/types/three/src/core/EventDispatcher.d.ts b/types/three/src/core/EventDispatcher.d.ts index 403dd1c2e..6066a001b 100644 --- a/types/three/src/core/EventDispatcher.d.ts +++ b/types/three/src/core/EventDispatcher.d.ts @@ -39,6 +39,27 @@ export type EventListener = ( * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/EventDispatcher.js | Source} */ export class EventDispatcher { + /** + * Maps event types to the list of their listeners. + * Only initialized when a listener is added. + * Event type entries are created when their first listener is added. + * + * @example + * ```typescript + * type MyDisp = EventDispatcher<{ a: { b: number }, c: { d: string } }>; + * const disp = new MyDisp(); + * // typeof disp._listeners == + * // | undefined + * // | { + * // a?: EventListener<{ b: number }, 'a', this>[], + * // c?: EventListener<{ d: string }, 'c', this>[], + * // }; + * ``` + */ + protected _listeners?: { + [Type in Extract]?: EventListener[]; + }; + /** * Creates {@link THREE.EventDispatcher | EventDispatcher} object. */