@witchcraft/layout
    Preparing search index...
    • Returns a LayoutChange with the information necessary to redistribute frames to expand/shrink a certain amount towards the given side.

      Changes can be applied to a window with applyFrameChanges.

      While it checks for bounds/space issues (unless allowOutOfBounds is true), it does not check that all the frames correctly share/fill the start/end edges.

      If you try to resize a layout like this to the right, you will get issues with frame edges not lining up as frame B would be resized less than A. If you had a frame at the empty space that you excluded, it's right edge would no longer align with B's.

      See framesRedistributeFix for the helper that is used internally to get around this.

      ┌────────────┐ │A │ └──┬─────────┤ │B │ └─────────┘

      Also note that it automatically excludes all collapsed frames without an area (height or width === 0).

      Pinned edges will not be moved, space will be redistributed amongst remaining space. If doing this would cause edges to get "flipped", function will return LAYOUT_ERROR.REDISTRIBUTE_WOULD_RESULT_IN_INVALID_FRAMES.

      ┌──┬──────────────┐ │ │ │ │ ├──────────┬───┤ │ │ │ │ │ │ │ │ └──┴──────────┴───┘

      Parameters

      • win: BaseLayoutWindow
      • side: "left" | "right" | "top" | "bottom"

        Side to expand/shrink to.

      • frameIds: string[]
      • amountScaled: number

        This can be negative to expand the frames instead (e.g. when collapsing a docked frame).

      • __namedParameters: {
            allowOutOfBounds?: boolean;
            pinnedEdgeCoordinates?: number[];
            skipMinSizeCheck?: boolean;
        } = {}
        • OptionalallowOutOfBounds?: boolean

          Allow the resize span to exceed window bounds.

        • OptionalpinnedEdgeCoordinates?: number[]

          Frame IDs whose position and size must not change. Must be a subset of frameIds.

        • OptionalskipMinSizeCheck?: boolean

          Skip the per-frame min size check. Frames may shrink very small but not to 0 or below.

      Returns
          | LayoutChange
          | KnownError<
              "REDISTRIBUTE_OUT_OF_BOUNDS",
              { max: number; min: number; wanted: number },
          >
          | KnownError<
              "NO_SPACE_TO_REDISTRIBUTE",
              { frameSizeNeeded: number; minFrameSize: number },
          >
          | KnownError<
              "REDISTRIBUTE_WOULD_RESULT_IN_INVALID_FRAMES",
              { problemEdgeCoordinates: number[] },
          >