@witchcraft/layout
    Preparing search index...
    • Returns the information necessary to close a frame or frames (if force: true).

      Can close by direction or by frame edge.

      • Closing A in the left direction or by it's right edge would close A and expand B.

      • Closing A in the right direction or by it's left edge is not possible, since it's left edge is a window edge.

      ┌──┬──┐
      AB
      └──┴──┘

      A list of possible directions/edges can be given to attempt closing by those directions/edges in that order.

      Frame closing does not always succeed:

      If two frames share a visual edge exactly, they can always be closed to either side.

       🭮  🭬
      ┌──┬──┐
      AB
      └──┴──┘

      If the visual edge contains multiple frames, force: true must be specified to be able to close them. Force is not guaranteed to succeed either though.

      There's two main scenarios to consider when we have multiple frames:

      • The frames all share an edge on the closing side. We can force close both without problems.

      So, for example, here A & B can be force closed to the left since they share their left edge (vertically).

         ─🭬
      ┌──┬──┐
      AC
      ├──┤ │
      B │ │
      └──┴──┘
      • If they do not share an edge to that side, we will attempt to close the frame IF it's the smallest frame and only modify the size of the others.

      For this to succeed, the difference between the smallest frame and the next smallest frame must be greater than the minimum size.

      For example, here, we have frames A, B, and C to the left of the visual edge. A and B are the smallest. A can be closed and the rest modified, but only if the difference between A and B is greater than the minimum size.

              🭮──
      ┌──────┬──┬──┐
      EAF
      ├───┬──┴──┤ │
      FB │ │
      ├───┴─────┤ │
      C │ │
      └─────────┴──┘

      Type Parameters

      • T extends "edge" | "dir"

      Parameters

      • frames: LayoutFrame[]
      • visualEdges: { endX: number; endY: number; startX: number; startY: number }[]
      • frame: LayoutFrame
      • closeDirOrSide: T extends "dir"
            ? "up"
            | "down"
            | "left"
            | "right"
            : "left" | "right" | "top" | "bottom"

        The direction or edge (if closeBy = "edge") to search for possible closes.

        For example, a frame that touches the right window edge can only be closed "to the right" in the horizontal direction or by it's left edge. Another way to think about it is the left edge is "collapsed" towards the "right".

      • closeBy: T = ...
      • force: boolean = false
      • minSize: { height: number; width: number } = ...

      Returns
          | { deletedFrames: LayoutFrame[]; modifiedFrames: LayoutFrame[] }
          | KnownError<
              | "CANT_CLOSE_NO_DRAG_EDGE"
              | "CANT_CLOSE_NEARBY_FRAMES_TOO_SMALL"
              | "CANT_CLOSE_SINGLE_FRAME"
              | "CANT_CLOSE_WITHOUT_FORCE",
              | { frame: LayoutFrame }
              | {
                  frame: LayoutFrame;
                  minSize: { height: number; width: number };
                  nearbyFrames: LayoutFrame[];
              }
              | { frame: LayoutFrame }
              | { frame: LayoutFrame; framesRequiredToBeDeleted: LayoutFrame[] },
          >