laymur 0.10.2 → 0.11.0
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.
- package/README.md +20 -11
- package/dist/constraints/UIAspectConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIAspectConstraint.d.ts +9 -46
- package/dist/constraints/UIConstraint.d.ts +7 -27
- package/dist/constraints/UICustomConstraint.d.ts +13 -45
- package/dist/constraints/UIHeightConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIHeightConstraint.d.ts +8 -37
- package/dist/constraints/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/constraints/UIHorizontalDistanceConstraint.d.ts +16 -73
- package/dist/constraints/UIHorizontalProportionConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIHorizontalProportionConstraint.d.ts +8 -52
- package/dist/constraints/UISingleParameterConstraint.Internal.d.ts +12 -0
- package/dist/constraints/UISingleParameterConstraint.d.ts +24 -87
- package/dist/constraints/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/constraints/UIVerticalDistanceConstraint.d.ts +12 -73
- package/dist/constraints/UIVerticalProportionConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIVerticalProportionConstraint.d.ts +8 -52
- package/dist/constraints/UIWidthConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIWidthConstraint.d.ts +8 -37
- package/dist/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +45 -0
- package/dist/constraints/builders/UIConstraint2DBuilder.d.ts +35 -0
- package/dist/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/elements/UIAnchor.Internal.d.ts +9 -0
- package/dist/elements/UIAnchor.d.ts +17 -62
- package/dist/elements/UIAnimatedImage.Internal.d.ts +24 -0
- package/dist/elements/UIAnimatedImage.d.ts +38 -100
- package/dist/elements/UIDummy.Internal.d.ts +18 -0
- package/dist/elements/UIDummy.d.ts +51 -63
- package/dist/elements/UIElement.Internal.d.ts +11 -0
- package/dist/elements/UIElement.d.ts +28 -168
- package/dist/elements/UIGraphics.Internal.d.ts +7 -0
- package/dist/elements/UIGraphics.d.ts +29 -99
- package/dist/elements/UIImage.Internal.d.ts +7 -0
- package/dist/elements/UIImage.d.ts +18 -73
- package/dist/elements/UINineSlice.Internal.d.ts +23 -0
- package/dist/elements/UINineSlice.d.ts +45 -0
- package/dist/elements/UIProgress.Internal.d.ts +14 -0
- package/dist/elements/UIProgress.d.ts +26 -152
- package/dist/elements/UIScene.Internal.d.ts +43 -0
- package/dist/elements/UIScene.d.ts +29 -171
- package/dist/elements/UIText/UIText.Interfaces.d.ts +32 -0
- package/dist/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/elements/UIText/UIText.Measuring.d.ts +49 -0
- package/dist/elements/UIText/UIText.Rendering.d.ts +19 -0
- package/dist/elements/UIText/UIText.d.ts +63 -0
- package/dist/index.d.ts +46 -46
- package/dist/index.js +4180 -4006
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layers/UIFullscreenLayer.d.ts +33 -43
- package/dist/layers/UILayer.Internal.d.ts +15 -0
- package/dist/layers/UILayer.d.ts +29 -184
- package/dist/miscellaneous/UIExpression.d.ts +35 -83
- package/dist/miscellaneous/UIInputEvent.d.ts +11 -8
- package/dist/miscellaneous/UIMode.d.ts +19 -21
- package/dist/miscellaneous/UIOrientation.d.ts +7 -22
- package/dist/miscellaneous/UIPriority.d.ts +16 -40
- package/dist/miscellaneous/UIRelation.d.ts +11 -31
- package/dist/miscellaneous/UITransparencyMode.d.ts +4 -21
- package/dist/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/miscellaneous/asserts.d.ts +39 -82
- package/dist/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/miscellaneous/color/UIColor.d.ts +197 -0
- package/dist/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.Internal.d.ts +10 -0
- package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.d.ts +36 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlane.Internal.d.ts +5 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlane.d.ts +23 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.Internal.d.ts +6 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.d.ts +27 -0
- package/dist/miscellaneous/generic-plane/shared.d.ts +22 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/miscellaneous/padding/UIPadding.Internal.d.ts +11 -0
- package/dist/miscellaneous/padding/UIPadding.d.ts +46 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/miscellaneous/text-span/UITextSpan.Internal.d.ts +8 -0
- package/dist/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/miscellaneous/texture/UITextureView.Internal.d.ts +54 -0
- package/dist/miscellaneous/texture/UITextureView.d.ts +61 -0
- package/dist/wrappers/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/wrappers/UIInputWrapper.d.ts +13 -0
- package/dist/wrappers/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/wrappers/UISceneWrapper.d.ts +12 -19
- package/dist/wrappers/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/wrappers/UISolverWrapper.d.ts +2 -1
- package/package.json +3 -1
- package/dist/builders/UIConstraint2DBuilder.d.ts +0 -130
- package/dist/builders/UICoverConstraintBuilder.d.ts +0 -56
- package/dist/builders/UIFitConstraintBuilder.d.ts +0 -56
- package/dist/composer/UIComposer.d.ts +0 -0
- package/dist/composer/UIFullscreenQuad.d.ts +0 -0
- package/dist/composer/UIPass.d.ts +0 -0
- package/dist/elements/UINineSline.d.ts +0 -139
- package/dist/elements/UISpine.d.ts +0 -54
- package/dist/elements/UIText.d.ts +0 -149
- package/dist/miscellaneous/UIColor.d.ts +0 -245
- package/dist/miscellaneous/UIGenericInstancedPlane.d.ts +0 -32
- package/dist/miscellaneous/UIMicro.d.ts +0 -148
- package/dist/miscellaneous/UIMicroAnchorMode.d.ts +0 -9
- package/dist/miscellaneous/UINineSliceBorder.d.ts +0 -21
- package/dist/miscellaneous/UIResizePolicy.d.ts +0 -21
- package/dist/miscellaneous/UIResizePolicyCross.d.ts +0 -14
- package/dist/miscellaneous/UIResizePolicyCrossInverted.d.ts +0 -14
- package/dist/miscellaneous/UIResizePolicyFixedHeight.d.ts +0 -24
- package/dist/miscellaneous/UIResizePolicyFixedWidth.d.ts +0 -27
- package/dist/miscellaneous/UIResizePolicyNone.d.ts +0 -7
- package/dist/miscellaneous/UISceneWrapperClientAPI.d.ts +0 -12
- package/dist/miscellaneous/UITextPadding.d.ts +0 -7
- package/dist/miscellaneous/UITextSpan.d.ts +0 -6
- package/dist/miscellaneous/UITextStyle.d.ts +0 -20
- package/dist/miscellaneous/textInterfaces.d.ts +0 -19
- package/dist/miscellaneous/textTools.d.ts +0 -12
|
@@ -1,56 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Priority levels for UI layout constraints and variables.
|
|
3
|
-
*
|
|
4
|
-
* UIPriority defines a hierarchical system of priority levels used by the
|
|
5
|
-
* constraint solver to determine which constraints should take precedence
|
|
6
|
-
* when conflicts arise. Lower numeric values represent higher priority,
|
|
7
|
-
* with P0 being the highest priority and P7 being the lowest.
|
|
8
|
-
*
|
|
9
|
-
* The priority system maps to Kiwi solver strength values with different
|
|
10
|
-
* strength components (required, strong, medium, weak) to create a nuanced
|
|
11
|
-
* priority hierarchy for layout solving.
|
|
12
|
-
*
|
|
13
|
-
* @see {@link convertPriority} - Converts to Kiwi solver strength values
|
|
14
|
-
*/
|
|
1
|
+
/** Constraint solver priority levels */
|
|
15
2
|
export declare enum UIPriority {
|
|
16
|
-
/** Highest priority
|
|
3
|
+
/** Highest priority */
|
|
17
4
|
P0 = 0,
|
|
18
|
-
/** High priority
|
|
5
|
+
/** High priority */
|
|
19
6
|
P1 = 1,
|
|
20
|
-
/** Medium-high priority
|
|
7
|
+
/** Medium-high priority */
|
|
21
8
|
P2 = 2,
|
|
22
|
-
/** Medium priority
|
|
9
|
+
/** Medium priority */
|
|
23
10
|
P3 = 3,
|
|
24
|
-
/** Medium-low priority
|
|
11
|
+
/** Medium-low priority */
|
|
25
12
|
P4 = 4,
|
|
26
|
-
/** Low priority
|
|
13
|
+
/** Low priority */
|
|
27
14
|
P5 = 5,
|
|
28
|
-
/** Very low priority
|
|
15
|
+
/** Very low priority */
|
|
29
16
|
P6 = 6,
|
|
30
|
-
/** Lowest priority
|
|
17
|
+
/** Lowest priority */
|
|
31
18
|
P7 = 7
|
|
32
19
|
}
|
|
33
20
|
/**
|
|
34
|
-
* Converts
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Higher priority levels get stronger constraint strength values.
|
|
39
|
-
*
|
|
40
|
-
* @param priority - The UI priority level to convert
|
|
41
|
-
* @returns The corresponding Kiwi solver strength value
|
|
42
|
-
* @throws Will throw an error if an invalid priority is provided
|
|
43
|
-
* @see {@link UIPriority} - Priority level definitions
|
|
21
|
+
* Converts priority to solver strength.
|
|
22
|
+
* @param priority Priority level
|
|
23
|
+
* @returns Solver strength value
|
|
24
|
+
* @throws If priority is invalid
|
|
44
25
|
*/
|
|
45
26
|
export declare function convertPriority(priority: UIPriority): number;
|
|
46
27
|
/**
|
|
47
|
-
* Resolves
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* This function is commonly used in constraint creation where priority
|
|
51
|
-
* is an optional parameter.
|
|
52
|
-
*
|
|
53
|
-
* @param priority - The optional priority value to resolve
|
|
54
|
-
* @returns The resolved priority, defaulting to P0 if undefined
|
|
28
|
+
* Resolves optional priority.
|
|
29
|
+
* @param priority Priority to resolve
|
|
30
|
+
* @returns Priority or P0 if undefined
|
|
55
31
|
*/
|
|
56
32
|
export declare function resolvePriority(priority?: UIPriority): UIPriority;
|
|
@@ -1,43 +1,23 @@
|
|
|
1
1
|
import { Operator } from "@lume/kiwi";
|
|
2
|
-
/**
|
|
3
|
-
* Relational operators for UI layout constraints.
|
|
4
|
-
*
|
|
5
|
-
* UIRelation defines the mathematical relationship between the left-hand
|
|
6
|
-
* and right-hand sides of constraint equations. These relations are used
|
|
7
|
-
* by the constraint solver to determine how expressions should be compared
|
|
8
|
-
* when solving layout constraints.
|
|
9
|
-
*
|
|
10
|
-
* @see {@link convertRelation} - Converts to Kiwi solver operators
|
|
11
|
-
*/
|
|
2
|
+
/** Relational operators for constraints */
|
|
12
3
|
export declare enum UIRelation {
|
|
13
|
-
/** Equality
|
|
4
|
+
/** Equality: LHS = RHS */
|
|
14
5
|
EQUAL = 0,
|
|
15
|
-
/** Less than or equal
|
|
6
|
+
/** Less than or equal: LHS ≤ RHS */
|
|
16
7
|
LESS_THAN = 1,
|
|
17
|
-
/** Greater than or equal
|
|
8
|
+
/** Greater than or equal: LHS ≥ RHS */
|
|
18
9
|
GREATER_THAN = 2
|
|
19
10
|
}
|
|
20
11
|
/**
|
|
21
|
-
* Converts
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* constraint equations.
|
|
26
|
-
*
|
|
27
|
-
* @param relation - The UI relation type to convert
|
|
28
|
-
* @returns The corresponding Kiwi solver operator
|
|
29
|
-
* @throws Will throw an error if an invalid relation is provided
|
|
30
|
-
* @see {@link UIRelation} - Relation type definitions
|
|
12
|
+
* Converts relation to solver operator.
|
|
13
|
+
* @param relation Relation type
|
|
14
|
+
* @returns Solver operator
|
|
15
|
+
* @throws If relation is invalid
|
|
31
16
|
*/
|
|
32
17
|
export declare function convertRelation(relation: UIRelation): Operator;
|
|
33
18
|
/**
|
|
34
|
-
* Resolves
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* This function is commonly used in constraint creation where relation
|
|
38
|
-
* is an optional parameter.
|
|
39
|
-
*
|
|
40
|
-
* @param relation - The optional relation value to resolve
|
|
41
|
-
* @returns The resolved relation, defaulting to EQUAL if undefined
|
|
19
|
+
* Resolves optional relation.
|
|
20
|
+
* @param relation Relation to resolve
|
|
21
|
+
* @returns Relation or EQUAL if undefined
|
|
42
22
|
*/
|
|
43
23
|
export declare function resolveRelation(relation?: UIRelation): UIRelation;
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transparency rendering modes for UI elements.
|
|
3
|
-
*
|
|
4
|
-
* Controls how transparent and semi-transparent pixels are handled during rendering.
|
|
5
|
-
* Each mode offers different performance and visual quality trade-offs.
|
|
6
|
-
*/
|
|
1
|
+
/** Transparency rendering modes */
|
|
7
2
|
export declare enum UITransparencyMode {
|
|
8
|
-
/**
|
|
9
|
-
* Clip mode - pixels are either fully opaque or fully transparent.
|
|
10
|
-
* Uses alpha testing to discard pixels below a threshold.
|
|
11
|
-
* Best performance but no smooth transparency gradients.
|
|
12
|
-
*/
|
|
3
|
+
/** Binary transparency. Best performance. */
|
|
13
4
|
CLIP = 0,
|
|
14
|
-
/**
|
|
15
|
-
* Hash mode - dithered transparency using screen-door transparency.
|
|
16
|
-
* Creates transparency illusion through pixel patterns.
|
|
17
|
-
* Good performance with better visual quality than CLIP.
|
|
18
|
-
*/
|
|
5
|
+
/** Dithered transparency. Good performance. */
|
|
19
6
|
HASH = 1,
|
|
20
|
-
/**
|
|
21
|
-
* Blend mode - true alpha blending with smooth transparency.
|
|
22
|
-
* Supports full range of transparency values with smooth gradients.
|
|
23
|
-
* Best visual quality but requires depth sorting and impacts performance.
|
|
24
|
-
*/
|
|
7
|
+
/** Alpha blending. Best quality, requires depth sorting. */
|
|
25
8
|
BLEND = 2
|
|
26
9
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UIArea } from "./UIArea";
|
|
2
|
+
/** Circular interaction area */
|
|
3
|
+
export declare class UIAreaCircle extends UIArea {
|
|
4
|
+
centerX: number;
|
|
5
|
+
centerY: number;
|
|
6
|
+
radius: number;
|
|
7
|
+
/**
|
|
8
|
+
* Creates circular area.
|
|
9
|
+
*
|
|
10
|
+
* @param centerX - Center X in normalized coordinates (0 to 1)
|
|
11
|
+
* @param centerY - Center Y in normalized coordinates (0 to 1)
|
|
12
|
+
* @param radius - Radius in normalized coordinates (0 to 1)
|
|
13
|
+
*/
|
|
14
|
+
constructor(centerX: number, centerY: number, radius: number);
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Vector2Like } from "three";
|
|
2
|
+
import { UIArea } from "./UIArea";
|
|
3
|
+
/** Polygonal interaction area using ray casting */
|
|
4
|
+
export declare class UIAreaPolygon extends UIArea {
|
|
5
|
+
vertices: Vector2Like[];
|
|
6
|
+
/**
|
|
7
|
+
* Creates polygonal area.
|
|
8
|
+
*
|
|
9
|
+
* @param vertices - Vertices in normalized coordinates (0 to 1)
|
|
10
|
+
*/
|
|
11
|
+
constructor(vertices: Vector2Like[]);
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UIArea } from "./UIArea";
|
|
2
|
+
/** Rectangular interaction area */
|
|
3
|
+
export declare class UIAreaRectangle extends UIArea {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
/**
|
|
9
|
+
* Creates rectangular area.
|
|
10
|
+
*
|
|
11
|
+
* @param x - X position in normalized coordinates (0 to 1)
|
|
12
|
+
* @param y - Y position in normalized coordinates (0 to 1)
|
|
13
|
+
* @param width - Width in normalized coordinates (0 to 1)
|
|
14
|
+
* @param height - Height in normalized coordinates (0 to 1)
|
|
15
|
+
*/
|
|
16
|
+
constructor(x: number, y: number, width: number, height: number);
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UIArea } from "./UIArea";
|
|
2
|
+
/** Rectangular interaction area with rounded corners */
|
|
3
|
+
export declare class UIAreaRoundedRectangle extends UIArea {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
radius: number;
|
|
9
|
+
/**
|
|
10
|
+
* Creates rounded rectangular area.
|
|
11
|
+
*
|
|
12
|
+
* Radius clamped to half of smallest dimension.
|
|
13
|
+
*
|
|
14
|
+
* @param x - X position in normalized coordinates (0 to 1)
|
|
15
|
+
* @param y - Y position in normalized coordinates (0 to 1)
|
|
16
|
+
* @param width - Width in normalized coordinates (0 to 1)
|
|
17
|
+
* @param height - Height in normalized coordinates (0 to 1)
|
|
18
|
+
* @param radius - Corner radius in normalized coordinates (0 to 1)
|
|
19
|
+
*/
|
|
20
|
+
constructor(x: number, y: number, width: number, height: number, radius: number);
|
|
21
|
+
}
|
|
@@ -1,120 +1,77 @@
|
|
|
1
1
|
import { UILayer } from "../layers/UILayer";
|
|
2
|
-
/** Small epsilon value for floating-point comparisons and minimum positive number validation. */
|
|
3
2
|
export declare const EPSILON = 0.000001;
|
|
4
|
-
/**
|
|
5
|
-
* Interface for objects that belong to a UI layer.
|
|
6
|
-
*
|
|
7
|
-
* Elements implementing this interface are associated with a specific layer
|
|
8
|
-
* for constraint solving and rendering management.
|
|
9
|
-
*/
|
|
3
|
+
/** Objects that belong to a UI layer */
|
|
10
4
|
export interface UILayerElement {
|
|
11
|
-
/** The UI layer
|
|
5
|
+
/** The UI layer containing this element */
|
|
12
6
|
readonly layer: UILayer;
|
|
13
7
|
}
|
|
14
|
-
/**
|
|
15
|
-
* Interface for UI elements that have a position in 2D space.
|
|
16
|
-
*
|
|
17
|
-
* Point elements are characterized by x and y coordinates represented
|
|
18
|
-
* as solver variable descriptors for constraint-based positioning.
|
|
19
|
-
*/
|
|
8
|
+
/** UI elements with position in 2D space */
|
|
20
9
|
export interface UIPointElement {
|
|
21
|
-
/** Solver variable
|
|
10
|
+
/** Solver variable for x coordinate */
|
|
22
11
|
readonly xVariable: number;
|
|
23
|
-
/** Solver variable
|
|
12
|
+
/** Solver variable for y coordinate */
|
|
24
13
|
readonly yVariable: number;
|
|
25
|
-
/**
|
|
14
|
+
/** X coordinate in world units */
|
|
26
15
|
readonly x: number;
|
|
27
|
-
/**
|
|
16
|
+
/** Y coordinate in world units */
|
|
28
17
|
readonly y: number;
|
|
29
18
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Interface for UI elements that have both position and dimensions in 2D space.
|
|
32
|
-
*
|
|
33
|
-
* Plane elements extend point elements with width and height properties,
|
|
34
|
-
* enabling rectangular area constraints and positioning.
|
|
35
|
-
*/
|
|
19
|
+
/** UI elements with position and dimensions */
|
|
36
20
|
export interface UIPlaneElement extends UIPointElement {
|
|
37
|
-
/** Solver variable
|
|
21
|
+
/** Solver variable for width */
|
|
38
22
|
readonly wVariable: number;
|
|
39
|
-
/** Solver variable
|
|
23
|
+
/** Solver variable for height */
|
|
40
24
|
readonly hVariable: number;
|
|
41
|
-
/**
|
|
25
|
+
/** Width in world units */
|
|
42
26
|
readonly width: number;
|
|
43
|
-
/**
|
|
27
|
+
/** Height in world units */
|
|
44
28
|
readonly height: number;
|
|
45
29
|
}
|
|
46
30
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
* @returns True if the object has a valid layer property, false otherwise
|
|
31
|
+
* Checks if object implements UILayerElement.
|
|
32
|
+
* @param obj Object to check
|
|
33
|
+
* @returns True if object has valid layer property
|
|
51
34
|
*/
|
|
52
35
|
export declare function isUILayerElement(obj: unknown): obj is UILayerElement;
|
|
53
36
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @
|
|
57
|
-
* @returns True if the object has valid xVariable and yVariable properties, false otherwise
|
|
37
|
+
* Checks if object implements UIPointElement.
|
|
38
|
+
* @param obj Object to check
|
|
39
|
+
* @returns True if object has valid position variables
|
|
58
40
|
*/
|
|
59
41
|
export declare function isUIPointElement(obj: unknown): obj is UIPointElement;
|
|
60
42
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* should also satisfy UIPointElement requirements for complete validation.
|
|
65
|
-
*
|
|
66
|
-
* @param obj - The object to check
|
|
67
|
-
* @returns True if the object has valid wVariable and hVariable properties, false otherwise
|
|
43
|
+
* Checks if object implements UIPlaneElement.
|
|
44
|
+
* @param obj Object to check
|
|
45
|
+
* @returns True if object has valid dimension variables
|
|
68
46
|
*/
|
|
69
47
|
export declare function isUIPlaneElement(obj: unknown): obj is UIPlaneElement;
|
|
70
48
|
/**
|
|
71
|
-
* Validates
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @param a - The first constraint subject
|
|
78
|
-
* @param b - The second constraint subject
|
|
79
|
-
* @param subject - The name of the constraint for error messages
|
|
80
|
-
* @returns The common layer that both subjects belong to
|
|
81
|
-
* @throws Will throw an error if subjects are invalid or from different layers
|
|
49
|
+
* Validates constraint subjects are from same layer.
|
|
50
|
+
* @param a First constraint subject
|
|
51
|
+
* @param b Second constraint subject
|
|
52
|
+
* @param subject Constraint name for error messages
|
|
53
|
+
* @returns Common layer for both subjects
|
|
54
|
+
* @throws If subjects are invalid or from different layers
|
|
82
55
|
*/
|
|
83
56
|
export declare function assertValidConstraintSubjects(a: unknown, b: unknown, subject: string): UILayer;
|
|
84
57
|
/**
|
|
85
|
-
* Validates
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @param value - The number to validate
|
|
91
|
-
* @param subject - The name of the value for error messages
|
|
92
|
-
* @throws Will throw an error if the value is not finite or exceeds safe range
|
|
58
|
+
* Validates value is finite number within safe range.
|
|
59
|
+
* @param value Number to validate
|
|
60
|
+
* @param subject Value name for error messages
|
|
61
|
+
* @throws If value is not finite or exceeds safe range
|
|
93
62
|
*/
|
|
94
63
|
export declare function assertValidNumber(value: number, subject: string): void;
|
|
95
64
|
/**
|
|
96
|
-
* Validates
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* with very small positive values.
|
|
101
|
-
*
|
|
102
|
-
* @param value - The number to validate
|
|
103
|
-
* @param subject - The name of the value for error messages
|
|
104
|
-
* @throws Will throw an error if the value is invalid or not sufficiently positive
|
|
105
|
-
* @see {@link assertValidNumber}
|
|
65
|
+
* Validates value is positive (>= EPSILON).
|
|
66
|
+
* @param value Number to validate
|
|
67
|
+
* @param subject Value name for error messages
|
|
68
|
+
* @throws If value is invalid or below EPSILON
|
|
106
69
|
*/
|
|
107
70
|
export declare function assertValidPositiveNumber(value: number, subject: string): void;
|
|
108
71
|
/**
|
|
109
|
-
* Validates
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* function allows zero as a valid value.
|
|
114
|
-
*
|
|
115
|
-
* @param value - The number to validate
|
|
116
|
-
* @param subject - The name of the value for error messages
|
|
117
|
-
* @throws Will throw an error if the value is invalid or negative
|
|
118
|
-
* @see {@link assertValidNumber}
|
|
72
|
+
* Validates value is non-negative (>= 0).
|
|
73
|
+
* @param value Number to validate
|
|
74
|
+
* @param subject Value name for error messages
|
|
75
|
+
* @throws If value is invalid or negative
|
|
119
76
|
*/
|
|
120
77
|
export declare function assertValidNonNegativeNumber(value: number, subject: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Color } from "three";
|
|
2
|
+
import type { UIColor } from "./UIColor";
|
|
3
|
+
/** Color configuration as Three.js Color, hex number, hex string, or UIColor */
|
|
4
|
+
export type UIColorConfig = Color | number | string | UIColor;
|
|
5
|
+
/** Predefined color names */
|
|
6
|
+
export type UIColorName = "black" | "white" | "red" | "green" | "blue" | "yellow" | "cyan" | "magenta" | "gray" | "grey" | "silver" | "maroon" | "olive" | "lime" | "aqua" | "teal" | "navy" | "fuchsia" | "purple" | "orange" | "pink" | "brown" | "gold" | "violet" | "indigo" | "coral" | "salmon" | "khaki" | "plum" | "orchid" | "tan" | "beige" | "mint" | "lavender" | "crimson" | "azure" | "ivory" | "snow";
|
|
7
|
+
export declare const COLORS: Record<string, number | undefined>;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Color, Vector4 } from "three";
|
|
2
|
+
import type { UIColorConfig, UIColorName } from "./UIColor.Internal";
|
|
3
|
+
/** RGBA color with RGB, HSL, hex, and named color support */
|
|
4
|
+
export declare class UIColor {
|
|
5
|
+
private rInternal;
|
|
6
|
+
private gInternal;
|
|
7
|
+
private bInternal;
|
|
8
|
+
private aInternal;
|
|
9
|
+
private hInternal;
|
|
10
|
+
private sInternal;
|
|
11
|
+
private lInternal;
|
|
12
|
+
private dirtyInternal;
|
|
13
|
+
private rgbDirty;
|
|
14
|
+
private hslDirty;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* @param r - Red (0-1)
|
|
18
|
+
* @param g - Green (0-1)
|
|
19
|
+
* @param b - Blue (0-1)
|
|
20
|
+
* @param a - Alpha (0-1)
|
|
21
|
+
*/
|
|
22
|
+
constructor(r: number, g: number, b: number, a?: number);
|
|
23
|
+
/**
|
|
24
|
+
* @param colorName - Named color
|
|
25
|
+
* @param a - Alpha (0-1)
|
|
26
|
+
*/
|
|
27
|
+
constructor(colorName: UIColorName, a?: number);
|
|
28
|
+
/**
|
|
29
|
+
* @param threeColor - Three.js Color object
|
|
30
|
+
* @param a - Alpha (0-1)
|
|
31
|
+
*/
|
|
32
|
+
constructor(threeColor: Color, a?: number);
|
|
33
|
+
/**
|
|
34
|
+
* @param hexRGB - Hex RGB value (e.g., 0xff0000)
|
|
35
|
+
* @param a - Alpha (0-1)
|
|
36
|
+
*/
|
|
37
|
+
constructor(hexRGB: number, a?: number);
|
|
38
|
+
/**
|
|
39
|
+
* @param hexString - Hex string (e.g., "#ffffff" or "#ffffffff")
|
|
40
|
+
*/
|
|
41
|
+
constructor(hexString?: string);
|
|
42
|
+
/**
|
|
43
|
+
* @param uiColor - UIColor object to copy from
|
|
44
|
+
*/
|
|
45
|
+
constructor(uiColor?: UIColor);
|
|
46
|
+
/**
|
|
47
|
+
* @param uiColorConfig - UIColorConfig object
|
|
48
|
+
*/
|
|
49
|
+
constructor(uiColorConfig?: UIColorConfig);
|
|
50
|
+
/** Black (0x000000) */
|
|
51
|
+
static get black(): UIColor;
|
|
52
|
+
/** White (0xffffff) */
|
|
53
|
+
static get white(): UIColor;
|
|
54
|
+
/** Red (0xff0000) */
|
|
55
|
+
static get red(): UIColor;
|
|
56
|
+
/** Green (0x008000) */
|
|
57
|
+
static get green(): UIColor;
|
|
58
|
+
/** Blue (0x0000ff) */
|
|
59
|
+
static get blue(): UIColor;
|
|
60
|
+
/** Yellow (0xffff00) */
|
|
61
|
+
static get yellow(): UIColor;
|
|
62
|
+
/** Cyan (0x00ffff) */
|
|
63
|
+
static get cyan(): UIColor;
|
|
64
|
+
/** Magenta (0xff00ff) */
|
|
65
|
+
static get magenta(): UIColor;
|
|
66
|
+
/** Gray (0x808080) */
|
|
67
|
+
static get gray(): UIColor;
|
|
68
|
+
/** Grey (0x808080) */
|
|
69
|
+
static get grey(): UIColor;
|
|
70
|
+
/** Silver (0xc0c0c0) */
|
|
71
|
+
static get silver(): UIColor;
|
|
72
|
+
/** Maroon (0x800000) */
|
|
73
|
+
static get maroon(): UIColor;
|
|
74
|
+
/** Olive (0x808000) */
|
|
75
|
+
static get olive(): UIColor;
|
|
76
|
+
/** Lime (0x00ff00) */
|
|
77
|
+
static get lime(): UIColor;
|
|
78
|
+
/** Aqua (0x00ffff) */
|
|
79
|
+
static get aqua(): UIColor;
|
|
80
|
+
/** Teal (0x008080) */
|
|
81
|
+
static get teal(): UIColor;
|
|
82
|
+
/** Navy (0x000080) */
|
|
83
|
+
static get navy(): UIColor;
|
|
84
|
+
/** Fuchsia (0xff00ff) */
|
|
85
|
+
static get fuchsia(): UIColor;
|
|
86
|
+
/** Purple (0x800080) */
|
|
87
|
+
static get purple(): UIColor;
|
|
88
|
+
/** Orange (0xffa500) */
|
|
89
|
+
static get orange(): UIColor;
|
|
90
|
+
/** Pink (0xffc0cb) */
|
|
91
|
+
static get pink(): UIColor;
|
|
92
|
+
/** Brown (0xa52a2a) */
|
|
93
|
+
static get brown(): UIColor;
|
|
94
|
+
/** Gold (0xffd700) */
|
|
95
|
+
static get gold(): UIColor;
|
|
96
|
+
/** Violet (0xee82ee) */
|
|
97
|
+
static get violet(): UIColor;
|
|
98
|
+
/** Indigo (0x4b0082) */
|
|
99
|
+
static get indigo(): UIColor;
|
|
100
|
+
/** Coral (0xff7f50) */
|
|
101
|
+
static get coral(): UIColor;
|
|
102
|
+
/** Salmon (0xfa8072) */
|
|
103
|
+
static get salmon(): UIColor;
|
|
104
|
+
/** Khaki (0xf0e68c) */
|
|
105
|
+
static get khaki(): UIColor;
|
|
106
|
+
/** Plum (0xdda0dd) */
|
|
107
|
+
static get plum(): UIColor;
|
|
108
|
+
/** Orchid (0xda70d6) */
|
|
109
|
+
static get orchid(): UIColor;
|
|
110
|
+
/** Tan (0xd2b48c) */
|
|
111
|
+
static get tan(): UIColor;
|
|
112
|
+
/** Beige (0xf5f5dc) */
|
|
113
|
+
static get beige(): UIColor;
|
|
114
|
+
/** Mint (0x98fb98) */
|
|
115
|
+
static get mint(): UIColor;
|
|
116
|
+
/** Lavender (0xe6e6fa) */
|
|
117
|
+
static get lavender(): UIColor;
|
|
118
|
+
/** Crimson (0xdc143c) */
|
|
119
|
+
static get crimson(): UIColor;
|
|
120
|
+
/** Azure (0xf0ffff) */
|
|
121
|
+
static get azure(): UIColor;
|
|
122
|
+
/** Ivory (0xfffff0) */
|
|
123
|
+
static get ivory(): UIColor;
|
|
124
|
+
/** Snow (0xfffafa) */
|
|
125
|
+
static get snow(): UIColor;
|
|
126
|
+
/** Red component (0 to 1) */
|
|
127
|
+
get r(): number;
|
|
128
|
+
/** Green component (0 to 1) */
|
|
129
|
+
get g(): number;
|
|
130
|
+
/** Blue component (0 to 1) */
|
|
131
|
+
get b(): number;
|
|
132
|
+
/** Alpha component (0 to 1) */
|
|
133
|
+
get a(): number;
|
|
134
|
+
/** Hue component (0 to 360) */
|
|
135
|
+
get hue(): number;
|
|
136
|
+
/** Saturation component (0 to 1) */
|
|
137
|
+
get saturation(): number;
|
|
138
|
+
/** Lightness component (0 to 1) */
|
|
139
|
+
get lightness(): number;
|
|
140
|
+
/** Red component (0 to 1) */
|
|
141
|
+
set r(value: number);
|
|
142
|
+
/** Green component (0 to 1) */
|
|
143
|
+
set g(value: number);
|
|
144
|
+
/** Blue component (0 to 1) */
|
|
145
|
+
set b(value: number);
|
|
146
|
+
/** Alpha component (0 to 1) */
|
|
147
|
+
set a(value: number);
|
|
148
|
+
/** Hue component (0 to 360) */
|
|
149
|
+
set hue(value: number);
|
|
150
|
+
/** Saturation component (0 to 1) */
|
|
151
|
+
set saturation(value: number);
|
|
152
|
+
/** Lightness component (0 to 1) */
|
|
153
|
+
set lightness(value: number);
|
|
154
|
+
/** Sets RGB(A) components */
|
|
155
|
+
set(r: number, g: number, b: number, a?: number): this;
|
|
156
|
+
/** Returns RGBA as 32-bit hex (RRGGBBAA) */
|
|
157
|
+
getHexRGBA(): number;
|
|
158
|
+
/** Returns RGB as 24-bit hex (RRGGBB) */
|
|
159
|
+
getHexRGB(): number;
|
|
160
|
+
/** Returns RGB as hex string ("#ffffff") */
|
|
161
|
+
getHexStringRGB(): string;
|
|
162
|
+
/** Returns RGBA as hex string ("#ffffffff") */
|
|
163
|
+
getHexStringRGBA(): string;
|
|
164
|
+
/** Sets from 32-bit hex RGBA (RRGGBBAA) */
|
|
165
|
+
setHexRGBA(hex: number): this;
|
|
166
|
+
/** Sets from 24-bit hex RGB (RRGGBB) */
|
|
167
|
+
setHexRGB(hex: number, a?: number): this;
|
|
168
|
+
/**
|
|
169
|
+
* Sets from hex string.
|
|
170
|
+
*
|
|
171
|
+
* @param hexString - Format: "#ffffff" or "#ffffffff"
|
|
172
|
+
* @throws If format invalid
|
|
173
|
+
*/
|
|
174
|
+
setHexString(hexString: string): this;
|
|
175
|
+
/** Sets from HSL values */
|
|
176
|
+
setHSL(h: number, s: number, l: number, a?: number): this;
|
|
177
|
+
/**
|
|
178
|
+
* Sets from predefined name.
|
|
179
|
+
*
|
|
180
|
+
* @throws If color name unknown
|
|
181
|
+
*/
|
|
182
|
+
setColorName(colorName: UIColorName, a?: number): this;
|
|
183
|
+
/** Sets from linear (GLSL) color space */
|
|
184
|
+
setGLSLColor(r: number, g: number, b: number, a?: number): this;
|
|
185
|
+
/** Sets from Three.js Color */
|
|
186
|
+
setThreeColor(threeColor: Color, a?: number): this;
|
|
187
|
+
/** Returns CSS color string ("rgba(255, 0, 0, 1)") */
|
|
188
|
+
toCSSColor(): string;
|
|
189
|
+
/** Converts to linear (GLSL) color space */
|
|
190
|
+
toGLSLColor(result?: Vector4): Vector4;
|
|
191
|
+
/** Converts to Three.js Color (without alpha) */
|
|
192
|
+
toThreeColor(result?: Color): Color;
|
|
193
|
+
/** Copies from another color */
|
|
194
|
+
copy(color: UIColor | Color): this;
|
|
195
|
+
/** Returns copy of this color */
|
|
196
|
+
clone(): UIColor;
|
|
197
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Matrix4 } from "three";
|
|
2
|
+
import { UIMicroAnchorMode } from "../miscellaneous/micro/UIMicro.Internal";
|
|
3
|
+
/**
|
|
4
|
+
* Computes element transform matrix.
|
|
5
|
+
* @returns Transform matrix (reused, do not store reference)
|
|
6
|
+
*/
|
|
7
|
+
export declare function computeTransformMatrix(x: number, y: number, width: number, height: number, zIndex: number, microX: number, microY: number, microAnchorX: number, microAnchorY: number, microScaleX: number, microScaleY: number, microRotation: number, microAnchorMode: UIMicroAnchorMode): Matrix4;
|
|
8
|
+
/**
|
|
9
|
+
* Computes transform matrix for trimmed sprite.
|
|
10
|
+
* @param width Source width including trimmed areas
|
|
11
|
+
* @param height Source height including trimmed areas
|
|
12
|
+
* @param trimLeft Pixels trimmed from left
|
|
13
|
+
* @param trimRight Pixels trimmed from right
|
|
14
|
+
* @param trimTop Pixels trimmed from top
|
|
15
|
+
* @param trimBottom Pixels trimmed from bottom
|
|
16
|
+
* @returns Transform matrix (reused, do not store reference)
|
|
17
|
+
*/
|
|
18
|
+
export declare function computeTrimmedTransformMatrix(x: number, y: number, width: number, height: number, zIndex: number, microX: number, microY: number, microAnchorX: number, microAnchorY: number, microScaleX: number, microScaleY: number, microRotation: number, microAnchorMode: UIMicroAnchorMode, trimLeft: number, trimRight: number, trimTop: number, trimBottom: number): Matrix4;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InstancedBufferAttribute, InstancedBufferGeometry, ShaderMaterial } from "three";
|
|
2
|
+
import { UITransparencyMode } from "../UITransparencyMode";
|
|
3
|
+
import type { UIPropertyType } from "./shared";
|
|
4
|
+
export declare const INSTANCED_PLANE_GEOMETRY: InstancedBufferGeometry;
|
|
5
|
+
export declare const CAPACITY_STEP = 4;
|
|
6
|
+
export declare function writePropertyToArray(value: UIPropertyType, array: Float32Array, offset: number): void;
|
|
7
|
+
export declare function writeInstanceDefaults(visibilityArray: Float32Array, transformArray: Float32Array, index: number): void;
|
|
8
|
+
export declare function buildEmptyInstancedBufferAttribute(value: UIPropertyType, capacity: number): InstancedBufferAttribute;
|
|
9
|
+
export declare function buildMaterial(source: string, uniformProperties: Record<string, UIPropertyType>, varyingProperties: Record<string, UIPropertyType>, transparency: UITransparencyMode): ShaderMaterial;
|
|
10
|
+
export declare function reconstructValue(referenceValue: UIPropertyType, array: Float32Array, offset: number): UIPropertyType;
|