laymur 0.3.19 → 0.3.21
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/index.js +125 -22
- 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 +10 -2
- package/dist/miscellaneous/resizePolicies.d.ts +29 -9
- package/package.json +1 -1
|
@@ -11,11 +11,19 @@ import { UILayer } from "./UILayer";
|
|
|
11
11
|
* @see {@link UIResizePolicy}
|
|
12
12
|
*/
|
|
13
13
|
export declare class UIFullscreenLayer extends UILayer {
|
|
14
|
-
|
|
14
|
+
private resizePolicyInternal;
|
|
15
15
|
/**
|
|
16
16
|
* Creates a fullscreen layer and sets up window event listeners.
|
|
17
17
|
*/
|
|
18
|
-
constructor();
|
|
18
|
+
constructor(resizePolicy?: UIResizePolicy);
|
|
19
|
+
/**
|
|
20
|
+
* Gets the current resize policy.
|
|
21
|
+
*/
|
|
22
|
+
get resizePolicy(): UIResizePolicy;
|
|
23
|
+
/**
|
|
24
|
+
* Sets a new resize policy. Unsubscribes from old policy and subscribes to new one.
|
|
25
|
+
*/
|
|
26
|
+
set resizePolicy(value: UIResizePolicy);
|
|
19
27
|
/**
|
|
20
28
|
* Removes window event listeners. The layer should not be used after this.
|
|
21
29
|
*/
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { Eventail } from "eventail";
|
|
2
|
+
export declare enum UIResizePolicyEvent {
|
|
3
|
+
CHANGE = 0
|
|
4
|
+
}
|
|
1
5
|
/**
|
|
2
6
|
* Base class for UI resize policies.
|
|
3
7
|
*
|
|
4
8
|
* Calculates scale factors based on viewport dimensions. Different policies
|
|
5
9
|
* implement different scaling strategies.
|
|
6
10
|
*/
|
|
7
|
-
export declare abstract class UIResizePolicy {
|
|
11
|
+
export declare abstract class UIResizePolicy extends Eventail {
|
|
8
12
|
/**
|
|
9
13
|
* Calculates scale factor for given dimensions.
|
|
10
14
|
*
|
|
@@ -27,13 +31,17 @@ export declare class UIResizePolicyNone extends UIResizePolicy {
|
|
|
27
31
|
* Uses different widths for landscape vs portrait orientation.
|
|
28
32
|
*/
|
|
29
33
|
export declare class UIResizePolicyFixedWidth extends UIResizePolicy {
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
private fixedWidthLandscapeInternal;
|
|
35
|
+
private fixedWidthPortraitInternal;
|
|
32
36
|
/**
|
|
33
37
|
* @param fixedWidthLandscape - Target width for landscape (width > height)
|
|
34
38
|
* @param fixedWidthPortrait - Target width for portrait (width <= height)
|
|
35
39
|
*/
|
|
36
40
|
constructor(fixedWidthLandscape: number, fixedWidthPortrait: number);
|
|
41
|
+
get fixedWidthLandscape(): number;
|
|
42
|
+
get fixedWidthPortrait(): number;
|
|
43
|
+
set fixedWidthLandscape(value: number);
|
|
44
|
+
set fixedWidthPortrait(value: number);
|
|
37
45
|
calculateScaleInternal(width: number, height: number): number;
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
@@ -42,38 +50,50 @@ export declare class UIResizePolicyFixedWidth extends UIResizePolicy {
|
|
|
42
50
|
* Uses different heights for landscape vs portrait orientation.
|
|
43
51
|
*/
|
|
44
52
|
export declare class UIResizePolicyFixedHeight extends UIResizePolicy {
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
private fixedHeightLandscapeInternal;
|
|
54
|
+
private fixedHeightPortraitInternal;
|
|
47
55
|
/**
|
|
48
56
|
* @param fixedHeightLandscape - Target height for landscape (width > height)
|
|
49
57
|
* @param fixedHeightPortrait - Target height for portrait (width <= height)
|
|
50
58
|
*/
|
|
51
59
|
constructor(fixedHeightLandscape: number, fixedHeightPortrait: number);
|
|
60
|
+
get fixedHeightLandscape(): number;
|
|
61
|
+
get fixedHeightPortrait(): number;
|
|
62
|
+
set fixedHeightLandscape(value: number);
|
|
63
|
+
set fixedHeightPortrait(value: number);
|
|
52
64
|
calculateScaleInternal(width: number, height: number): number;
|
|
53
65
|
}
|
|
54
66
|
/**
|
|
55
67
|
* Scales by width in landscape, by height in portrait.
|
|
56
68
|
*/
|
|
57
69
|
export declare class UIResizePolicyCross extends UIResizePolicy {
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
private fixedWidthLandscapeInternal;
|
|
71
|
+
private fixedHeightPortraitInternal;
|
|
60
72
|
/**
|
|
61
73
|
* @param fixedWidthLandscape - Target width for landscape
|
|
62
74
|
* @param fixedHeightPortrait - Target height for portrait
|
|
63
75
|
*/
|
|
64
76
|
constructor(fixedWidthLandscape: number, fixedHeightPortrait: number);
|
|
77
|
+
get fixedWidthLandscape(): number;
|
|
78
|
+
get fixedHeightPortrait(): number;
|
|
79
|
+
set fixedWidthLandscape(value: number);
|
|
80
|
+
set fixedHeightPortrait(value: number);
|
|
65
81
|
calculateScaleInternal(width: number, height: number): number;
|
|
66
82
|
}
|
|
67
83
|
/**
|
|
68
84
|
* Scales by height in landscape, by width in portrait.
|
|
69
85
|
*/
|
|
70
86
|
export declare class UIResizePolicyCrossInverted extends UIResizePolicy {
|
|
71
|
-
|
|
72
|
-
|
|
87
|
+
private fixedHeightLandscapeInternal;
|
|
88
|
+
private fixedWidthPortraitInternal;
|
|
73
89
|
/**
|
|
74
90
|
* @param fixedHeightLandscape - Target height for landscape
|
|
75
91
|
* @param fixedWidthPortrait - Target width for portrait
|
|
76
92
|
*/
|
|
77
93
|
constructor(fixedHeightLandscape: number, fixedWidthPortrait: number);
|
|
94
|
+
get fixedHeightLandscape(): number;
|
|
95
|
+
get fixedWidthPortrait(): number;
|
|
96
|
+
set fixedHeightLandscape(value: number);
|
|
97
|
+
set fixedWidthPortrait(value: number);
|
|
78
98
|
calculateScaleInternal(width: number, height: number): number;
|
|
79
99
|
}
|