API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classCanvasSizing
Strategy that decides how a canvas is sized and, where it lives in a document, how it follows its surroundings. An instance owns its own lifecycle: it is handed a CanvasSizingContext in CanvasSizing.attach and keeps whatever it needs - a `ResizeObserver`, window listeners, a host message channel - until CanvasSizing.detach releases them again. Nothing is created on its behalf, so a policy that observes nothing costs nothing. Passing no policy at all is the fixed case: the canvas is sized once to the base resolution and never tracks anything, which is why there is no built-in class for it. An instance belongs to one application at a time. `attach` is called when the application takes it, `detach` when it is replaced or the application is destroyed, and a policy must not commit through a context after its `detach`.
import { CanvasSizing } from '@codexo/exojs'Strategy that decides how a canvas is sized and, where it lives in a document, how it follows its surroundings.
An instance owns its own lifecycle: it is handed a CanvasSizingContext in CanvasSizing.attach and keeps whatever it needs - a `ResizeObserver`, window listeners, a host message channel - until CanvasSizing.detach releases them again. Nothing is created on its behalf, so a policy that observes nothing costs nothing.
Passing no policy at all is the fixed case: the canvas is sized once to the base resolution and never tracks anything, which is why there is no built-in class for it.
An instance belongs to one application at a time. `attach` is called when the application takes it, `detach` when it is replaced or the application is destroyed, and a policy must not commit through a context after its `detach`.
new(): CanvasSizingdetach(): void