weasel API - v0.8.0
    Preparing search index...

    Interface LayoutStrategy<TPose>

    interface LayoutStrategy<TPose> {
        snap: LayoutSnap<TPose>;
        childPoses(
            container: LayoutContainer,
            children: readonly LayoutChild<TPose>[],
        ): Map<string, TPose>;
        commitDrop(
            container: LayoutContainer,
            children: readonly LayoutChild<TPose>[],
            dragged: LayoutDragged<TPose>,
            target: DropTarget<TPose> | null,
        ): Op[];
        contains?(containerPose: TPose, point: { x: number; y: number }): boolean;
        getDropTargets(
            container: LayoutContainer,
            children: readonly LayoutChild<TPose>[],
            dragged: LayoutDragged<TPose>,
        ): DropTarget<TPose>[];
        reflowPoses(
            container: LayoutContainer,
            children: readonly LayoutChild<TPose>[],
            dragged: LayoutDragged<TPose>,
            target: DropTarget<TPose> | null,
        ): Map<string, TPose>;
    }

    Type Parameters

    • TPose
    Index

    Properties

    Methods

    • Optional: predicate for whether a world-space point is inside this container. When absent, callers fall back to an axis-aligned bounding-box test on the container's pose. Strategies whose containers aren't rectangular (circles, irregular zones) implement this to override the AABB default.

      Parameters

      • containerPose: TPose
      • point: { x: number; y: number }

      Returns boolean