Skip to content

Latest commit

 

History

History
107 lines (68 loc) · 3.53 KB

API.md

File metadata and controls

107 lines (68 loc) · 3.53 KB

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

ClientPixelUnit

ClientPixelUnit: number

This is just a type alias for number. Variables or parameters of this type refer to client (as in the browser window)'s concept of pixels (which are not the same as screen pixels).


DecidePressHandlingCallback

DecidePressHandlingCallback: function

This type of callback is given to the PressInterpreter and takes one of the underlying events that starts a "press" as far as the library is concerned (either a left click mouse down event, or a single finger touch start event), and returns an PressHandlingOptions object (or undefined) detailing how the PressInterpreter should handle the press.

Type declaration:

(e: MouseEvent | TouchEvent, coordinates: PressEventCoordinates): PressHandlingOptions | undefined

Parameters:

Name Type
e MouseEvent | TouchEvent
coordinates PressEventCoordinates

VirtualSpacePixelUnit

VirtualSpacePixelUnit: number

This is a type alias representing the pixels inside the virtual space created by the library.


ZoomFactor

ZoomFactor: number

A type alias for number. A zoom factor is the amount the virtual space is being zoomed in. 2 represents 200% zoom (in), while 0.5 represents 50% zoom (so zoomed out).

Variables

Const SpaceContext

SpaceContext: React.Context‹SpaceContextType

This React context can be used within a Space to get access to the ViewPort.

Functions

suppressBrowserZooming

suppressBrowserZooming(): () => void

This is not used by the ViewPort, but if you have HTML elements around the ViewPort you may want to suppress zooming or panning on the whole page. This function will do that.

Returns: () => void

A callback which will stop the suppression.