laymur 0.11.4 → 0.11.5
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/dist/constraints/{UIAspectConstraint.Internal.d.ts → UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIAspectConstraint.d.ts → UIAspectConstraint/UIAspectConstraint.d.ts} +2 -2
- package/dist/constraints/{UIHeightConstraint.Internal.d.ts → UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIHeightConstraint.d.ts → UIHeightConstraint/UIHeightConstraint.d.ts} +2 -2
- package/dist/constraints/{UIHorizontalDistanceConstraint.Internal.d.ts → UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIHorizontalDistanceConstraint.d.ts → UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts} +2 -2
- package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
- package/dist/constraints/{UIHorizontalProportionConstraint.Internal.d.ts → UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIHorizontalProportionConstraint.d.ts → UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts} +2 -2
- package/dist/constraints/{UIVerticalDistanceConstraint.Internal.d.ts → UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIVerticalDistanceConstraint.d.ts → UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts} +2 -2
- package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
- package/dist/constraints/{UIVerticalProportionConstraint.Internal.d.ts → UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIVerticalProportionConstraint.d.ts → UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts} +2 -2
- package/dist/constraints/{UIWidthConstraint.Internal.d.ts → UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +1 -1
- package/dist/constraints/{UIWidthConstraint.d.ts → UIWidthConstraint/UIWidthConstraint.d.ts} +2 -2
- package/dist/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +21 -2
- package/dist/constraints/builders/UIConstraint2DBuilder.d.ts +19 -8
- package/dist/constraints/builders/UICoverConstraintBuilder.d.ts +6 -6
- package/dist/constraints/builders/UIFitConstraintBuilder.d.ts +6 -6
- package/dist/elements/UIAnchor/UIAnchor.d.ts +1 -1
- package/dist/elements/UIGraphics/UIGraphics.Internal.d.ts +0 -2
- package/dist/elements/UIGraphics/UIGraphics.d.ts +1 -1
- package/dist/elements/UIImage/UIImage.Internal.d.ts +0 -2
- package/dist/elements/UIImage/UIImage.d.ts +1 -1
- package/dist/elements/UIInputDummy/UIInputDummy.d.ts +1 -1
- package/dist/elements/UIProgress/UIProgress.Internal.d.ts +0 -2
- package/dist/elements/UIProgress/UIProgress.d.ts +2 -2
- package/dist/index.d.ts +9 -7
- package/dist/index.js +667 -180
- 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/UILayer.d.ts +1 -1
- package/dist/miscellaneous/asserts.d.ts +21 -54
- package/dist/miscellaneous/color/UIColor.d.ts +1 -0
- package/dist/miscellaneous/shared.d.ts +46 -0
- package/package.json +6 -3
package/dist/layers/UILayer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Eventail } from "eventail";
|
|
2
2
|
import type { WebGLRenderer } from "three";
|
|
3
|
-
import type { UIPlaneElement } from "../miscellaneous/
|
|
3
|
+
import type { UIPlaneElement } from "../miscellaneous/shared";
|
|
4
4
|
import { UIInputWrapper } from "../wrappers/UIInputWrapper";
|
|
5
5
|
import type { UILayerMode, UILayerOrientation } from "./UILayer.Internal";
|
|
6
6
|
/** Base layer for UI rendering and layout management */
|
|
@@ -1,59 +1,5 @@
|
|
|
1
1
|
import { UILayer } from "../layers/UILayer";
|
|
2
2
|
export declare const EPSILON = 0.000001;
|
|
3
|
-
/** Objects that belong to a UI layer */
|
|
4
|
-
export interface UILayerElement {
|
|
5
|
-
/** The UI layer containing this element */
|
|
6
|
-
readonly layer: UILayer;
|
|
7
|
-
}
|
|
8
|
-
/** UI elements with position in 2D space */
|
|
9
|
-
export interface UIPointElement {
|
|
10
|
-
/** Solver variable for x coordinate */
|
|
11
|
-
readonly xVariable: number;
|
|
12
|
-
/** Solver variable for y coordinate */
|
|
13
|
-
readonly yVariable: number;
|
|
14
|
-
/** X coordinate in world units */
|
|
15
|
-
readonly x: number;
|
|
16
|
-
/** Y coordinate in world units */
|
|
17
|
-
readonly y: number;
|
|
18
|
-
}
|
|
19
|
-
/** UI elements with position and dimensions */
|
|
20
|
-
export interface UIPlaneElement extends UIPointElement {
|
|
21
|
-
/** Solver variable for width */
|
|
22
|
-
readonly wVariable: number;
|
|
23
|
-
/** Solver variable for height */
|
|
24
|
-
readonly hVariable: number;
|
|
25
|
-
/** Width in world units */
|
|
26
|
-
readonly width: number;
|
|
27
|
-
/** Height in world units */
|
|
28
|
-
readonly height: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Checks if object implements UILayerElement.
|
|
32
|
-
* @param obj Object to check
|
|
33
|
-
* @returns True if object has valid layer property
|
|
34
|
-
*/
|
|
35
|
-
export declare function isUILayerElement(obj: unknown): obj is UILayerElement;
|
|
36
|
-
/**
|
|
37
|
-
* Checks if object implements UIPointElement.
|
|
38
|
-
* @param obj Object to check
|
|
39
|
-
* @returns True if object has valid position variables
|
|
40
|
-
*/
|
|
41
|
-
export declare function isUIPointElement(obj: unknown): obj is UIPointElement;
|
|
42
|
-
/**
|
|
43
|
-
* Checks if object implements UIPlaneElement.
|
|
44
|
-
* @param obj Object to check
|
|
45
|
-
* @returns True if object has valid dimension variables
|
|
46
|
-
*/
|
|
47
|
-
export declare function isUIPlaneElement(obj: unknown): obj is UIPlaneElement;
|
|
48
|
-
/**
|
|
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
|
|
55
|
-
*/
|
|
56
|
-
export declare function assertValidConstraintSubjects(a: unknown, b: unknown, subject: string): UILayer;
|
|
57
3
|
/**
|
|
58
4
|
* Validates value is finite number within safe range.
|
|
59
5
|
* @param value Number to validate
|
|
@@ -75,3 +21,24 @@ export declare function assertValidPositiveNumber(value: number, subject: string
|
|
|
75
21
|
* @throws If value is invalid or negative
|
|
76
22
|
*/
|
|
77
23
|
export declare function assertValidNonNegativeNumber(value: number, subject: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Validates constraint arguments are from same layer.
|
|
26
|
+
* @param a First constraint subject
|
|
27
|
+
* @param b Second constraint subject
|
|
28
|
+
* @param subject Constraint name for error messages
|
|
29
|
+
* @returns Common layer for both subjects
|
|
30
|
+
* @throws If subjects are invalid or from different layers
|
|
31
|
+
*/
|
|
32
|
+
export declare function assertValidConstraintArguments(a: unknown, b: unknown, subject: string): UILayer;
|
|
33
|
+
/**
|
|
34
|
+
* Validates interpolation constraint subjects.
|
|
35
|
+
* @param subject Constraint name for error messages
|
|
36
|
+
* @param a First element
|
|
37
|
+
* @param b Second element
|
|
38
|
+
* @param c Element to interpolate
|
|
39
|
+
* @param anchorA Anchor on element A
|
|
40
|
+
* @param anchorB Anchor on element B
|
|
41
|
+
* @returns Common layer for all subjects
|
|
42
|
+
* @throws If subjects violate interpolation constraints
|
|
43
|
+
*/
|
|
44
|
+
export declare function assertValidInterpolationConstraintArguments(subject: string, a: unknown, b: unknown, c: unknown, anchorA: number, anchorB: number): UILayer;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { UILayer } from "../layers/UILayer";
|
|
2
|
+
/** Objects that belong to a UI layer */
|
|
3
|
+
export interface UILayerElement {
|
|
4
|
+
/** The UI layer containing this element */
|
|
5
|
+
readonly layer: UILayer;
|
|
6
|
+
}
|
|
7
|
+
/** UI elements with position in 2D space */
|
|
8
|
+
export interface UIPointElement {
|
|
9
|
+
/** Solver variable for x coordinate */
|
|
10
|
+
readonly xVariable: number;
|
|
11
|
+
/** Solver variable for y coordinate */
|
|
12
|
+
readonly yVariable: number;
|
|
13
|
+
/** X coordinate in world units */
|
|
14
|
+
readonly x: number;
|
|
15
|
+
/** Y coordinate in world units */
|
|
16
|
+
readonly y: number;
|
|
17
|
+
}
|
|
18
|
+
/** UI elements with position and dimensions */
|
|
19
|
+
export interface UIPlaneElement extends UIPointElement {
|
|
20
|
+
/** Solver variable for width */
|
|
21
|
+
readonly wVariable: number;
|
|
22
|
+
/** Solver variable for height */
|
|
23
|
+
readonly hVariable: number;
|
|
24
|
+
/** Width in world units */
|
|
25
|
+
readonly width: number;
|
|
26
|
+
/** Height in world units */
|
|
27
|
+
readonly height: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Checks if object implements UILayerElement.
|
|
31
|
+
* @param obj Object to check
|
|
32
|
+
* @returns True if object has valid layer property
|
|
33
|
+
*/
|
|
34
|
+
export declare function isUILayerElement(obj: unknown): obj is UILayerElement;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if object implements UIPointElement.
|
|
37
|
+
* @param obj Object to check
|
|
38
|
+
* @returns True if object has valid position variables
|
|
39
|
+
*/
|
|
40
|
+
export declare function isUIPointElement(obj: unknown): obj is UIPointElement;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if object implements UIPlaneElement.
|
|
43
|
+
* @param obj Object to check
|
|
44
|
+
* @returns True if object has valid dimension variables
|
|
45
|
+
*/
|
|
46
|
+
export declare function isUIPlaneElement(obj: unknown): obj is UIPlaneElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laymur",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
4
4
|
"description": "Constraint-based UI library for Three.js mobile advertisements",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
"types": "dist/index.d.ts",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
16
|
"import": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
18
|
"development": "./dist/index.js",
|
|
19
19
|
"production": "./dist/index.min.js",
|
|
20
20
|
"default": "./dist/index.min.js"
|
|
21
21
|
},
|
|
22
|
-
"require":
|
|
22
|
+
"require": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.min.js"
|
|
25
|
+
}
|
|
23
26
|
},
|
|
24
27
|
"./package.json": "./package.json"
|
|
25
28
|
},
|