Skip to content

Commit

Permalink
Add TransformControlMode and add missing event mode
Browse files Browse the repository at this point in the history
  • Loading branch information
s-rigaud committed May 17, 2024
1 parent 82b6263 commit 6cddeb0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions types/three/examples/jsm/controls/TransformControls.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Camera, Mesh, MOUSE, Object3D, Object3DEventMap, Quaternion, Raycaster, Vector3 } from "three";

type TransformControlMode = "translate" | "rotate" | "scale";

export interface TransformControlsEventMap extends Object3DEventMap {
change: {};
mouseDown: {};
mouseUp: {};
mouseDown: { mode: TransformControlMode };
mouseUp: { mode: TransformControlMode };
objectChange: {};
"camera-changed": { value: unknown };
"object-changed": { value: unknown };
Expand Down Expand Up @@ -43,7 +45,7 @@ export class TransformControls extends Object3D<TransformControlsEventMap> {
object: Object3D | undefined;
enabled: boolean;
axis: "X" | "Y" | "Z" | "E" | "XY" | "YZ" | "XZ" | "XYZ" | "XYZE" | null;
mode: "translate" | "rotate" | "scale";
mode: TransformControlMode;
translationSnap: number | null;
rotationSnap: number | null;
space: "world" | "local";
Expand All @@ -67,9 +69,9 @@ export class TransformControls extends Object3D<TransformControlsEventMap> {

attach(object: Object3D): this;
detach(): this;
getMode(): "translate" | "rotate" | "scale";
getMode(): TransformControlMode;
getRaycaster(): Raycaster;
setMode(mode: "translate" | "rotate" | "scale"): void;
setMode(mode: TransformControlMode): void;
setTranslationSnap(translationSnap: number | null): void;
setRotationSnap(rotationSnap: number | null): void;
setScaleSnap(scaleSnap: number | null): void;
Expand Down Expand Up @@ -108,7 +110,7 @@ export class TransformControlsPlane extends Mesh {

constructor();

mode: "translate" | "scale" | "rotate";
mode: TransformControlMode;

axis: "X" | "Y" | "Z" | "XY" | "YZ" | "XZ" | "XYZ" | "E";

Expand Down

0 comments on commit 6cddeb0

Please sign in to comment.