API reference
@searsuite/sear-render-strategy
Full, dirty-region, retained, and incremental rendering policies.
36 exportsderived from source
- classBlockRasterCopyPlansource ↗
-
class BlockRasterCopyPlanRaster-copy plan for layout shifts where unchanged blocks move within the viewport.
constructorconstructor BlockRasterCopyPlan(viewport: PositionRectProps, clearViewportRects: readonly PositionRect<templateLiteral>[], cacheToViewportCopies: readonly RasterCopyRect[], invalidWorldRects: readonly PositionRect<templateLiteral>[]): BlockRasterCopyPlanviewport: PositionRectPropsclearViewportRects: readonly PositionRect<templateLiteral>[]cacheToViewportCopies: readonly RasterCopyRect[]invalidWorldRects: readonly PositionRect<templateLiteral>[]
propertycacheToViewportCopies readonly cacheToViewportCopies: readonly RasterCopyRect[]propertyclearViewportRects readonly clearViewportRects: readonly PositionRect<templateLiteral>[]propertyinvalidWorldRects readonly invalidWorldRects: readonly PositionRect<templateLiteral>[]propertyviewport readonly viewport: PositionRectPropsmethodfromLayoutShiftstatic fromLayoutShift(input: BlockRasterCopyPlanInput): BlockRasterCopyPlan | nullinput: BlockRasterCopyPlanInput
- classDirtyRegionCollectorsource ↗
-
class DirtyRegionCollector<T>Collects frame-scoped dirty regions and builds dirty clip geometry.
The collector is intentionally independent from Sheet cells. It owns only rectangle collection, frame cleanup, stroke expansion and the concave union clip used when a dirty region must include both a changed area and the previously painted node bounds.
constructorconstructor DirtyRegionCollector<T>(source: DirtyRegionSource<T>): DirtyRegionCollector<T>Creates a collector around a frame-scoped dirty source.
source: DirtyRegionSource<T>Dirty source owned by the host renderer.
methodclear clear(): voidClears all dirty rectangles from the underlying source.
methodcollect collect(): PositionRect<T>[]Returns all dirty rectangles accumulated for the current frame.
The source is not cleared by this method; callers should clear only after the frame's redraw work has succeeded or has been intentionally skipped.
methodcreateClipRegionstatic createClipRegion<T>(dirtyRect: PositionRect<T>, nodeRect: PositionRect<T>, strokeWidth: number, useUnionClip: boolean): PositionRect<templateLiteral> | [number, number][]Builds the repaint clip for one dirty region and one intersecting node.
Most nodes can repaint within the expanded dirty rectangle. Selection-like nodes may need a concave clip covering the union of the dirty region and the node's previous bounds so erased borders do not leave seams.
ReturnsA rectangle or polygon accepted by scene node draw calls.
dirtyRect: PositionRect<T>Dirty rectangle in world coordinates.
nodeRect: PositionRect<T>Node bounds in world coordinates.
strokeWidth: numberStroke width used to expand both dirty and node bounds.
useUnionClip: booleanWhether to compute the concave union boundary.
methoddedupePointsstatic dedupePoints(points: [number, number][]): [number, number][]Removes duplicated points while preserving first occurrence order.
ReturnsDeduplicated polygon points.
points: [number, number][]Polygon points.
methodexpandstatic expand<T>(rect: PositionRect<T>, padding: number): PositionRect<templateLiteral>Expands a dirty rectangle by a symmetric stroke padding.
ReturnsExpanded rectangle suitable for clipping repaint work.
rect: PositionRect<T>Dirty rectangle in world coordinates.
padding: numberPixels added to every edge.
methodremoveCollinearstatic removeCollinear(points: [number, number][]): [number, number][]Drops middle vertices that lie on a straight line.
Degenerate polygons are preserved as-is so callers can fall back to a rectangle when the boundary cannot form a useful clip.
ReturnsCleaned polygon points.
points: [number, number][]Polygon points in boundary order.
methodtraceUnionBoundarystatic traceUnionBoundary(rectA: DirtyRegionBounds, rectB: DirtyRegionBounds): [number, number][]Traces the outer boundary of the union of two axis-aligned rectangles.
The returned path may be concave and is intended for clip construction, not for hit testing or layout geometry.
ReturnsBoundary points in drawing order.
rectA: DirtyRegionBoundsFirst rectangle bounds.
rectB: DirtyRegionBoundsSecond rectangle bounds.
- classDirtyRenderStrategysource ↗
-
class DirtyRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Incremental renderer that redraws only dirty regions.
It reads dirty rectangles from the registered dirty tracker, clears those regions on both on-screen and off-screen contexts, redraws intersected nodes, and finally resets the dirty tracker.
constructorconstructor DirtyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): DirtyRenderStrategy<NodeTypeProperties>Creates a RenderStrategy instance.
renderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving DirtyRenderStrategy.
methodgetContext getContext(): RenderContextReturns the screen render context used by this strategy.
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Dirty strategy does not currently expose coordinate lookup.
ThrowsError Always thrown until this API is implemented.
node: Node<NodeTypeProperties>x: numbery: number
methodrender render(node: Node<NodeTypeProperties>): voidRedraws all dirty regions for both render targets.
Each dirty rect is processed atomically: clearRect followed immediately by redraw of intersecting nodes. This guarantees that a later rect's clear can erase pixels re-painted by an earlier rect's redraw — critical for cases like cell-editor exit where the overflow area must stay clean despite the grid cell's TextNode redrawing overflow text into it.
node: Node<NodeTypeProperties>
Inherited members 9
Inherited from RenderStrategy.
- classEventRenderStrategysource ↗
-
class EventRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Render strategy dedicated to event-layer integration.
This strategy currently acts as a placeholder extension point. It shares the same contract as all render strategies so event visualization can be added later without changing orchestration code.
constructorconstructor EventRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): EventRenderStrategy<NodeTypeProperties>Creates a RenderStrategy instance.
renderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving EventRenderStrategy.
methodgetContext getContext(): RenderContextReturns the context used by this strategy.
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Event-layer hit lookup is not implemented yet.
ThrowsError Always thrown until this API is implemented.
node: Node<NodeTypeProperties>x: numbery: number
methodrender render(node: Node<NodeTypeProperties>): voidExecutes event-layer rendering.
Current implementation is intentionally a no-op.
node: Node<NodeTypeProperties>
Inherited members 9
Inherited from RenderStrategy.
- classHitRenderStrategysource ↗
-
class HitRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Strategy for hit-testing rendering and coordinate-to-node lookup.
The hit layer paints interactive nodes with unique colors on an off-screen canvas. Pointer coordinates are then resolved by reading back pixel colors and mapping them to scene nodes.
constructorconstructor HitRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker, platform: Platform): HitRenderStrategy<NodeTypeProperties>Creates a HitRenderStrategy instance.
renderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTrackerplatform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving HitRenderStrategy.
methoddebouncedRender debouncedRender(node: Node<NodeTypeProperties>): voidActually performs the hit-canvas rendering after debounce.
node: Node<NodeTypeProperties>Node to render
methoddestroy destroy(): voidCancels deferred hit-layer work when the owning editor is destroyed.
methodflushPendingScrollRender flushPendingScrollRender(): voidEnsures a pointer event never reads a hit layer from before the latest scroll-driven scene rebuild. The normal path remains frame-coalesced; this only runs when the user interacts before that frame is delivered.
methodgetContext getContext(): RenderContextGet the current rendering context.
ReturnsRenderContext
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Get all nodes at the given (x, y) coordinate by reading the hit-canvas pixel.
ReturnsArray of nodes at the given coordinate
node: Node<NodeTypeProperties>Root node to search from
x: numberX coordinate
y: numberY coordinate
methodrender render(node: Node<NodeTypeProperties>, delay?: number): voidDebounced render entry. Only the last call within the delay will trigger rendering.
node: Node<NodeTypeProperties>Node to render
delay: numberDebounce delay in ms
methodrenderImmediate renderImmediate(node: Node<NodeTypeProperties>): voidRender the hit canvas immediately, bypassing the debounce timer.
Used after viewport-culled plugins rebuild their scene nodes during scroll. Since new FixBoxNode instances get new random color keys, the hit canvas must be redrawn before the next click event. The normal debounced path would keep resetting the timer during continuous scrolling, leaving the hit canvas stale and clicks unresolvable.
node: Node<NodeTypeProperties>
methodrenderOnNextFrame renderOnNextFrame(node: Node<NodeTypeProperties>): voidSchedules a hit-layer refresh for the next frame. Wheel events can be delivered many times per frame; only the newest rebuilt scene matters.
node: Node<NodeTypeProperties>
Inherited members 9
Inherited from RenderStrategy.
- classIncrementalRenderPolicysource ↗
-
class IncrementalRenderPolicyDecides whether an incremental render candidate is worth using for the next frame.
constructorconstructor IncrementalRenderPolicy(): IncrementalRenderPolicypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving IncrementalRenderPolicy.
methodevaluate evaluate(candidate: IncrementalRenderCandidate, limits?: IncrementalRenderPolicyLimits): IncrementalRenderDecisioncandidate: IncrementalRenderCandidatelimits: IncrementalRenderPolicyLimits
- classOverlayRenderStrategysource ↗
-
class OverlayRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Render pass that paints editor overlays at the very end of the pipeline.
This pass guarantees edit-mode visuals stay above sticky headers and any other layers by drawing nodes with
isEditafter StickyRenderStrategy.constructorconstructor OverlayRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): OverlayRenderStrategy<NodeTypeProperties>Creates a RenderStrategy instance.
renderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving OverlayRenderStrategy.
methodgetContext getContext(): RenderContextReturns the context.
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Returns the node by coordinates.
node: Node<NodeTypeProperties>x: numbery: number
methodrender render(node: Node<NodeTypeProperties>): voidRenders OverlayRenderStrategy scene output.
node: Node<NodeTypeProperties>
Inherited members 9
Inherited from RenderStrategy.
- classRasterCopyExecutorsource ↗
-
class RasterCopyExecutorExecutes raster copies between render contexts with transform isolation.
The executor owns the identity-transform save/restore wrapper used by Canvas viewport copy paths. Retained targets can avoid this executor entirely by selecting a full-frame rebuild through context capabilities.
constructorconstructor RasterCopyExecutor(): RasterCopyExecutorpropertysymbolstatic readonly symbol: typeof symbolDI token for resolving RasterCopyExecutor.
methodcopy copy(source: RenderContext, destination: RenderContext, copy: RasterCopyRect): voidCopies a rectangular pixel region from one render target into another.
source: RenderContextSource render context.
destination: RenderContextDestination render context.
copy: RasterCopyRectSource and destination rectangles in viewport coordinates.
methodcopyNatural copyNatural(source: RenderContext, destination: RenderContext, x?: number, y?: number): voidCopies the source target at its natural size to a viewport-space origin.
This keeps initial off-screen cache priming compatible with existing Canvas behavior where the complete visible backing store is cloned after first paint.
source: RenderContextSource render context.
destination: RenderContextDestination render context.
x: numberDestination x-coordinate.
y: numberDestination y-coordinate.
- classRasterCopyPlansource ↗
-
class RasterCopyPlanImmutable plan for reusing viewport pixels across render targets.
A plan describes the off-screen-to-visible copy for a scroll frame, the newly exposed viewport rectangle that still needs node redraw, and the final visible-to-off-screen copy that refreshes the cache after redraw.
constructorconstructor RasterCopyPlan(viewport: PositionRect<templateLiteral>, cacheToViewportCopy: RasterCopyRect, blankViewportRect: PositionRect<templateLiteral>, blankWorldRect: PositionRect<templateLiteral>, viewportToCacheCopy: RasterCopyRect): RasterCopyPlanCreates a raster copy plan.
viewport: PositionRect<templateLiteral>Viewport rectangle in viewport coordinates.
cacheToViewportCopy: RasterCopyRectCopy from the cached frame into the visible target.
blankViewportRect: PositionRect<templateLiteral>Newly exposed viewport-space area to redraw.
blankWorldRect: PositionRect<templateLiteral>Newly exposed world-space area to query from the scene.
viewportToCacheCopy: RasterCopyRectCopy from the visible target back into the cache.
propertyblankViewportRect readonly blankViewportRect: PositionRect<templateLiteral>Newly exposed viewport-space area to redraw.
propertyblankWorldRect readonly blankWorldRect: PositionRect<templateLiteral>Newly exposed world-space area to query from the scene.
propertycacheToViewportCopy readonly cacheToViewportCopy: RasterCopyRectCopy from the cached frame into the visible target.
propertyviewport readonly viewport: PositionRect<templateLiteral>Viewport rectangle in viewport coordinates.
propertyviewportToCacheCopy readonly viewportToCacheCopy: RasterCopyRectCopy from the visible target back into the cache.
methodcreateViewportToCacheCopystatic createViewportToCacheCopy(viewport: PositionRectProps): RasterCopyRectCreates a full-viewport copy from the visible target into the frame cache.
ReturnsCopy rectangle with identical source and destination bounds.
viewport: PositionRectPropsViewport-space bounds to copy.
methodfromScrollstatic fromScroll(viewport: PositionRect<templateLiteral>, scrollState: ScrollManagerState): RasterCopyPlanBuilds the scroll-copy plan used by Canvas viewport renderers.
The delta convention follows
RenderStrategy:deltais previous minus current, whiledrawImagesource offsets use current minus previous.ReturnsPlan for copy, exposed-area redraw, and cache refresh.
viewport: PositionRect<templateLiteral>Visible viewport rectangle in viewport coordinates.
scrollState: ScrollManagerStateCurrent scroll snapshot.
- classRenderStrategysource ↗
-
class RenderStrategy<T>Base abstraction for all render strategies.
A render strategy encapsulates one rendering concern (screen layer, hit layer, sticky overlays, dirty-region redraw, etc.) and shares a common life-cycle:
- Receive scroll updates from ScrollManager.
- Derive absolute scroll position and frame delta.
- Trigger strategy-specific rendering.
- Persist previous scroll state for the next frame comparison.
Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.
constructorconstructor RenderStrategy<T>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<T>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): RenderStrategy<T>Creates a RenderStrategy instance.
renderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<T>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertydirtyTree readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContext readonly hitRenderContext: RenderContextpropertyoffScreenRenderContext readonly offScreenRenderContext: RenderContextpropertyrenderContext readonly renderContext: RenderContextpropertyrenderCoordinatorManager readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManager readonly scrollManager: ScrollManagerpropertystage readonly stage: SceneGraph<T>propertytree readonly tree: Tree<PositionRect<templateLiteral>>methodgetContext getContext(): RenderContextReturns the render context owned by this strategy.
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<T>, x: number, y: number): Node<T>[]Resolves nodes around the provided coordinates for this strategy layer.
node: Node<T>x: numbery: number
methodgetViewScaleContexts getViewScaleContexts(): readonly RenderContext[]Render contexts whose view scale is owned by this strategy.
Strategies that introduce an additional layer can override this method and include its context. RenderStrategyManager de-duplicates shared contexts before applying a scale change.
methodrender render(node: Node<T>): voidRenders the target node tree according to the strategy semantics.
node: Node<T>
- classRenderStrategyManagersource ↗
-
class RenderStrategyManager<NodeTypeProperties>Registry and lookup manager for render strategies.
The render engine uses this manager to compose a strategy pipeline by name. Names can be string keys or symbols to avoid collisions in plugin scenarios.
constructorconstructor RenderStrategyManager<NodeTypeProperties>(): RenderStrategyManager<NodeTypeProperties>propertysymbolstatic readonly symbol: symbolDI token for resolving RenderStrategyManager.
methodaddStrategy addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidRegisters or replaces a strategy under the provided key.
name: string | Symbolstrategy: RenderStrategy<NodeTypeProperties>
methodaddStrategyAfter addStrategyAfter(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately after an existing strategy.
reference: string | Symbolname: string | Symbolstrategy: RenderStrategy<NodeTypeProperties>
methodaddStrategyBefore addStrategyBefore(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately before an existing strategy.
reference: string | Symbolname: string | Symbolstrategy: RenderStrategy<NodeTypeProperties>
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean): voidCloses direct strategy and view-scale changes after Sheet startup.
isExecuting: (): boolean
methodgetAllStrategy getAllStrategy(): RenderStrategy<NodeTypeProperties>[]Returns all currently registered strategies in insertion order.
methodgetStrategy getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefinedRetrieves a strategy by key.
name: string | Symbol
methodsetViewScale setViewScale(scale: number): voidPropagates view scale to every context contributed by registered strategies. Shared base/off-screen/hit contexts are updated once.
scale: number
- classScreenRenderStrategysource ↗
-
class ScreenRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Base abstraction for all render strategies.
A render strategy encapsulates one rendering concern (screen layer, hit layer, sticky overlays, dirty-region redraw, etc.) and shares a common life-cycle:
- Receive scroll updates from ScrollManager.
- Derive absolute scroll position and frame delta.
- Trigger strategy-specific rendering.
- Persist previous scroll state for the next frame comparison.
Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.
constructorconstructor ScreenRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker, rasterCopyExecutor: RasterCopyExecutor): ScreenRenderStrategy<NodeTypeProperties>Creates a screen render strategy with injected render targets and copy executor.
renderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTrackerrasterCopyExecutor: RasterCopyExecutor
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving ScreenRenderStrategy.
methodconfigureRuntime configureRuntime(runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>): voidConfigures host-specific viewport, query, and drawing semantics.
runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>
methodgetContext getContext(): RenderContextReturns the current render context.
The returned context targets the on-screen canvas.
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Not implemented: Finds nodes at the given coordinates.
ThrowsError
node: Node<NodeTypeProperties>x: numbery: number
methodrender render(node: Node<NodeTypeProperties>): voidRenders the scene graph node using an off-screen buffer for efficient scrolling.
node: Node<NodeTypeProperties>The root node to render.
Inherited members 9
Inherited from RenderStrategy.
- classStickyRenderStrategysource ↗
-
class StickyRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>StickyRenderStrategy is responsible for rendering all StickyNode instances. It should be used after the main render strategy to overlay sticky elements.
constructorconstructor StickyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): StickyRenderStrategy<NodeTypeProperties>Creates a RenderStrategy instance.
renderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving StickyRenderStrategy.
methodgetContext getContext(): RenderContextReturns the current render context.
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Not implemented: Finds nodes at the given coordinates.
ThrowsError
node: Node<NodeTypeProperties>x: numbery: number
methodrender render(node: Node<NodeTypeProperties>): voidRenders all StickyNode descendants of the given node. Sticky nodes are positioned according to their sticky logic (top/left).
node: Node<NodeTypeProperties>The root node to search for StickyNode descendants.
Inherited members 9
Inherited from RenderStrategy.
- classViewportFrameCachesource ↗
-
class ViewportFrameCacheManages the off-screen viewport frame used by Canvas scroll optimization.
The cache wraps
RenderContext.isDrawnso consumers do not need to reach into the render target directly. It provides explicit operations for clearing, priming after first paint, and refreshing after an incremental scroll redraw.constructorconstructor ViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCacheCreates a viewport frame cache facade.
cacheContext: RenderContextOff-screen render target that stores the last complete base frame.
copyExecutor: RasterCopyExecutorRaster copy executor used for cache synchronization.
methodclear clear(viewport: PositionRectProps): voidClears the cached viewport with an identity transform.
viewport: PositionRectPropsViewport-space rectangle to erase from the cache.
methodinvalidate invalidate(): voidMarks the cached frame invalid so the next render performs a full prime.
methodisReady isReady(): booleanReturns whether the cache already contains a complete base frame.
methodmarkReady markReady(): voidMarks the cached frame ready after a complete frame has been copied in.
methodprimeFromVisibleFrame primeFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): voidPrimes the cache from the visible frame after a first full paint.
visibleContext: RenderContextVisible render target containing a complete base frame.
viewport: PositionRectPropsViewport-space rectangle to clear before copying.
methodrefreshFromVisibleFrame refreshFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): voidRefreshes the cache from the visible target after incremental redraw.
visibleContext: RenderContextVisible render target containing the latest base frame.
viewport: PositionRectPropsViewport-space rectangle to copy into the cache.
- interfaceBlockRasterCopyCandidatesource ↗
-
interface BlockRasterCopyCandidatepropertydestination readonly destination: PositionRectPropspropertysource readonly source: PositionRectProps - interfaceBlockRasterCopyPlanInputsource ↗
-
interface BlockRasterCopyPlanInputpropertyclearWorldRects readonly clearWorldRects: readonly PositionRectProps[]propertycopies readonly copies: readonly BlockRasterCopyCandidate[]propertyinvalidWorldRects readonly invalidWorldRects: readonly PositionRectProps[]propertyscrollState readonly scrollState: Pick<ScrollManagerState, "x" | "y">propertyviewport readonly viewport: PositionRectProps - interfaceDirtyRegionBoundssource ↗
-
interface DirtyRegionBoundsBoundary represented by four world-space edges.
- interfaceDirtyRegionSourcesource ↗
-
interface DirtyRegionSource<T>Minimal dirty-region storage contract consumed by DirtyRegionCollector.
Sheet uses
GenerationalDirtyTracker; future document renderers can provide a block/page dirty source with the same boundary, query and frame-clear contract without depending on Sheet scene internals.methodclear clear(): voidClears dirty state after the owning frame has consumed it.
methodgetBoundary getBoundary(): PositionRect<T>Returns the total query boundary that contains all possible dirty entries.
methodquery query(range: PositionRect<T>): PositionRect<T>[]Returns dirty rectangles intersecting the provided query range.
range: PositionRect<T>
- interfaceIncrementalRenderCandidatesource ↗
-
interface IncrementalRenderCandidateMeasured cost shape for one proposed incremental render frame.
propertycopiedArea readonly copiedArea: numberTotal destination pixel area copied from the retained/off-screen frame cache.
propertycopyCount readonly copyCount: numberNumber of raster copy rectangles in the candidate plan.
propertyinvalidArea readonly invalidArea: numberTotal world pixel area that still needs redraw after raster reuse.
propertyinvalidRectCount readonly invalidRectCount: numberNumber of invalid redraw rectangles in the candidate plan.
propertyviewport readonly viewport: Pick<PositionRectProps, "width" | "height">Viewport dimensions used as the baseline for area ratios.
- interfaceIncrementalRenderDecisionsource ↗
-
interface IncrementalRenderDecision - interfaceIncrementalRenderPolicyLimitssource ↗
-
interface IncrementalRenderPolicyLimitsGuardrails used to decide whether an incremental render plan is cheaper and safe enough to use.
propertymaxCopiedAreaRatio readonly maxCopiedAreaRatio: numberMaximum total copied pixel area divided by viewport area. Values above 1 allow overlapping or repeated copies.
propertymaxCopyCount readonly maxCopyCount: numberMaximum number of raster copy rectangles allowed in one frame.
propertymaxInvalidAreaRatio readonly maxInvalidAreaRatio: numberMaximum invalid redraw area divided by viewport area after raster copies have been applied.
propertymaxInvalidRectCount readonly maxInvalidRectCount: numberMaximum number of invalid redraw rectangles allowed in one frame.
- interfaceRasterCopyRectsource ↗
-
interface RasterCopyRectSource and destination rectangles for one raster copy.
propertydestination readonly destination: PositionRectPropsDestination pixels inside the destination render target, expressed in viewport coordinates.
propertysource readonly source: PositionRectPropsSource pixels inside the source render target, expressed in viewport coordinates.
- interfaceRenderContextCapabilitiessource ↗
-
interface RenderContextCapabilitiesCapability snapshot used by viewport render coordinators before choosing a raster strategy.
propertyrequiresExplicitNodeClear readonly requiresExplicitNodeClear: booleanpropertyrequiresFrameRebuild readonly requiresFrameRebuild: booleanpropertysupportsDirtyRedraw readonly supportsDirtyRedraw: boolean - interfaceScreenRenderStrategyRuntimesource ↗
-
interface ScreenRenderStrategyRuntime<NodeTypeProperties>propertyconsumeBlockRasterCopyPlan readonly consumeBlockRasterCopyPlan?: (): BlockRasterCopyPlan | nullConsumes a pending block-copy plan for layout-shift frames, if the host has one.
propertydrawNodes readonly drawNodes?: (input: { context: RenderContext; nodes: readonly Node<NodeTypeProperties>[]; scrollState: ScrollManagerState; worldRect: PositionRect<templateLiteral> }): voidDraws already queried nodes into the visible render context.
propertyforceFullRepaint readonly forceFullRepaint?: (): booleanForces a full visible body repaint even when the off-screen cache is ready.
propertygetScrollState readonly getScrollState?: (): ScrollManagerStateReturns the scroll state used for world queries and raster copy deltas.
propertygetViewport readonly getViewport?: (): PositionRect<templateLiteral>Returns the viewport-space rectangle covered by this screen layer.
propertyisScrollStateChanged readonly isScrollStateChanged?: (scrollState: ScrollManagerState): booleanReturns whether the current scroll state requires a scroll-copy frame.
propertyonFrameRendered readonly onFrameRendered?: (mode: ScreenRenderFrameMode): voidCalled after a full, scroll, or rebuilt frame is rendered.
propertyqueryNodes readonly queryNodes?: (root: Node<NodeTypeProperties>, worldRect: PositionRect<templateLiteral>): readonly Node<NodeTypeProperties>[]Returns screen-body nodes to draw for the supplied world-space rectangle.
propertyrequiresFrameRebuild readonly requiresFrameRebuild?: (): booleanReturns whether this frame should rebuild a retained render target.
propertytoWorldRect readonly toWorldRect?: (viewportRect: PositionRect<templateLiteral>, scrollState: ScrollManagerState): PositionRect<templateLiteral>Maps a viewport-space repaint rectangle to a world-space query rectangle.
- typeIncrementalRenderDecisionReasonsource ↗
-
type IncrementalRenderDecisionReason = typeof IncrementalRenderDecisionReason[keyof typeof IncrementalRenderDecisionReason] - typeScreenRenderFrameModesource ↗
-
type ScreenRenderFrameMode = "rebuild" | "full" | "scroll" | "block-copy"ScreenRenderStrategy handles rendering with an off-screen buffer to optimize scroll performance. It minimizes redraws by copying unchanged regions and only re-rendering areas affected by scrolling.
Rendering modes:
- First frame: full draw to screen, then clone into off-screen buffer.
- Scroll frame: blit preserved region from off-screen, redraw only newly exposed strip, then sync back to off-screen.
- variableDEFAULT_INCREMENTAL_RENDER_POLICY_LIMITSsource ↗
-
DEFAULT_INCREMENTAL_RENDER_POLICY_LIMITS: IncrementalRenderPolicyLimits - variableIncrementalRenderDecisionReasonsource ↗
-
IncrementalRenderDecisionReason: { Accepted: "accepted"; EmptyViewport: "empty-viewport"; ExcessiveCopiedArea: "excessive-copied-area"; ExcessiveCopyCount: "excessive-copy-count"; ExcessiveInvalidArea: "excessive-invalid-area"; ExcessiveInvalidRectCount: "excessive-invalid-rect-count"; NotCandidate: "not-candidate" } - functionclearViewportsource ↗
-
clearViewport(context: RenderContext, viewport: PositionRectProps): voidcontext: RenderContextviewport: PositionRectProps
- functionclearViewportRectsource ↗
-
clearViewportRect(context: RenderContext, rect: PositionRectProps): voidcontext: RenderContextrect: PositionRectProps
- functioncreateViewportFrameCachesource ↗
-
createViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCachecacheContext: RenderContextcopyExecutor: RasterCopyExecutor
- functionreadRenderContextCapabilitiessource ↗
-
readRenderContextCapabilities(context: RenderContext): RenderContextCapabilitiescontext: RenderContext
- functionrequiresViewportExplicitNodeClearsource ↗
-
requiresViewportExplicitNodeClear(context: RenderContext): booleancontext: RenderContext
- functionrequiresViewportFrameRebuildsource ↗
-
requiresViewportFrameRebuild(context: RenderContext): booleancontext: RenderContext
- functionsupportsViewportDirtyRedrawsource ↗
-
supportsViewportDirtyRedraw(context: RenderContext): booleancontext: RenderContext
- functionworldRectToViewportClearRectsource ↗
-
worldRectToViewportClearRect<T>(rect: PositionRect<T>, scrollX: number, scrollY: number, padding: number): PositionRect<templateLiteral>rect: PositionRect<T>scrollX: numberscrollY: numberpadding: number
No public exports match that search.