Pilates
    Preparing search index...
    Index

    Constructors

    Properties

    _floatLeft: number = 0

    Pre-rounding (float) left/top position of this node within its parent, as computed by the flex algorithm BEFORE roundLayout converts positions to integers.

    Written by the position-write helpers in algorithm/main-axis.ts at the same time as _layout.left/top. After roundLayout runs, _layout.left/top become integers but _floatLeft/Top retain the float values. These are captured by snapshotForCache and restored by restoreFromCache so that roundLayoutSubtree can compute the correct absolute float coordinate for a re-laid-out boundary node's children.

    Initialized to 0 (same as _layout.left/top).

    _floatTop: number = 0
    _hasDirtyDescendant: boolean = false

    True if any descendant has been marked dirty (even if dirty propagation was stopped by a relayout boundary before reaching this node). Used by the root cache-hit path to skip layoutChildren for subtrees that have no mutations at all — not just subtrees where this node itself is clean.

    Invariant: _dirtyFlags !== 0 implies _hasDirtyDescendant on the parent (if any). Cleared by clearDirty() after each calculateLayout().

    _id: number = ...

    Unique integer ID for typed-array indexing in the LayoutPool. Assigned at construction; recycled via FinalizationRegistry when this Node is garbage-collected.

    _layout: ComputedLayout = ...

    Backing storage for layout. Written by the algorithm in this package (see algorithm/); read externally via the public layout getter or the safer getComputedLayout() snapshot.

    _layoutCache?: LayoutCache

    Lazy-allocated layout-cache. Created the first time layoutChildren (or calculateLayout at the root) stores a result. Cleared by markDirty(). Read by layoutChildren and the root calculateLayout path in algorithm/.

    _measureCache?: MeasureCache

    Lazy-allocated measure-func result cache. Created the first time setMeasureFunc() installs a measurer. Cleared by markDirty() (which fires on every style/tree mutation) and by re-installing the measure function. Read by callMeasureFunc() in algorithm/main-axis.ts.

    _style: Style = ...
    scrollLeft: number = 0

    Horizontal scroll offset. Mutable; defaults to 0. Read by the renderer when painting children of an overflow !== 'visible' node — children's paint origin is translated by (-scrollLeft, -scrollTop). NOT clamped by this class — bounds clamping is the consumer's job (<ScrollView> clamps before writing). Direct mutation does not mark the node dirty because scroll offset is a paint-time concern, not layout.

    scrollTop: number = 0

    Accessors

    • get layout(): Readonly<ComputedLayout>

      Read-only view of this node's most recently computed layout. Use getComputedLayout() for a stable copy if you need to retain it past the next calculateLayout() call.

      Returns Readonly<ComputedLayout>

    • get scrollHeight(): number

      Read-only view of _layout.scrollHeight.

      Returns number

    • get scrollWidth(): number

      Read-only view of _layout.scrollWidth. See scrollLeft.

      Returns number

    • get style(): Readonly<Style>

      Read-only view of this node's style. Mutating the returned object is blocked at the type level — call setX() methods to change style so markDirty() runs.

      Returns Readonly<Style>

    Methods

    • Internal

      Set dirty + clear caches + propagate up unconditionally, bypassing the layout-boundary short-circuit in markDirty(). Used only by markDirtyDeep in algorithm/cache.ts for differential-mode and fuzzer validation that need to force the full tree onto the cold path regardless of boundary semantics.

      Returns void

    • Compute layout for this node and its descendants.

      If availableWidth / availableHeight are omitted the node's own width / height style is used. If those are also 'auto' the algorithm treats the missing axis as 0.

      Implementation lives in ./algorithm/. This method delegates so that Node remains a focused state holder.

      Parameters

      • OptionalavailableWidth: number
      • OptionalavailableHeight: number

      Returns void

    • Internal

      Called by the algorithm once layout is fresh. Not part of the public API — consumers should treat layout cleanliness as derived state and never reach in to clear the flag themselves.

      Returns void

    • Parameters

      • index: number

      Returns Node | undefined

    • Returns number

    • Snapshot of children — mutating the returned array does not affect the tree.

      Returns Node[]

    • Returns the most recently computed layout box for this node, in cells, relative to the parent's top-left corner.

      Before calculateLayout() has run, all values are 0.

      Returns ComputedLayout

    • Parameters

      • child: Node
      • index: number

      Returns void

    • Returns boolean

    • Internal

      Set specific dirty flag(s) on this node. Propagates upward through ancestors. Used by individual setters to indicate the granular nature of the change; cache layers consume the flag to decide whether to invalidate.

      Parameters

      • flag: number

      Returns void

    • Pass undefined to clear the constraint. Must be a positive finite number when set. See style.ts for the full derivation rules.

      Parameters

      • value: number | undefined

      Returns void

    • CSS flex shorthand: grow=value, shrink=1, basis=0 (when value > 0).

      Note that the implied shrink: 1 follows CSS, not Yoga: Yoga's default flexShrink is 0, and setFlex(N) in Yoga also leaves shrink at 0. Pilates intentionally tracks CSS here so consumers who think in CSS terms get the result they expect; consumers porting from Ink (which wraps Yoga) should call setFlexShrink(0) after setFlex if they need the Yoga behaviour.

      Parameters

      • value: number

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • axis: "row" | "column"
      • value: number

      Returns void

    • Parameters

      • edge: Edge
      • value: number

      Returns void

    • Pass undefined to remove an upper bound.

      Parameters

      • value: number | undefined

      Returns void

    • Pass undefined to remove an upper bound.

      Parameters

      • value: number | undefined

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • edge: Edge
      • value: number

      Returns void

    • Pass undefined to leave that edge unconstrained.

      Parameters

      • edge: Edge
      • value: number | undefined

      Returns void

    • Construct via Node.create() to mirror Yoga's factory style.

      Returns Node