API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classObservableSize
@codexo/exojs / math / stable
A Size subclass that fires a callback whenever `width` or `height` changes. Used internally by layout-aware types to invalidate cached geometry on dimension mutations. Batch mutations via `set()` fire at most one callback per call.
4
props
9
methods
0
events
Import
import { ObservableSize } from '@codexo/exojs'A Size subclass that fires a callback whenever `width` or `height` changes. Used internally by layout-aware types to invalidate cached geometry on dimension mutations.
Batch mutations via `set()` fire at most one callback per call.
Constructors1
new(callback: () => void, width: number, height: number): ObservableSizeMethods9
add(x: number, y: number): thisA plain, callback-free Size. A clone is a value, not a second observer of this size's owner: mutating the copy must not invalidate geometry that belongs to something else. The return type says so, so a caller cannot mistake the copy for a live one.
destroy(): voiddivide(x: number, y: number): thisequals(__namedParameters: Partial<SizeMutable 2D size (width × height) value type. All arithmetic methods mutate in place and return `this` for chaining. When `height` is omitted from `set`, `add`,…>): booleanscale(x: number, y: number): thisset(width: number, height: number): thissubtract(x: number, y: number): thisProperties4
height: numberwidth: numberSource