Add complete TypeScript definitions for CameraTransitionManager #1341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds complete TypeScript definitions for the
CameraTransitionManagerclass to expose all public API that was previously missing from the type definitions.Changes
Event typing: Added
CameraTransitionManagerEventMapinterface defining all event types:camera-change: Fired when the active camera changestransition-start: Fired when a transition animation beginstransition-end: Fired when a transition animation endstoggle: Fired when cameras are toggledchange: Fired during transition with alpha progressMissing properties: Added all public properties from the JavaScript implementation:
fixedPoint: Vector3 - The point in space that remains stable during transitionsduration: number - Transition duration in millisecondsautoSync: boolean - Whether to automatically sync camerasorthographicPositionalZoom: boolean - Zoom behavior settingorthographicOffset: number - Offset for orthographic camera positioningeaseFunction: (x: number) => number - Custom easing functionperspectiveCamera: PerspectiveCamera - The perspective camera instanceorthographicCamera: OrthographicCamera - The orthographic camera instancetransitionCamera: PerspectiveCamera - The intermediate camera used during transitionsMissing getter: Added
alphagetter property that returns transition progressMethod signature: Updated
update()to include optionaldeltaTimeparameterExport: Added
CameraTransitionManagerEventMapto index exportsPattern
This PR follows the same pattern used by
EnvironmentControlsin the repository, usingEventDispatcher<EventMap>for type-safe event handling.Testing
Type definitions have been verified against the JavaScript implementation in
src/three/renderer/controls/CameraTransitionManager.js.Related
This resolves type definition gaps that required users to create extended type definitions in their projects (e.g., see usage in aec-craft/nb-generative).