diff --git a/packages/fiber/src/core/events.ts b/packages/fiber/src/core/events.ts index 545402ac13..9d8bda3a02 100644 --- a/packages/fiber/src/core/events.ts +++ b/packages/fiber/src/core/events.ts @@ -4,6 +4,7 @@ import { getRootState } from './utils' import type { UseBoundStore } from 'zustand' import type { Instance } from './renderer' import type { RootState } from './store' +import type { Properties } from '../three-types' export interface Intersection extends THREE.Intersection { /** The event source (the object which registered the handler) */ @@ -34,7 +35,7 @@ export interface IntersectionEvent extends Intersection { } export type Camera = THREE.OrthographicCamera | THREE.PerspectiveCamera -export type ThreeEvent = IntersectionEvent +export type ThreeEvent = IntersectionEvent & Properties export type DomEvent = PointerEvent | MouseEvent | WheelEvent export type Events = { diff --git a/packages/fiber/src/core/index.tsx b/packages/fiber/src/core/index.tsx index db77218d81..6e6d9975c4 100644 --- a/packages/fiber/src/core/index.tsx +++ b/packages/fiber/src/core/index.tsx @@ -32,14 +32,13 @@ import { } from './utils' import { useStore } from './hooks' import { OffscreenCanvas } from 'three' +import type { Properties } from '../three-types' const roots = new Map() const { invalidate, advance } = createLoop(roots) const { reconciler, applyProps } = createRenderer(roots, getEventPriority) const shallowLoose = { objects: 'shallow', strict: false } as EquConfig -type Properties = Pick any ? never : K }[keyof T]> - type GLProps = | Renderer | ((canvas: HTMLCanvasElement) => Renderer) diff --git a/packages/fiber/src/three-types.ts b/packages/fiber/src/three-types.ts index 9c27cd80a1..ab94b05644 100644 --- a/packages/fiber/src/three-types.ts +++ b/packages/fiber/src/three-types.ts @@ -2,6 +2,7 @@ import * as THREE from 'three' import { EventHandlers } from './core/events' import { AttachType } from './core/renderer' +export type Properties = Pick any ? never : K }[keyof T]> export type NonFunctionKeys = { [K in keyof T]-?: T[K] extends Function ? never : K }[keyof T] export type Overwrite = Omit> & O