Sign in

    crater-layout

    Layout kernel for crater CSS layout engine

    Download zip
    Author
    Version
    0.19.1
    License
    Apache-2.0
    Last updated
    3 days ago
    Downloads
    12K

    Dependencies

    mizchi/crater-layout does not have a README file

    CacheStats

    Statistics for cache performance

    DispatchFn

    Dispatch function type - passed through layout computation to enable cross-layout-type dispatch without global state. The function takes (node, context, dispatch) and returns Layout.

    IntrinsicState

    State of an intrinsic resource

    LayoutDispatchFunc

    @deprecated Use DispatchFn instead Layout dispatch function type (kept for backward compatibility with incremental compute)

    LayoutNode

    Mutable layout node with dirty tracking

    LayoutTree

    Layout tree with parent tracking for dirty propagation

    Node

    A node in the layout tree

    ResourceId

    Opaque resource identifier for external reference

    Style

    using @mizchi/css/style { type Style }

    CSS Style definition for layout computation All fields are mutable to support Yoga-like setter API

    clear_intrinsic_cache_for_node

    fn clear_intrinsic_cache_for_node(uid : Int) -> Unit

    Clear intrinsic cache for a specific node uid.

    compute_grid_layout

    fn compute_grid_layout(node :
    Node
    , available_width : Double, available_height : Double) ->
    Layout

    compute_layout

    Compute layout for a node tree with given viewport.

    compute_layout_in_context

    Compute layout with an explicit LayoutContext.

    compute_layout_with_warnings

    Compute layout with warning aggregation.

    layout_node_create

    fn layout_node_create(id : String) ->
    LayoutNode

    Create a LayoutNode with default style (builder pattern start)

    layout_tree

    fn layout_tree(root :
    LayoutNode
    , viewport_width : Double, viewport_height : Double) ->
    LayoutTree

    Create a new LayoutTree from a LayoutNode

    layout_tree_from_node

    fn layout_tree_from_node(root :
    Node
    , viewport_width : Double, viewport_height : Double) ->
    LayoutTree

    Create a LayoutTree from an immutable Node

    reset_intrinsic_cache

    fn reset_intrinsic_cache() -> Unit

    Reset all intrinsic size caches.

    setup

    fn setup() -> Unit

    Initialize the global layout dispatcher used by incremental layout.

    size

    fn size(width : Double, height : Double) ->
    Size
    [Double]

    Create a new Size for viewport dimensions

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io