Hosanna UI API v1.30.2-next
    Preparing search index...

    The ViewManager class is responsible for managing the state and layout of views. It keeps track of dirty views and views with invalidated layouts, and processes them during each tick.

    Implements

    Index

    Constructors

    Properties

    currentView: null | BaseView.BaseView<ViewState, ISGNGroup> = null

    The view currently being processed.

    dirtyViews: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    Array of views whose state is dirty and needs to be updated.

    layoutDirtyViewsById: Record<string, BaseView.BaseView<ViewState, ISGNGroup>> = {}

    Map of view IDs to views with invalidated layouts.

    layoutInvalidatedViews: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    Array of views whose layout is invalid and needs to be recalculated.

    pendingCleanup: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    Views detached during this tick; drained at end of _tick after state and layout.

    stateDirtyViewsById: Record<string, true> = {}

    View IDs enqueued for state application this batch (dedupes repeated invalidateViewState within a batch).

    viewsWithErrors: BaseView.BaseView<ViewState, ISGNGroup>[] = []

    Set of views that currently have errors.

    Methods

    • Processes all dirty views and views with invalidated layouts, applying state changes and laying out children as needed.

      Returns void

    • Forces the state of the specified view to be marked dirty, then invalidates it. Use when external state changes require getViews() to run even though the view's own state fields did not mutate.

      Parameters

      Returns void

    • Registers a control (view) with an error for debugging purposes.

      Parameters

      • errorObj: IDebugErrorObject

        The error object containing debug information.

      • view: null = null

        The view associated with the error. If not provided, uses the current view.

      Returns void

    • Registers a detached view for deferred cleanup at end of this tick.

      Parameters

      • view: IHosannaView<ViewState>

      Returns void

    • Unregisters a control (view) from error tracking.

      Parameters

      • view: any

        The view to unregister.

      Returns void