Skip to content

@ue-too/board / index / ZoomToHandlerFunction

Type Alias: ZoomToHandlerFunction() ​

ZoomToHandlerFunction = (destination, camera, config) => number

Defined in: packages/board/src/camera/camera-rig/zoom-handler.ts:118

Handler function type for absolute "zoom to" camera operations.

Parameters ​

destination ​

number

Target zoom level

camera ​

BoardCamera

Current camera instance

config ​

ZoomHandlerConfig

Zoom behavior configuration

Returns ​

number

Transformed zoom level (after applying restrictions and clamping)

Remarks ​

Zoom-to handlers process absolute zoom level requests. They form a pipeline that can apply restrictions, clamping, and other transformations.

Handler pipeline pattern:

  • Each handler receives the target zoom, camera state, and config
  • Returns a potentially modified zoom level
  • Handlers can be chained using createHandlerChain

Common transformations:

  • Boundary clamping (enforce min/max zoom limits)
  • Zoom locking (prevent any zoom changes)
  • Custom zoom constraints or snapping

Example ​

typescript
const myZoomToHandler: ZoomToHandlerFunction = (target, camera, config) => {
  // Custom logic: snap to integer zoom levels
  return Math.round(target);
};

See ​