ViewChannel

One environment type's view: what the surface drew, what the reader explored to, and the glide between.

@internote/canvas-sdkInterface
On this page
import { ViewChannel } from '@internote/canvas-sdk';

The surface calls record on every render; a toolbar handler calls glide or reset; the surface reads current for the window to draw and hasExplored for whether a reset button is live.

#Fields

canZoomRequired
Returns whether a zoom step that way would move the view — false at the environment's limit, or before anything was drawn.
boolean
currentRequired
Returns the reader's window if they have one, else the one last drawn, or null before anything was drawn.
V | null
glideRequired
Eases from wherever the view is now to a target, over the channel's glide time.
void
hasExploredRequired
Returns whether the reader has moved the view off the authored one.
boolean
recordRequired
Records the window this render drew. With explored false it is also recorded as the authored frame, the target reset glides back to.
void
resetRequired
Glides back to the authored or automatic frame and releases the view, so a later keyframe still moves it.
void
zoomByRequired
Glides one zoom step in or out from the current view, and does nothing at the environment's limit.
void
zoomsRequired
Whether the environment steps its zoom from the toolbar — whether it supplied zoom.
boolean

Declared in packages/canvas-sdk/src/view/index.ts:106.

Last updated