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)
  • Loading branch information
sguimmara committed Jan 7, 2025
1 parent 82d89b1 commit adbeb76
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// three.js
export { TilesRenderer } from './three/TilesRenderer';
export { TilesGroup } from './three/TilesGroup';
export { EnvironmentControls } from './three/controls/EnvironmentControls';
export { GlobeControls } from './three/controls/GlobeControls';
export { CameraTransitionManager } from './three/controls/CameraTransitionManager';
export { B3DMLoader, B3DMScene } from './three/loaders/B3DMLoader';
export { I3DMLoader, I3DMScene } from './three/loaders/I3DMLoader';
export { PNTSLoader, PNTSScene } from './three/loaders/PNTSLoader';
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 { OrthographicCamera, PerspectiveCamera } from 'three';

Check failure on line 1 in src/three/controls/CameraTransitionManager.d.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Cannot find name 'EventDispatcher'.

Check failure on line 1 in src/three/controls/CameraTransitionManager.d.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Cannot find name 'EventDispatcher'.

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;

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

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

A parameter initializer is only allowed in a function or constructor implementation.

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

A parameter initializer is only allowed in a function or constructor implementation.

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

A parameter initializer is only allowed in a function or constructor implementation.

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

A parameter initializer is only allowed in a function or constructor implementation.

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

A parameter initializer is only allowed in a function or constructor implementation.

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

A parameter initializer is only allowed in a function or constructor implementation.

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

A parameter initializer is only allowed in a function or constructor implementation.

Check failure on line 1 in src/three/controls/EnvironmentControls.d.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

A parameter initializer is only allowed in a function or constructor implementation.
import { TilesRenderer } from '../TilesRenderer';

export class EnvironmentControls extends EventDispatcher {

readonly isEnvironmentControls: true;

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

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

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 adbeb76

Please sign in to comment.