@witchcraft/layout 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/LayoutDecos.d.vue.ts +8 -0
  3. package/dist/runtime/components/LayoutDecos.vue.d.ts +8 -0
  4. package/dist/runtime/components/LayoutEdges.d.vue.ts +27 -0
  5. package/dist/runtime/components/LayoutEdges.vue.d.ts +27 -0
  6. package/dist/runtime/components/LayoutFrame.d.vue.ts +36 -0
  7. package/dist/runtime/components/LayoutFrame.vue.d.ts +36 -0
  8. package/dist/runtime/components/LayoutShapeSquare.d.vue.ts +36 -0
  9. package/dist/runtime/components/LayoutShapeSquare.vue.d.ts +36 -0
  10. package/dist/runtime/components/LayoutWindow.d.vue.ts +108 -0
  11. package/dist/runtime/components/LayoutWindow.vue.d.ts +108 -0
  12. package/dist/runtime/composables/useFrames.d.ts +180 -0
  13. package/dist/runtime/demo/App.d.vue.ts +2 -0
  14. package/dist/runtime/demo/App.vue.d.ts +2 -0
  15. package/dist/runtime/demo/DemoControls.d.vue.ts +6 -0
  16. package/dist/runtime/demo/DemoControls.vue.d.ts +6 -0
  17. package/dist/runtime/demo/main.d.ts +2 -0
  18. package/dist/runtime/demo/sharedLayoutInstance.d.ts +6 -0
  19. package/dist/runtime/demo/tailwind.css +1 -1
  20. package/dist/runtime/drag/CloseAction.d.ts +33 -0
  21. package/dist/runtime/drag/DragActionHandler.d.ts +42 -0
  22. package/dist/runtime/drag/DragDirectionStore.d.ts +20 -0
  23. package/dist/runtime/drag/SplitAction.d.ts +32 -0
  24. package/dist/runtime/drag/types.d.ts +92 -0
  25. package/dist/runtime/helpers/addPointsToIntersection.d.ts +2 -0
  26. package/dist/runtime/helpers/assertEdgeSorted.d.ts +2 -0
  27. package/dist/runtime/helpers/assertItemIn.d.ts +1 -0
  28. package/dist/runtime/helpers/assertItemNotIn.d.ts +1 -0
  29. package/dist/runtime/helpers/assertLayoutHasActiveWindow.d.ts +4 -0
  30. package/dist/runtime/helpers/assertValidWinAndFrame.d.ts +5 -0
  31. package/dist/runtime/helpers/assertValidWinAndFrameIds.d.ts +2 -0
  32. package/dist/runtime/helpers/assertWindowHasActiveFrame.d.ts +4 -0
  33. package/dist/runtime/helpers/clampNumber.d.ts +1 -0
  34. package/dist/runtime/helpers/cloneFrame.d.ts +2 -0
  35. package/dist/runtime/helpers/cloneFrames.d.ts +2 -0
  36. package/dist/runtime/helpers/containsEdge.d.ts +2 -0
  37. package/dist/runtime/helpers/convertLayoutWindowToWorkspace.d.ts +2 -0
  38. package/dist/runtime/helpers/copySize.d.ts +2 -0
  39. package/dist/runtime/helpers/createEdge.d.ts +5 -0
  40. package/dist/runtime/helpers/dirToOrientation.d.ts +2 -0
  41. package/dist/runtime/helpers/dirToSide.d.ts +2 -0
  42. package/dist/runtime/helpers/doEdgesOverlap.d.ts +2 -0
  43. package/dist/runtime/helpers/doesEdgeContinueEdge.d.ts +2 -0
  44. package/dist/runtime/helpers/edgeToPoints.d.ts +2 -0
  45. package/dist/runtime/helpers/findDraggableEdge.d.ts +4 -0
  46. package/dist/runtime/helpers/findFrameDraggableEdges.d.ts +7 -0
  47. package/dist/runtime/helpers/frameToEdges.d.ts +2 -0
  48. package/dist/runtime/helpers/frameToPoints.d.ts +19 -0
  49. package/dist/runtime/helpers/getEdgeOrientation.d.ts +2 -0
  50. package/dist/runtime/helpers/getEdgeSharedDirection.d.ts +2 -0
  51. package/dist/runtime/helpers/getEdgeSide.d.ts +2 -0
  52. package/dist/runtime/helpers/getFrameById.d.ts +2 -0
  53. package/dist/runtime/helpers/getFrameConstant.d.ts +2 -0
  54. package/dist/runtime/helpers/getIntersections.d.ts +2 -0
  55. package/dist/runtime/helpers/getIntersectionsCss.d.ts +9 -0
  56. package/dist/runtime/helpers/getMoveEdgeInfo.d.ts +11 -0
  57. package/dist/runtime/helpers/getResizeLimit.d.ts +2 -0
  58. package/dist/runtime/helpers/getShapeSquareCss.d.ts +7 -0
  59. package/dist/runtime/helpers/getSideTouching.d.ts +2 -0
  60. package/dist/runtime/helpers/getVisualEdgeCss.d.ts +7 -0
  61. package/dist/runtime/helpers/getVisualEdges.d.ts +48 -0
  62. package/dist/runtime/helpers/getVisualEdgesCss.d.ts +3 -0
  63. package/dist/runtime/helpers/getWinAndFrameById.d.ts +10 -0
  64. package/dist/runtime/helpers/getWinByFrameUuid.d.ts +2 -0
  65. package/dist/runtime/helpers/getWinById.d.ts +2 -0
  66. package/dist/runtime/helpers/getWindowConstant.d.ts +2 -0
  67. package/dist/runtime/helpers/inRange.d.ts +1 -0
  68. package/dist/runtime/helpers/index.d.ts +62 -0
  69. package/dist/runtime/helpers/isEdgeEqual.d.ts +2 -0
  70. package/dist/runtime/helpers/isEdgeParallel.d.ts +2 -0
  71. package/dist/runtime/helpers/isPointEqual.d.ts +2 -0
  72. package/dist/runtime/helpers/isSizeAboveMin.d.ts +2 -0
  73. package/dist/runtime/helpers/isSizeEqual.d.ts +2 -0
  74. package/dist/runtime/helpers/isWindowEdge.d.ts +2 -0
  75. package/dist/runtime/helpers/isWindowEdgePoint.d.ts +2 -0
  76. package/dist/runtime/helpers/moveEdge.d.ts +4 -0
  77. package/dist/runtime/helpers/numberToScaledPercent.d.ts +13 -0
  78. package/dist/runtime/helpers/numberToScaledSize.d.ts +2 -0
  79. package/dist/runtime/helpers/oppositeSide.d.ts +2 -0
  80. package/dist/runtime/helpers/resizeByEdge.d.ts +2 -0
  81. package/dist/runtime/helpers/sideToDirection.d.ts +3 -0
  82. package/dist/runtime/helpers/sideToOrientation.d.ts +2 -0
  83. package/dist/runtime/helpers/splitEdge.d.ts +2 -0
  84. package/dist/runtime/helpers/toCoord.d.ts +3 -0
  85. package/dist/runtime/helpers/toId.d.ts +3 -0
  86. package/dist/runtime/helpers/toWindowCoord.d.ts +2 -0
  87. package/dist/runtime/helpers/unionEdges.d.ts +2 -0
  88. package/dist/runtime/helpers/updateWindowSizeWithEvent.d.ts +2 -0
  89. package/dist/runtime/index.d.ts +5 -0
  90. package/dist/runtime/layout/closeFrame.d.ts +5 -0
  91. package/dist/runtime/layout/closeFrames.d.ts +2 -0
  92. package/dist/runtime/layout/createSplitDecoEdge.d.ts +2 -0
  93. package/dist/runtime/layout/createSplitDecoFromDrag.d.ts +2 -0
  94. package/dist/runtime/layout/debugFrame.d.ts +2 -0
  95. package/dist/runtime/layout/findFramesTouchingEdge.d.ts +49 -0
  96. package/dist/runtime/layout/findSafeSplitEdge.d.ts +5 -0
  97. package/dist/runtime/layout/findVisualEdge.d.ts +2 -0
  98. package/dist/runtime/layout/frameCreate.d.ts +3 -0
  99. package/dist/runtime/layout/frameSplit.d.ts +16 -0
  100. package/dist/runtime/layout/getCloseFrameInfo.d.ts +73 -0
  101. package/dist/runtime/layout/getFrameSplitInfo.d.ts +16 -0
  102. package/dist/runtime/layout/getFrameTo.d.ts +2 -0
  103. package/dist/runtime/layout/index.d.ts +22 -0
  104. package/dist/runtime/layout/isPointInFrame.d.ts +2 -0
  105. package/dist/runtime/layout/layoutAddWindow.d.ts +2 -0
  106. package/dist/runtime/layout/layoutCreate.d.ts +3 -0
  107. package/dist/runtime/layout/layoutRemoveWindow.d.ts +2 -0
  108. package/dist/runtime/layout/resizeFrame.d.ts +6 -0
  109. package/dist/runtime/layout/windowAddFrame.d.ts +2 -0
  110. package/dist/runtime/layout/windowCreate.d.ts +4 -0
  111. package/dist/runtime/layout/windowRemoveFrame.d.ts +2 -0
  112. package/dist/runtime/layout/windowSetActiveFrame.d.ts +2 -0
  113. package/dist/runtime/settings.d.ts +23 -0
  114. package/dist/runtime/types/index.d.ts +459 -0
  115. package/dist/runtime/utils/KnownError.d.ts +10 -0
  116. package/package.json +5 -5
  117. package/src/runtime/demo/tailwind.css +1 -1
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Given a number (e.g. the x coordinate in px), and the max value it could be (e.g. the max width of it's container in px), returns it's position as a scaled percentage.
3
+ *
4
+ * ```
5
+ * -----------
6
+ * | * |
7
+ * -----------
8
+ * | ^100px
9
+ * ^ 50px
10
+ * // returns 50 / 100 * scale or 50000 (50%)
11
+ * ```
12
+ */
13
+ export declare function numberToScaledPercent(num: number, max: number, scale?: number): number;
@@ -0,0 +1,2 @@
1
+ import type { LayoutWindow, PxSize, Size } from "../types/index.js";
2
+ export declare function numberToScaledSize(win: LayoutWindow, size: PxSize | number, scale?: number): Size;
@@ -0,0 +1,2 @@
1
+ import type { Direction, EdgeSide, ExtendedDirection, ExtendedEdgeSide, Point, Size } from "../types/index.js";
2
+ export declare function oppositeSide<T extends Direction | EdgeSide | ExtendedDirection | ExtendedEdgeSide | keyof Point | keyof Size>(dir: T): T;
@@ -0,0 +1,2 @@
1
+ import type { Direction, Edge, LayoutFrame } from "../types/index.js";
2
+ export declare function resizeByEdge(touchingFrames: LayoutFrame[], edge: Edge, dir: Direction, newPos: number, distance: number): void;
@@ -0,0 +1,3 @@
1
+ import type { Direction, EdgeSide } from "../types/index.js";
2
+ /** Converts a side to a direction (relative to a frame's center) */
3
+ export declare function sideToDirection(side: EdgeSide): Direction;
@@ -0,0 +1,2 @@
1
+ import type { EdgeSide, Orientation } from "../types/index.js";
2
+ export declare function sideToOrientation(dir: EdgeSide): Orientation;
@@ -0,0 +1,2 @@
1
+ import type { Edge, Orientation } from "../types/index.js";
2
+ export declare function splitEdge(edge: Edge, edgeDirection: Orientation, splits: number[]): Edge[];
@@ -0,0 +1,3 @@
1
+ import type { HasOpposite } from "../types/index.js";
2
+ /** Converts the given side/dir into a coordinate key (x/y) */
3
+ export declare function toCoord<T extends HasOpposite>(dir: T): T extends "left" | "right" | "horizontal" ? "x" : "y";
@@ -0,0 +1,3 @@
1
+ export declare function toId(item: {
2
+ id: string;
3
+ } | string): string;
@@ -0,0 +1,2 @@
1
+ import type { LayoutWindow, Point } from "../types/index.js";
2
+ export declare function toWindowCoord(win: LayoutWindow, e: Pick<PointerEvent, "clientX" | "clientY">, snapAmount?: Point): Point;
@@ -0,0 +1,2 @@
1
+ import type { Edge, Orientation } from "../types/index.js";
2
+ export declare function unionEdges(edges: Edge[], dir: Orientation): Edge;
@@ -0,0 +1,2 @@
1
+ import type { LayoutWindow, PxPos, PxSize } from "../types/index.js";
2
+ export declare function updateWindowWithEvent(win: LayoutWindow, event: PxPos & PxSize): void;
@@ -0,0 +1,5 @@
1
+ export * from "./types/index.js";
2
+ export * from "./layout/index.js";
3
+ export * from "./helpers/index.js";
4
+ export * from "./utils/KnownError.js";
5
+ export * from "./settings.js";
@@ -0,0 +1,5 @@
1
+ import type { Direction, Edge, EdgeSide, LAYOUT_ERROR, LayoutFrame, LayoutWindow, Size } from "../types/index.js";
2
+ import type { KnownError } from "../utils/KnownError.js";
3
+ export declare function closeFrame<T extends "edge" | "dir">(win: LayoutWindow, visualEdges: Edge[], frame: LayoutFrame,
4
+ /** See {@link getCloseFrameInfo} */
5
+ closeDirOrSide: (T extends "dir" ? Direction : EdgeSide), closeBy?: T, force?: boolean, minSize?: Size): LayoutFrame[] | KnownError<typeof LAYOUT_ERROR.CANT_CLOSE_NEARBY_FRAMES_TOO_SMALL | typeof LAYOUT_ERROR.CANT_CLOSE_NO_DRAG_EDGE | typeof LAYOUT_ERROR.CANT_CLOSE_SINGLE_FRAME | typeof LAYOUT_ERROR.CANT_CLOSE_WITHOUT_FORCE>;
@@ -0,0 +1,2 @@
1
+ import type { LayoutFrame, LayoutWindow } from "../types/index.js";
2
+ export declare function closeFrames(win: LayoutWindow, deletedFrames: LayoutFrame[], modifiedFrames: LayoutFrame[]): void;
@@ -0,0 +1,2 @@
1
+ import type { LayoutFrame, Point, RawSplitDeco, Size, SplitDecoShapes } from "../types/index.js";
2
+ export declare function createSplitDecoEdge(frames: Record<string, LayoutFrame>, deco: RawSplitDeco, snapAmount?: Point, minSize?: Size): SplitDecoShapes;
@@ -0,0 +1,2 @@
1
+ import type { Direction, LayoutFrame, Point, Size, SplitDeco } from "../types/index.js";
2
+ export declare function createSplitDecoFromDrag(frames: Record<string, LayoutFrame>, frame: LayoutFrame, dragDirection: Direction, dragPoint: Point, snapAmount?: Point, minSize?: Size): SplitDeco;
@@ -0,0 +1,2 @@
1
+ import type { LayoutFrame } from "../types/index.js";
2
+ export declare function debugFrame(frame: LayoutFrame): string;
@@ -0,0 +1,49 @@
1
+ import type { Direction, Edge, EdgeSide, LayoutFrame, Point } from "../types/index.js";
2
+ /**
3
+ * Given an edge or visualEdge (which might touch/contain several frame edges, see {@link getVisualEdges }), returns the frame edges that match the given criteria. If no criteria is given, just returns all touching frames.
4
+ *
5
+ * Useful, for implementing drag related features.
6
+ *
7
+ * A visual explanation of the options:
8
+ * ```
9
+ * frames (A,B,C,D):
10
+ * ┌──────────────────┐
11
+ * │A ╏B │
12
+ * │ ╏ │
13
+ * ├────────╏ │
14
+ * │C ╏─────────┤
15
+ * │ ╏D │
16
+ * │ ╏ │
17
+ * │ < ╏ > searchDirections
18
+ * │ ╏ │
19
+ * │ + referencePoint*
20
+ * │ ╏ │
21
+ * └──────────────────┘
22
+ * ^visualEdge
23
+ *
24
+ * Note the reference point is not on the line. The coordinate used depends on the orientation of the visualEdge.
25
+ * ```
26
+ * So given the middle visual edge, the point `+` and the right search direction, would return the left edge of frame D.
27
+ *
28
+ * Given the left direction instead it would return C.
29
+ *
30
+ * Given no point, and the right direction it would return B and D.
31
+ */
32
+ export declare function findFramesTouchingEdge(edge: Edge, frames: LayoutFrame[], criteria?: {
33
+ /**
34
+ * If a position (e.g. a cursor position) is given, only edges within the corresponding horizontal/vertical range will be returned.
35
+ *
36
+ * For example, if the visual edge is vertical, the function will only return edges that contain the y position, ignoring the x position. See the function documentation for a visual example.
37
+ */
38
+ referencePoint?: Point;
39
+ /**
40
+ * Several frames can lay to either side of a visual edge. This limits the directions in which to look. Otherwise we look in the directions perpendicular to the visual edge.
41
+ *
42
+ * See the function documentation for a visual example.
43
+ */
44
+ searchDirections?: Direction[];
45
+ }): ({
46
+ edge: Edge;
47
+ frame: LayoutFrame;
48
+ side: EdgeSide;
49
+ })[];
@@ -0,0 +1,5 @@
1
+ import type { Direction, Edge, LayoutFrame, Point, Size } from "../types/index.js";
2
+ export declare function findSafeSplitEdgeAndPosition(frame: LayoutFrame, dragDirection: Direction, dragPointOrPosition: Point | number, snapAmount?: Point, minSize?: Size): {
3
+ edge: Edge;
4
+ position: number;
5
+ };
@@ -0,0 +1,2 @@
1
+ import type { Edge } from "../types/index.js";
2
+ export declare function findVisualEdge(visualEdges: Edge[], edge: Edge): Edge | undefined;
@@ -0,0 +1,3 @@
1
+ import type { BaseLayoutFrame, ExtendedLayoutFrame, LayoutFrame } from "../types/index.js";
2
+ /** Create a new frame. Note that it will always have a new id if it's undefined. */
3
+ export declare function frameCreate(opts?: Partial<BaseLayoutFrame> & Omit<ExtendedLayoutFrame, keyof BaseLayoutFrame>): LayoutFrame;
@@ -0,0 +1,16 @@
1
+ import type { LayoutFrame, LayoutWindow } from "../types/index.js";
2
+ /**
3
+ * Apply a frame split. See {@link getFrameSplitInfo}
4
+ * ```ts
5
+ * // undefined if we can't split
6
+ * const splitInfo = getFrameSplitInfo()
7
+ * if (splitInfo) {
8
+ * frameSplit(win, splitInfo)
9
+ *
10
+ * }
11
+ * ```
12
+ */
13
+ export declare function frameSplit(win: LayoutWindow, { splitFrame, newFrame }: {
14
+ splitFrame: LayoutFrame;
15
+ newFrame: LayoutFrame;
16
+ }): LayoutFrame | undefined;
@@ -0,0 +1,73 @@
1
+ import { type Direction, type Edge, type EdgeSide, LAYOUT_ERROR, type LayoutFrame, type Size } from "../types/index.js";
2
+ import { KnownError } from "../utils/KnownError.js";
3
+ /**
4
+ * Returns the information necessary to close a frame or frames (if force: true).
5
+ *
6
+ * Can close by direction or by frame edge.
7
+ *
8
+ * - Closing A in the left direction or by it's right edge would close A and expand B.
9
+ *
10
+ * - Closing A in the right direction or by it's left edge is not possible, since it's left edge is a window edge.
11
+ *
12
+ * ```
13
+ * ┌──┬──┐
14
+ * │A │B │
15
+ * └──┴──┘
16
+ * ```
17
+ * A list of possible directions/edges can be given to attempt closing by those directions/edges in that order.
18
+ *
19
+ * Frame closing does not always succeed:
20
+ *
21
+ * ## `force: false` (default)
22
+ *
23
+ * If two frames share a visual edge exactly, they can always be closed to either side.
24
+ * ```
25
+ * 🭮 🭬
26
+ * ┌──┬──┐
27
+ * │A │B │
28
+ * └──┴──┘
29
+ * ```
30
+ *
31
+ * ## `force: true`
32
+ *
33
+ * 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.
34
+ *
35
+ * There's two main scenarios to consider when we have multiple frames:
36
+ *
37
+ * - The frames all share an edge on the closing side. We can force close both without problems.
38
+ *
39
+ * So, for example, here A & B can be force closed to the left since they share their left edge (vertically).
40
+ * ```
41
+ * ─🭬
42
+ * ┌──┬──┐
43
+ * │A │C │
44
+ * ├──┤ │
45
+ * │B │ │
46
+ * └──┴──┘
47
+ * ```
48
+ * - 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.
49
+ *
50
+ * For this to succeed, the difference between the smallest frame and the next smallest frame must be greater than the minimum size.
51
+ *
52
+ * 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.
53
+ * ```
54
+ * 🭮──
55
+ *┌──────┬──┬──┐
56
+ *│E │A │F │
57
+ *├───┬──┴──┤ │
58
+ *│F │B │ │
59
+ *├───┴─────┤ │
60
+ *│C │ │
61
+ *└─────────┴──┘
62
+ * ```
63
+ */
64
+ export declare function getCloseFrameInfo<T extends "edge" | "dir">(frames: LayoutFrame[], visualEdges: Edge[], frame: LayoutFrame,
65
+ /**
66
+ * The direction or edge (if closeBy = "edge") to search for possible closes.
67
+ *
68
+ * 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".
69
+ */
70
+ closeDirOrSide: (T extends "dir" ? Direction : EdgeSide), closeBy?: T, force?: boolean, minSize?: Size): {
71
+ modifiedFrames: LayoutFrame[];
72
+ deletedFrames: LayoutFrame[];
73
+ } | KnownError<typeof LAYOUT_ERROR.CANT_CLOSE_NEARBY_FRAMES_TOO_SMALL | typeof LAYOUT_ERROR.CANT_CLOSE_NO_DRAG_EDGE | typeof LAYOUT_ERROR.CANT_CLOSE_SINGLE_FRAME | typeof LAYOUT_ERROR.CANT_CLOSE_WITHOUT_FORCE>;
@@ -0,0 +1,16 @@
1
+ import { type Direction, type LayoutFrame, type Point, type Size } from "../types/index.js";
2
+ import { KnownError } from "../utils/KnownError.js";
3
+ export declare function getFrameSplitInfo(frame: LayoutFrame, dir: Direction, dragPointOrPosition?: Point | number | "midpoint", minSize?: Size, snapAmount?: Point): KnownError<"CANT_SPLIT_FRAME_TOO_SMALL", {
4
+ frame: LayoutFrame;
5
+ newSize: number;
6
+ minSize: number;
7
+ }> | {
8
+ splitFrame: LayoutFrame;
9
+ newFrame: {
10
+ width: number;
11
+ height: number;
12
+ x: number;
13
+ y: number;
14
+ id: import("../types/index.js").FrameId;
15
+ };
16
+ };
@@ -0,0 +1,2 @@
1
+ import type { EdgeSide, LayoutFrame } from "../types/index.js";
2
+ export declare function getFrameTo(side: EdgeSide, frame: LayoutFrame, frames: LayoutFrame[]): LayoutFrame | undefined;
@@ -0,0 +1,22 @@
1
+ export { closeFrame } from "./closeFrame.js";
2
+ export { closeFrames } from "./closeFrames.js";
3
+ export { createSplitDecoEdge } from "./createSplitDecoEdge.js";
4
+ export { createSplitDecoFromDrag } from "./createSplitDecoFromDrag.js";
5
+ export { debugFrame } from "./debugFrame.js";
6
+ export { findFramesTouchingEdge } from "./findFramesTouchingEdge.js";
7
+ export { findSafeSplitEdgeAndPosition } from "./findSafeSplitEdge.js";
8
+ export { findVisualEdge } from "./findVisualEdge.js";
9
+ export { frameCreate } from "./frameCreate.js";
10
+ export { frameSplit } from "./frameSplit.js";
11
+ export { getCloseFrameInfo } from "./getCloseFrameInfo.js";
12
+ export { getFrameSplitInfo } from "./getFrameSplitInfo.js";
13
+ export { getFrameTo } from "./getFrameTo.js";
14
+ export { isPointInFrame } from "./isPointInFrame.js";
15
+ export { layoutAddWindow } from "./layoutAddWindow.js";
16
+ export { layoutCreate } from "./layoutCreate.js";
17
+ export { layoutRemoveWindow } from "./layoutRemoveWindow.js";
18
+ export { resizeFrame } from "./resizeFrame.js";
19
+ export { windowAddFrame } from "./windowAddFrame.js";
20
+ export { windowCreate } from "./windowCreate.js";
21
+ export { windowRemoveFrame } from "./windowRemoveFrame.js";
22
+ export { windowSetActiveFrame } from "./windowSetActiveFrame.js";
@@ -0,0 +1,2 @@
1
+ import type { LayoutFrame, Point } from "../types/index.js";
2
+ export declare function isPointInFrame(frame: LayoutFrame, point: Point): boolean;
@@ -0,0 +1,2 @@
1
+ import type { Layout, LayoutWindow } from "../types/index.js";
2
+ export declare function layoutAddWindow(layout: Layout, win: LayoutWindow): LayoutWindow;
@@ -0,0 +1,3 @@
1
+ import type { z } from "zod";
2
+ import type { Layout, zLayoutCreate } from "../types/index.js";
3
+ export declare function layoutCreate(opts?: z.infer<typeof zLayoutCreate>): Layout;
@@ -0,0 +1,2 @@
1
+ import type { Layout, LayoutWindow } from "../types/index.js";
2
+ export declare function layoutRemoveWindow(layout: Layout, win: LayoutWindow | string): void;
@@ -0,0 +1,6 @@
1
+ import type { ExtendedDirection, LayoutFrame, LayoutWindow, Size } from "../types/index.js";
2
+ export declare function resizeFrame(win: LayoutWindow, frame: LayoutFrame, dir: ExtendedDirection,
3
+ /** Scaled */
4
+ distance: Size,
5
+ /** Scaled */
6
+ minSize?: Size): boolean;
@@ -0,0 +1,2 @@
1
+ import type { LayoutFrame, LayoutWindow } from "../types/index.js";
2
+ export declare function windowAddFrame(win: LayoutWindow, frame: LayoutFrame): LayoutFrame;
@@ -0,0 +1,4 @@
1
+ import type { z } from "zod";
2
+ import type { LayoutWindow, zWindowCreate } from "../types/index.js";
3
+ /** Create a new window. Note that it will always have a new id if it's undefined. */
4
+ export declare function windowCreate(opts?: z.infer<typeof zWindowCreate>): LayoutWindow;
@@ -0,0 +1,2 @@
1
+ import type { LayoutFrame, LayoutWindow } from "../types/index.js";
2
+ export declare function windowRemoveFrame(win: LayoutWindow, frame: LayoutFrame | string): void;
@@ -0,0 +1,2 @@
1
+ import type { LayoutFrame, LayoutWindow } from "../types/index.js";
2
+ export declare function windowSetActiveFrame(win: LayoutWindow, frame: LayoutFrame | string): void;
@@ -0,0 +1,23 @@
1
+ import type { Point, Size } from "./types/index.js";
2
+ export declare const globalOptions: {
3
+ SCALE: number;
4
+ maxInt: number;
5
+ SNAP_PERCENTAGE_X: number;
6
+ SNAP_PERCENTAGE_Y: number;
7
+ snapPoint: {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ MARGIN_PERCENTAGE_WIDTH: number;
12
+ MARGIN_PERCENTAGE_HEIGHT: number;
13
+ marginSize: {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ };
18
+ export declare function setScale(scale: number): void;
19
+ export declare function getMaxInt(): number;
20
+ export declare function setSnapPercentage(snapPercentage: number | Point): void;
21
+ export declare function getSnapPoint(): Readonly<Point>;
22
+ export declare function setMarginPercentage(margin: number | Size): void;
23
+ export declare function getMarginSize(): Readonly<Size>;