Skip to content

Commit

Permalink
fix(controls): export controls declaration files (GlobeControls, Envi…
Browse files Browse the repository at this point in the history
…ronmentControls, CameraTransitionManager) (#909)
  • Loading branch information
sguimmara authored Jan 8, 2025
1 parent a29847d commit 8142a2d
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export { EllipsoidRegion } from './three/math/EllipsoidRegion';
export * as GeoUtils from './three/math/GeoUtils';
export * from './three/math/GeoConstants';

// three.js controls
export { GlobeControls } from './three/controls/GlobeControls';
export { EnvironmentControls } from './three/controls/EnvironmentControls';
export { CameraTransitionManager } from './three/controls/CameraTransitionManager';

// common
export { TilesRendererBase } from './base/TilesRendererBase';
export { Tile } from './base/Tile';
Expand Down
18 changes: 18 additions & 0 deletions src/three/controls/CameraTransitionManager.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { EventDispatcher, OrthographicCamera, PerspectiveCamera } from 'three';

export class CameraTransitionManager extends EventDispatcher {

get animating(): boolean;
get camera(): PerspectiveCamera | OrthographicCamera;

get mode(): 'perspective' | 'orthographic';
set mode( v: 'perspective' | 'orthographic' );

constructor( perspectiveCamera?: PerspectiveCamera, orthographicCamera?: OrthographicCamera );

toggle(): void;
update(): void;

syncCameras(): void;

}
44 changes: 44 additions & 0 deletions src/three/controls/EnvironmentControls.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Camera, EventDispatcher, Object3D, Vector3 } from 'three';
import { TilesRenderer } from '../TilesRenderer';

export interface EnvironmentControlsEventMap {
'change': {};
'start': {};
'end': {};
}

export class EnvironmentControls extends EventDispatcher<EnvironmentControlsEventMap> {

readonly isEnvironmentControls: true;

get enabled(): boolean;
set enabled( v: boolean );

constructor(
scene?: Object3D,
camera?: Camera,
domElement?: HTMLElement,
tilesRenderer?: TilesRenderer,
);

setScene ( scene: Object3D ): void;
setCamera ( camera: Camera ): void;
setTilesRenderer( tilesRenderer: TilesRenderer ): void;

attach( domElement: HTMLElement ): void;
detach(): void;

setState( state?: number, fireEvent?: boolean ): void;
resetState(): void;

update( deltaTime?: number ): void;

adjustCamera( camera: Camera ): void;

getUpDirection( point: Vector3, target: Vector3 ): void;
getCameraUpDirection( target: Vector3 ): void;
getPivotPoint ( target: Vector3 ): void;

dispose(): void;

}
15 changes: 15 additions & 0 deletions src/three/controls/GlobeControls.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Group, Vector3 } from 'three';
import { Ellipsoid } from '../math/Ellipsoid';
import { EnvironmentControls } from './EnvironmentControls';

export class GlobeControls extends EnvironmentControls {

readonly isGlobeControls: true;

get ellipsoid(): Ellipsoid;
get tilesGroup(): Group;

getVectorToCenter( target: Vector3 ): Vector3;
getDistanceToCenter(): number;

}

0 comments on commit 8142a2d

Please sign in to comment.