laymur 0.10.3 → 0.11.1

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 (131) hide show
  1. package/README.md +20 -11
  2. package/dist/constraints/UIAspectConstraint.Internal.d.ts +6 -0
  3. package/dist/constraints/UIAspectConstraint.d.ts +9 -46
  4. package/dist/constraints/UIConstraint.d.ts +7 -27
  5. package/dist/constraints/UICustomConstraint.d.ts +13 -45
  6. package/dist/constraints/UIHeightConstraint.Internal.d.ts +6 -0
  7. package/dist/constraints/UIHeightConstraint.d.ts +8 -37
  8. package/dist/constraints/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
  9. package/dist/constraints/UIHorizontalDistanceConstraint.d.ts +16 -73
  10. package/dist/constraints/UIHorizontalProportionConstraint.Internal.d.ts +6 -0
  11. package/dist/constraints/UIHorizontalProportionConstraint.d.ts +8 -52
  12. package/dist/constraints/UISingleParameterConstraint.Internal.d.ts +12 -0
  13. package/dist/constraints/UISingleParameterConstraint.d.ts +24 -87
  14. package/dist/constraints/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
  15. package/dist/constraints/UIVerticalDistanceConstraint.d.ts +12 -73
  16. package/dist/constraints/UIVerticalProportionConstraint.Internal.d.ts +6 -0
  17. package/dist/constraints/UIVerticalProportionConstraint.d.ts +8 -52
  18. package/dist/constraints/UIWidthConstraint.Internal.d.ts +6 -0
  19. package/dist/constraints/UIWidthConstraint.d.ts +8 -37
  20. package/dist/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +45 -0
  21. package/dist/constraints/builders/UIConstraint2DBuilder.d.ts +35 -0
  22. package/dist/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
  23. package/dist/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
  24. package/dist/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
  25. package/dist/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
  26. package/dist/elements/UIAnchor.Internal.d.ts +9 -0
  27. package/dist/elements/UIAnchor.d.ts +17 -62
  28. package/dist/elements/UIAnimatedImage.Internal.d.ts +24 -0
  29. package/dist/elements/UIAnimatedImage.d.ts +38 -100
  30. package/dist/elements/UIDummy.Internal.d.ts +18 -0
  31. package/dist/elements/UIDummy.d.ts +51 -63
  32. package/dist/elements/UIElement.Internal.d.ts +11 -0
  33. package/dist/elements/UIElement.d.ts +28 -168
  34. package/dist/elements/UIGraphics.Internal.d.ts +7 -0
  35. package/dist/elements/UIGraphics.d.ts +29 -99
  36. package/dist/elements/UIImage.Internal.d.ts +7 -0
  37. package/dist/elements/UIImage.d.ts +18 -73
  38. package/dist/elements/UINineSlice.Internal.d.ts +23 -0
  39. package/dist/elements/UINineSlice.d.ts +45 -0
  40. package/dist/elements/UIProgress.Internal.d.ts +14 -0
  41. package/dist/elements/UIProgress.d.ts +26 -152
  42. package/dist/elements/UIScene.Internal.d.ts +43 -0
  43. package/dist/elements/UIScene.d.ts +29 -171
  44. package/dist/elements/UIText/UIText.Interfaces.d.ts +32 -0
  45. package/dist/elements/UIText/UIText.Internal.d.ts +26 -0
  46. package/dist/elements/UIText/UIText.Measuring.d.ts +49 -0
  47. package/dist/elements/UIText/UIText.Rendering.d.ts +19 -0
  48. package/dist/elements/UIText/UIText.d.ts +63 -0
  49. package/dist/index.d.ts +46 -46
  50. package/dist/index.js +4176 -4002
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.min.js +1 -1
  53. package/dist/index.min.js.map +1 -1
  54. package/dist/layers/UIFullscreenLayer.d.ts +33 -43
  55. package/dist/layers/UILayer.Internal.d.ts +15 -0
  56. package/dist/layers/UILayer.d.ts +29 -184
  57. package/dist/miscellaneous/UIExpression.d.ts +35 -83
  58. package/dist/miscellaneous/UIInputEvent.d.ts +11 -8
  59. package/dist/miscellaneous/UIMode.d.ts +19 -21
  60. package/dist/miscellaneous/UIOrientation.d.ts +7 -22
  61. package/dist/miscellaneous/UIPriority.d.ts +16 -40
  62. package/dist/miscellaneous/UIRelation.d.ts +11 -31
  63. package/dist/miscellaneous/UITransparencyMode.d.ts +4 -21
  64. package/dist/miscellaneous/area/UIArea.d.ts +3 -0
  65. package/dist/miscellaneous/area/UIAreaCircle.d.ts +15 -0
  66. package/dist/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
  67. package/dist/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
  68. package/dist/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
  69. package/dist/miscellaneous/asserts.d.ts +39 -82
  70. package/dist/miscellaneous/color/UIColor.Internal.d.ts +7 -0
  71. package/dist/miscellaneous/color/UIColor.d.ts +197 -0
  72. package/dist/miscellaneous/computeTransform.d.ts +18 -0
  73. package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.Internal.d.ts +10 -0
  74. package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.d.ts +36 -0
  75. package/dist/miscellaneous/generic-plane/UIGenericPlane.Internal.d.ts +5 -0
  76. package/dist/miscellaneous/generic-plane/UIGenericPlane.d.ts +23 -0
  77. package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.Internal.d.ts +6 -0
  78. package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.d.ts +27 -0
  79. package/dist/miscellaneous/generic-plane/shared.d.ts +22 -0
  80. package/dist/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
  81. package/dist/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
  82. package/dist/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
  83. package/dist/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
  84. package/dist/miscellaneous/micro/UIMicro.d.ts +59 -0
  85. package/dist/miscellaneous/padding/UIPadding.Internal.d.ts +11 -0
  86. package/dist/miscellaneous/padding/UIPadding.d.ts +46 -0
  87. package/dist/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
  88. package/dist/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
  89. package/dist/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
  90. package/dist/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
  91. package/dist/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
  92. package/dist/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
  93. package/dist/miscellaneous/text-span/UITextSpan.Internal.d.ts +8 -0
  94. package/dist/miscellaneous/text-span/UITextSpan.d.ts +14 -0
  95. package/dist/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
  96. package/dist/miscellaneous/text-style/UITextStyle.d.ts +85 -0
  97. package/dist/miscellaneous/texture/UITextureView.Internal.d.ts +54 -0
  98. package/dist/miscellaneous/texture/UITextureView.d.ts +61 -0
  99. package/dist/wrappers/UIInputWrapper.Internal.d.ts +17 -0
  100. package/dist/wrappers/UIInputWrapper.d.ts +13 -0
  101. package/dist/wrappers/UISceneWrapper.Internal.d.ts +13 -0
  102. package/dist/wrappers/UISceneWrapper.d.ts +12 -19
  103. package/dist/wrappers/UISolverWrapper.Internal.d.ts +49 -0
  104. package/dist/wrappers/UISolverWrapper.d.ts +2 -1
  105. package/package.json +3 -1
  106. package/dist/builders/UIConstraint2DBuilder.d.ts +0 -130
  107. package/dist/builders/UICoverConstraintBuilder.d.ts +0 -56
  108. package/dist/builders/UIFitConstraintBuilder.d.ts +0 -56
  109. package/dist/composer/UIComposer.d.ts +0 -0
  110. package/dist/composer/UIFullscreenQuad.d.ts +0 -0
  111. package/dist/composer/UIPass.d.ts +0 -0
  112. package/dist/elements/UINineSline.d.ts +0 -139
  113. package/dist/elements/UISpine.d.ts +0 -54
  114. package/dist/elements/UIText.d.ts +0 -149
  115. package/dist/miscellaneous/UIColor.d.ts +0 -245
  116. package/dist/miscellaneous/UIGenericInstancedPlane.d.ts +0 -32
  117. package/dist/miscellaneous/UIMicro.d.ts +0 -148
  118. package/dist/miscellaneous/UIMicroAnchorMode.d.ts +0 -9
  119. package/dist/miscellaneous/UINineSliceBorder.d.ts +0 -21
  120. package/dist/miscellaneous/UIResizePolicy.d.ts +0 -21
  121. package/dist/miscellaneous/UIResizePolicyCross.d.ts +0 -14
  122. package/dist/miscellaneous/UIResizePolicyCrossInverted.d.ts +0 -14
  123. package/dist/miscellaneous/UIResizePolicyFixedHeight.d.ts +0 -24
  124. package/dist/miscellaneous/UIResizePolicyFixedWidth.d.ts +0 -27
  125. package/dist/miscellaneous/UIResizePolicyNone.d.ts +0 -7
  126. package/dist/miscellaneous/UISceneWrapperClientAPI.d.ts +0 -12
  127. package/dist/miscellaneous/UITextPadding.d.ts +0 -7
  128. package/dist/miscellaneous/UITextSpan.d.ts +0 -6
  129. package/dist/miscellaneous/UITextStyle.d.ts +0 -20
  130. package/dist/miscellaneous/textInterfaces.d.ts +0 -19
  131. package/dist/miscellaneous/textTools.d.ts +0 -12
@@ -1,65 +1,55 @@
1
- import type { Vector2 } from "three";
2
- import { Vector3, type Camera, type WebGLRenderer } from "three";
3
- import { UIMode } from "../miscellaneous/UIMode";
4
- import type { UIResizePolicy } from "../miscellaneous/UIResizePolicy";
1
+ import type { Camera, Vector2, WebGLRenderer } from "three";
2
+ import { Ray, Vector3 } from "three";
3
+ import type { UIResizePolicy } from "../miscellaneous/resize-policy/UIResizePolicy";
5
4
  import { UILayer } from "./UILayer";
6
- /**
7
- * UI layer that covers the full browser window.
8
- *
9
- * Handles window resize and pointer events automatically. Scaling is controlled
10
- * by the assigned resize policy.
11
- *
12
- * @see {@link UILayer}
13
- * @see {@link UIResizePolicy}
14
- */
5
+ import type { UILayerMode } from "./UILayer.Internal";
6
+ /** Layer that automatically handles browser window resizing and input events */
15
7
  export declare class UIFullscreenLayer extends UILayer {
16
8
  private resizePolicyInternal;
9
+ private resizePolicyDirty;
17
10
  /**
18
- * Creates a fullscreen layer and sets up window event listeners.
19
- */
20
- constructor(resizePolicy?: UIResizePolicy, mode?: UIMode);
21
- /**
22
- * Gets the current resize policy.
11
+ * @param resizePolicy Strategy for handling window resize
12
+ * @param mode Initial visibility and interactivity mode
23
13
  */
14
+ constructor(resizePolicy?: UIResizePolicy, mode?: UILayerMode);
15
+ /** Current resize policy */
24
16
  get resizePolicy(): UIResizePolicy;
25
- /**
26
- * Sets a new resize policy. Unsubscribes from old policy and subscribes to new one.
27
- */
17
+ /** Updates resize policy */
28
18
  set resizePolicy(value: UIResizePolicy);
29
- /**
30
- * Removes window event listeners. The layer should not be used after this.
31
- */
19
+ /** Removes event listeners and frees resources */
32
20
  destroy(): void;
33
21
  /**
34
- * Renders the layer.
35
- *
36
- * @param renderer - WebGL renderer
37
- * @param deltaTime - Time since last frame in seconds
22
+ * Renders layer and all visible elements
23
+ * @param renderer Three.js WebGL renderer
24
+ * @param deltaTime Time since last frame in seconds
38
25
  */
39
26
  render(renderer: WebGLRenderer, deltaTime: number): void;
40
27
  /**
41
- * Projects 3D world position to 2D layer coordinates.
42
- *
43
- * @param position - 3D world position
44
- * @param camera - Camera for projection
45
- * @returns 2D position in layer space
28
+ * Projects 3D world position to 2D layer coordinates
29
+ * @param position World position
30
+ * @param camera Three.js camera
31
+ * @returns Layer coordinates
46
32
  */
47
33
  projectWorldPosition(position: Vector3, camera: Camera): Vector3;
48
34
  /**
49
- * Projects 2D layer position to 3D world coordinates.
50
- *
51
- * @param position - 2D position in layer space
52
- * @param camera - Camera for unprojection
53
- * @param z - z in NDC space (defaults to -1)
54
- * @returns 3D position in world space
35
+ * Projects 2D layer coordinates to 3D world position
36
+ * @param position Layer coordinates
37
+ * @param camera Three.js camera
38
+ * @param z Depth coordinate
39
+ * @returns World position
55
40
  */
56
41
  projectLayerPosition(position: Vector2, camera: Camera, z?: number): Vector3;
57
42
  /**
58
- * Handles window resize. Updates layer dimensions according to resize policy.
43
+ * Builds ray from layer position through camera
44
+ * @param position Layer coordinates
45
+ * @param camera Three.js camera
46
+ * @param result Reusable ray instance
47
+ * @returns Ray from near to far plane
59
48
  */
49
+ buildRay(position: Vector2, camera: Camera, result?: Ray): Ray;
60
50
  private readonly onResize;
61
- private readonly onDown;
62
- private readonly onMove;
63
- private readonly onUp;
51
+ private readonly onPointerDown;
52
+ private readonly onPointerMove;
53
+ private readonly onPointerUp;
64
54
  private handleWindowInput;
65
55
  }
@@ -0,0 +1,15 @@
1
+ import type { UIMode } from "../miscellaneous/UIMode";
2
+ import type { UIOrientation } from "../miscellaneous/UIOrientation";
3
+ /** Layer lifecycle and state events */
4
+ export declare enum UILayerEvent {
5
+ /** Fired when orientation changes */
6
+ ORIENTATION_CHANGED = "orientation_changed",
7
+ /** Fired when mode changes */
8
+ MODE_CHANGED = "mode_changed",
9
+ /** Fired during rendering */
10
+ RENDERING = "rendering"
11
+ }
12
+ /** Layer visibility and interactivity state */
13
+ export type UILayerMode = UIMode.HIDDEN | UIMode.VISIBLE | UIMode.INTERACTIVE;
14
+ /** Layer orientation state */
15
+ export type UILayerOrientation = UIOrientation.VERTICAL | UIOrientation.HORIZONTAL;
@@ -1,200 +1,45 @@
1
1
  import { Eventail } from "eventail";
2
2
  import type { WebGLRenderer } from "three";
3
3
  import type { UIPlaneElement } from "../miscellaneous/asserts";
4
- import { UIMode } from "../miscellaneous/UIMode";
5
- import { UIOrientation } from "../miscellaneous/UIOrientation";
6
- import type { UISceneWrapperClientAPI } from "../miscellaneous/UISceneWrapperClientAPI";
7
- import { UISceneWrapper } from "../wrappers/UISceneWrapper";
8
- import { UISolverWrapper } from "../wrappers/UISolverWrapper";
9
- /**
10
- * Interface for handling input events within UI layers.
11
- */
12
- export interface UILayerInputListener {
13
- zIndex: number;
14
- catchPointerDown(x: number, y: number, identifier: number): boolean;
15
- catchPointerMove(x: number, y: number, identifier: number): boolean;
16
- catchPointerUp(x: number, y: number, identifier: number): boolean;
17
- }
18
- /**
19
- * Events that can be emitted by UI layers.
20
- */
21
- export declare enum UILayerEvent {
22
- /** Emitted when the layer's orientation changes between horizontal and vertical. */
23
- ORIENTATION_CHANGE = "orientation_change",
24
- /** Emitted when the layer's visibility/interaction mode changes. */
25
- MODE_CHANGE = "mode_change",
26
- /** Emitted before the layer is rendered. */
27
- WILL_RENDER = "will_render"
28
- }
29
- /**
30
- * Abstract base class for UI layout containers with constraint solving and rendering.
31
- *
32
- * UILayer serves as the fundamental container for UI elements, providing constraint-based
33
- * layout solving, 3D scene management, and event handling. It manages the layer's
34
- * dimensions through solver variables, handles orientation changes, and coordinates
35
- * rendering and interaction for all contained elements.
36
- *
37
- * Each layer maintains its own constraint solver and scene graph, allowing for
38
- * independent layout calculation and rendering optimization.
39
- *
40
- * @see {@link UIElement} - Elements contained within layers
41
- * @see {@link UISolverWrapper} - Constraint solving system
42
- * @see {@link UISceneWrapper} - 3D scene management
43
- * @see {@link UIOrientation} - Layer orientation states
44
- */
4
+ import { UIInputWrapper } from "../wrappers/UIInputWrapper";
5
+ import type { UILayerMode, UILayerOrientation } from "./UILayer.Internal";
6
+ /** Base layer for UI rendering and layout management */
45
7
  export declare abstract class UILayer extends Eventail implements UIPlaneElement {
46
- /** Optional name identifier for the layer. */
8
+ /** Optional layer name */
47
9
  name: string;
48
- /**
49
- * Solver variable descriptor for the x-coordinate position.
50
- * This variable is managed by the constraint solver system.
51
- */
10
+ /** Solver variable for x coordinate */
52
11
  readonly xVariable: number;
53
- /**
54
- * Solver variable descriptor for the y-coordinate position.
55
- * This variable is managed by the constraint solver system.
56
- */
12
+ /** Solver variable for y coordinate */
57
13
  readonly yVariable: number;
58
- /**
59
- * Solver variable descriptor for the width dimension.
60
- * This variable is managed by the constraint solver system.
61
- */
14
+ /** Solver variable for width */
62
15
  readonly wVariable: number;
63
- /**
64
- * Solver variable descriptor for the height dimension.
65
- * This variable is managed by the constraint solver system.
66
- */
16
+ /** Solver variable for height */
67
17
  readonly hVariable: number;
68
- /**
69
- * Constraint solver wrapper for managing layout calculations.
70
- * @see {@link UISolverWrapper}
71
- */
72
- protected readonly solverWrapper: UISolverWrapper;
73
- /**
74
- * 3D scene wrapper for managing rendering and element hierarchy.
75
- * @see {@link UISceneWrapper}
76
- */
77
- protected readonly sceneWrapper: UISceneWrapper;
78
- /** Internal storage for the current visibility/interaction mode. */
79
- protected modeInternal: UIMode;
80
- /** Internal storage for the current orientation state. */
81
- protected orientationInternal: UIOrientation;
82
- /** Collection of input listeners for handling user interactions, sorted by z-index. */
83
- private readonly inputListeners;
84
- /**
85
- * Creates a new UILayer instance with specified dimensions.
86
- *
87
- * Initializes the constraint solver with position and dimension variables,
88
- * sets up the 3D scene wrapper, and determines the initial orientation
89
- * based on the width-to-height ratio.
90
- *
91
- * @param w - Initial width of the layer
92
- * @param h - Initial height of the layer
93
- */
94
- constructor(w: number, h: number);
95
- /**
96
- * Gets the current x position value from the constraint solver.
97
- * @returns The current x position in pixels
98
- */
18
+ protected readonly inputWrapperInternal: UIInputWrapper;
19
+ private readonly solverWrapperInternal;
20
+ private readonly sceneWrapperInternal;
21
+ private modeInternal;
22
+ private orientationInternal;
23
+ /**
24
+ * @param w Initial width in world units
25
+ * @param h Initial height in world units
26
+ * @param mode Initial visibility and interactivity mode
27
+ */
28
+ constructor(w: number, h: number, mode: UILayerMode);
29
+ /** X coordinate in world units (always 0 for layers) */
99
30
  get x(): number;
100
- /**
101
- * Gets the current y position value from the constraint solver.
102
- * @returns The current y position in pixels
103
- */
31
+ /** Y coordinate in world units (always 0 for layers) */
104
32
  get y(): number;
105
- /**
106
- * Gets the current width value from the constraint solver.
107
- * @returns The current layer width in pixels
108
- */
33
+ /** Layer width in world units */
109
34
  get width(): number;
110
- /**
111
- * Gets the current height value from the constraint solver.
112
- * @returns The current layer height in pixels
113
- */
35
+ /** Layer height in world units */
114
36
  get height(): number;
115
- /**
116
- * Gets the current visibility and interaction mode.
117
- * @returns The current UIMode setting
118
- * @see {@link UIMode}
119
- */
120
- get mode(): UIMode;
121
- /**
122
- * Gets the current orientation state.
123
- * @returns The current orientation (horizontal or vertical)
124
- * @see {@link UIOrientation}
125
- */
126
- get orientation(): UIOrientation;
127
- /**
128
- * Sets the visibility and interaction mode and emits change event.
129
- * @param value - The new UIMode setting
130
- * @see {@link UIMode}
131
- */
132
- set mode(value: UIMode);
133
- /**
134
- * Internal method for resizing the layer and updating orientation.
135
- *
136
- * Updates the solver variables for width and height, resizes the scene wrapper,
137
- * and determines if the orientation has changed based on the new dimensions.
138
- * Emits an orientation change event if the orientation has changed.
139
- *
140
- * @param width - The new layer width
141
- * @param height - The new layer height
142
- * @protected
143
- */
37
+ /** Current visibility and interactivity mode */
38
+ get mode(): UILayerMode;
39
+ /** Current orientation based on aspect ratio */
40
+ get orientation(): UILayerOrientation;
41
+ /** Updates visibility and interactivity mode */
42
+ set mode(value: UILayerMode);
144
43
  protected resizeInternal(width: number, height: number): void;
145
- /**
146
- * Internal method for rendering the layer and its elements.
147
- *
148
- * Delegates rendering to the scene wrapper if the layer is not hidden.
149
- * This method is called during the rendering loop to update and draw
150
- * all elements contained within the layer.
151
- *
152
- * @param renderer - The WebGL renderer instance
153
- * @param deltaTime - Time elapsed since the last frame in seconds
154
- * @protected
155
- */
156
44
  protected renderInternal(renderer: WebGLRenderer, deltaTime: number): void;
157
- protected onPointerDownInternal(x: number, y: number, identifier: number): void;
158
- protected onPointerMoveInternal(x: number, y: number, identifier: number): void;
159
- protected onPointerUpInternal(x: number, y: number, identifier: number): void;
160
- /**
161
- * Internal method for accessing the constraint solver wrapper.
162
- *
163
- * Provides access to the layer's constraint solver for elements and
164
- * constraints that need to create variables or constraints.
165
- *
166
- * @returns The constraint solver wrapper instance
167
- */
168
- protected ["getSolverWrapperInternal"](): UISolverWrapper;
169
- /**
170
- * Internal method for accessing the 3D scene wrapper.
171
- *
172
- * Provides access to the layer's scene management system for elements
173
- * that need to be added to or removed from the 3D scene.
174
- *
175
- * @returns The scene wrapper instance
176
- */
177
- protected ["getSceneWrapperClientAPI"](): UISceneWrapperClientAPI;
178
- /**
179
- * Internal method for registering an input listener for pointer events.
180
- *
181
- * Adds a listener to handle click events with the specified z-index priority.
182
- * Higher z-index listeners are processed first during event handling.
183
- *
184
- * @param listener - The input listener to register
185
- * @param zIndex - The z-index priority for event handling order
186
- * @throws Will throw an error if the listener is already registered
187
- */
188
- protected ["subscribePointerInput"](listener: UILayerInputListener): void;
189
- /**
190
- * Internal method for unregistering an input listener.
191
- *
192
- * Removes the specified listener from the event handling system.
193
- * The listener will no longer receive click events.
194
- *
195
- * @param listener - The input listener to remove
196
- * @throws Will throw an error if the listener is not found
197
- */
198
- protected ["unsubscribePointerInput"](listener: UILayerInputListener): void;
199
- private handleInputEvent;
200
45
  }
@@ -1,117 +1,69 @@
1
- /**
2
- * Mathematical expression builder for constraint equations in the UI layout system.
3
- *
4
- * UIExpression represents linear mathematical expressions of the form:
5
- * constant + coefficient₁ × variable₁ + coefficient₂ × variable₂ + ... + coefficientₙ × variableₙ
6
- *
7
- * These expressions are used to build constraint equations for the Kiwi solver,
8
- * enabling complex mathematical relationships between UI element properties.
9
- * Variables are referenced by their numeric descriptors from the solver system.
10
- *
11
- * @see {@link UIConstraint} - Constraints that use expressions
12
- * @see {@link UISolverWrapper} - Solver integration that creates variables
13
- */
1
+ /** Linear expression for constraint equations */
14
2
  export declare class UIExpression {
15
- /** The constant term of the expression. */
3
+ /** Constant term */
16
4
  constant: number;
17
- /** Map of variable descriptors to their coefficients in the expression. */
5
+ /** Variable coefficients */
18
6
  private readonly terms;
19
7
  /**
20
- * Creates a new UIExpression instance.
21
- *
22
- * @param constant - The constant term of the expression (defaults to 0)
23
- * @param terms - Optional array of [variableDescriptor, coefficient] pairs
8
+ * @param constant Constant term
9
+ * @param terms Variable-coefficient pairs
24
10
  */
25
11
  constructor(constant?: number, terms?: [number, number][]);
26
12
  /**
27
- * Creates a new expression that represents the sum of two expressions.
28
- *
29
- * Performs mathematical addition: (a.constant + a.terms) + (b.constant + b.terms)
30
- * Coefficients for the same variables are combined.
31
- *
32
- * @param a - The first expression
33
- * @param b - The second expression
34
- * @returns A new expression representing a + b
13
+ * Creates expression representing a + b.
14
+ * @param a First expression
15
+ * @param b Second expression
16
+ * @returns Sum of expressions
35
17
  */
36
18
  static plus(a: UIExpression, b: UIExpression): UIExpression;
37
19
  /**
38
- * Creates a new expression that represents the difference of two expressions.
39
- *
40
- * Performs mathematical subtraction: (a.constant + a.terms) - (b.constant + b.terms)
41
- * Coefficients for the same variables are combined with subtraction.
42
- *
43
- * @param a - The first expression (minuend)
44
- * @param b - The second expression (subtrahend)
45
- * @returns A new expression representing a - b
20
+ * Creates expression representing a - b.
21
+ * @param a First expression
22
+ * @param b Second expression
23
+ * @returns Difference of expressions
46
24
  */
47
25
  static minus(a: UIExpression, b: UIExpression): UIExpression;
48
26
  /**
49
- * Adds a variable term to this expression (mutating operation).
50
- *
51
- * If the variable already exists in the expression, its coefficient is
52
- * increased by the specified amount. Otherwise, a new term is added.
53
- *
54
- * @param variableIndex - The variable descriptor from the solver
55
- * @param coefficient - The coefficient to add for this variable
56
- * @returns This expression instance for method chaining
27
+ * Adds variable term to expression.
28
+ * @param variableIndex Variable descriptor
29
+ * @param coefficient Coefficient to add
30
+ * @returns This instance for chaining
57
31
  */
58
32
  plus(variableIndex: number, coefficient: number): this;
59
33
  /**
60
- * Subtracts a variable term from this expression (mutating operation).
61
- *
62
- * If the variable already exists in the expression, its coefficient is
63
- * decreased by the specified amount. Otherwise, a new term with negative
64
- * coefficient is added.
65
- *
66
- * @param variableIndex - The variable descriptor from the solver
67
- * @param coefficient - The coefficient to subtract for this variable
68
- * @returns This expression instance for method chaining
34
+ * Subtracts variable term from expression.
35
+ * @param variableIndex Variable descriptor
36
+ * @param coefficient Coefficient to subtract
37
+ * @returns This instance for chaining
69
38
  */
70
39
  minus(variableIndex: number, coefficient: number): this;
71
40
  /**
72
- * Multiplies all terms in this expression by a scalar value (mutating operation).
73
- *
74
- * Both the constant term and all variable coefficients are multiplied
75
- * by the specified value.
76
- *
77
- * @param value - The scalar value to multiply by
78
- * @returns This expression instance for method chaining
41
+ * Multiplies all terms by scalar.
42
+ * @param value Scalar multiplier
43
+ * @returns This instance for chaining
79
44
  */
80
45
  multiply(value: number): this;
81
46
  /**
82
- * Divides all terms in this expression by a scalar value (mutating operation).
83
- *
84
- * Both the constant term and all variable coefficients are divided
85
- * by the specified value.
86
- *
87
- * @param value - The scalar value to divide by (must not be zero)
88
- * @returns This expression instance for method chaining
47
+ * Divides all terms by scalar.
48
+ * @param value Scalar divisor
49
+ * @returns This instance for chaining
89
50
  */
90
51
  divide(value: number): this;
91
52
  /**
92
- * Checks if the expression contains a term for the specified variable.
93
- *
94
- * @param variableIndex - The variable descriptor to check for
95
- * @returns True if the expression has a term for this variable, false otherwise
53
+ * Checks if expression contains variable term.
54
+ * @param variableIndex Variable descriptor
55
+ * @returns True if variable has term
96
56
  */
97
57
  hasTerm(variableIndex: number): boolean;
98
58
  /**
99
- * Copies the content of another expression into this expression (mutating operation).
100
- *
101
- * Replaces all terms and the constant of this expression with those
102
- * from the source expression.
103
- *
104
- * @param expression - The source expression to copy from
105
- * @returns This expression instance for method chaining
59
+ * Copies from another expression.
60
+ * @param expression Source expression
61
+ * @returns This instance for chaining
106
62
  */
107
63
  copy(expression: UIExpression): this;
108
64
  /**
109
- * Creates a deep copy of this expression.
110
- *
111
- * The returned expression is completely independent and can be modified
112
- * without affecting the original.
113
- *
114
- * @returns A new UIExpression instance with the same content
65
+ * Creates independent copy.
66
+ * @returns New expression with same content
115
67
  */
116
68
  clone(): UIExpression;
117
69
  }
@@ -1,10 +1,13 @@
1
- /**
2
- * Events that can be emitted by UI elements.
3
- */
1
+ /** Input events emitted by UI elements */
4
2
  export declare enum UIInputEvent {
5
- DOWN = "pointerdown",
6
- MOVE = "pointermove",
7
- UP = "pointerup",
8
- ENTER = "pointerenter",
9
- LEAVE = "pointerleave"
3
+ /** Pointer pressed */
4
+ PRESSED = "pointerdown",
5
+ /** Pointer moved */
6
+ MOVED = "pointermove",
7
+ /** Pointer released */
8
+ RELEASED = "pointerup",
9
+ /** Pointer entered element */
10
+ ENTERED = "pointerenter",
11
+ /** Pointer left element */
12
+ LEFT = "pointerleave"
10
13
  }
@@ -1,25 +1,23 @@
1
- /**
2
- * Defines the visibility and interactivity state of UI elements.
3
- *
4
- * UI elements can be in one of three states:
5
- * - Hidden: Element is not visible and does not receive input
6
- * - Visible: Element is visible but does not receive input
7
- * - Interactive: Element is visible and can receive input events
8
- */
1
+ /** Visibility and interactivity state */
9
2
  export declare enum UIMode {
10
- /**
11
- * Element is not rendered and does not receive input events.
12
- * Equivalent to setting `display: none` in CSS.
13
- */
3
+ /** Not rendered, no input */
14
4
  HIDDEN = 0,
15
- /**
16
- * Element is rendered but does not receive input events.
17
- * Equivalent to setting `pointer-events: none` in CSS.
18
- */
5
+ /** Rendered, no input */
19
6
  VISIBLE = 1,
20
- /**
21
- * Element is rendered and can receive input events.
22
- * This is the fully active state for UI elements.
23
- */
24
- INTERACTIVE = 2
7
+ /** Rendered, receives input, blocks input to elements behind */
8
+ INTERACTIVE = 2,
9
+ /** Rendered, receives input, passes input to elements behind */
10
+ INTERACTIVE_TRANSPARENT = 3
25
11
  }
12
+ /**
13
+ * Checks if mode allows input events.
14
+ * @param mode Mode to check
15
+ * @returns True if interactive
16
+ */
17
+ export declare function isUIModeInteractive(mode: UIMode): boolean;
18
+ /**
19
+ * Checks if mode is rendered.
20
+ * @param mode Mode to check
21
+ * @returns True if visible
22
+ */
23
+ export declare function isUIModeVisible(mode: UIMode): boolean;
@@ -1,30 +1,15 @@
1
- /**
2
- * Defines the screen orientation states for UI constraints.
3
- *
4
- * This enum is used to specify when certain UI constraints should be active
5
- * based on the current device/screen orientation.
6
- */
1
+ /** Screen orientation for conditional constraints */
7
2
  export declare enum UIOrientation {
8
- /**
9
- * Indicates a landscape orientation (width > height).
10
- * Constraints using this value will only be active in landscape mode.
11
- */
3
+ /** Landscape (width > height) */
12
4
  HORIZONTAL = 0,
13
- /**
14
- * Indicates a portrait orientation (height > width).
15
- * Constraints using this value will only be active in portrait mode.
16
- */
5
+ /** Portrait (height > width) */
17
6
  VERTICAL = 1,
18
- /**
19
- * Indicates that the constraint should always be active,
20
- * regardless of screen orientation.
21
- */
7
+ /** Active in any orientation */
22
8
  ALWAYS = 2
23
9
  }
24
10
  /**
25
- * Resolves an optional orientation to a definite value.
26
- *
27
- * @param orientation - The orientation to resolve, or undefined
28
- * @returns The provided orientation, or ALWAYS if none was provided
11
+ * Resolves optional orientation.
12
+ * @param orientation Orientation to resolve
13
+ * @returns Orientation or ALWAYS if undefined
29
14
  */
30
15
  export declare function resolveOrientation(orientation?: UIOrientation): UIOrientation;