EnvironmentAnimation
An environment's animation handlers: the engine calls in on step changes and vocabulary cues, and the environment never owns a timeline.
@internote/canvas-sdkOn this page
import { EnvironmentAnimation } from '@internote/canvas-sdk';The scene's clock belongs to the host. Presence, keyframe tracks and anchors are all resolved by the engine, and an environment reacts to them through these hooks and through ctx.animation.
#Fields
nodeAnimationMsanchorAttr (in, out or at), in milliseconds, or null to leave the generic rule standing.(node: CompiledNode, anchorAttr: string) => number | nullThe host measures the shared cue family off its attributes: a fade is its in-duration:, a verb's move is its duration:. A vocabulary element whose window is derived from its own content, such as text typed at a number of characters a second, has no attribute to read, and answers here instead. Called before any environment has mounted, like timeAnimationMs.
onStep(index: number, ctx: EnvironmentContext) => voidtimeAnimationMs(node: CompiledNode) => numberThe scene's clock is what the playback control drives, and its length is otherwise measured only from time-anchored cues. An environment whose content moves through time for its own reasons declares the length here, so the reader gets the same play control rather than a second one beside it. Called with the compiled node before any environment has mounted, so there is no session and no runtime to read.
verbsRecord<string, VerbHandler<EnvironmentContext>>Declared in packages/canvas-sdk/src/environment/types.ts:154.