Skip to content

Commit 1ff8118

Browse files
committed
chore(layout): update type names and comments
1 parent e17afdd commit 1ff8118

File tree

1 file changed

+46
-13
lines changed

1 file changed

+46
-13
lines changed

electron/common/layout/types.ts

+46-13
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,63 @@
11
export interface Layout {
2+
/**
3+
* Layout configurations for the app window.
4+
* For example, where the app is displayed on the monitor.
5+
*/
26
window: WindowLayout;
3-
streams: Array<StreamLayout>;
7+
/**
8+
* Layout configurations for each game stream window.
9+
* For example, where and how the "main" or "room" streams are displayed.
10+
*/
11+
items: Array<ItemLayout>;
412
}
513

614
/**
715
* Layout configuration for the app window.
16+
* Coordinates are relative to the monitor screen.
817
*/
918
export interface WindowLayout {
19+
/**
20+
* The x-coordinate of the app, in pixels.
21+
* This is the leftmost edge of the app.
22+
* This is the absolute position on the monitor screen.
23+
*/
1024
x: number;
25+
/**
26+
* The y-coordinate of the app, in pixels.
27+
* This is the topmost edge of the app.
28+
* This is the absolute position on the monitor screen.
29+
*/
1130
y: number;
31+
/**
32+
* The width of the app, in pixels.
33+
*/
1234
width: number;
35+
/**
36+
* The height of the app, in pixels.
37+
*/
1338
height: number;
1439
}
1540

1641
/**
1742
* Layout configuration for a game stream.
43+
* Coordinates are relative to the grid item container.
1844
*/
19-
export interface StreamLayout {
45+
export interface ItemLayout {
2046
/**
2147
* Game-specific identifier for the stream.
2248
* For example, "percWindow" for the active spells stream.
49+
* For the main catch-all stream, use "main" instead of empty string.
2350
*/
2451
id: string;
2552
/**
2653
* Title to display for the stream in the app.
54+
* For example, "Active Spells" or "Inventory".
2755
*/
2856
title: string;
2957
/**
3058
* Whether the stream is displayed in the app.
3159
* When false then this stream's content can be redirected to
32-
* another stream window using the `whenHiddenStreamToId` property.
60+
* another stream window using the `whenHiddenRedirectToId` property.
3361
*/
3462
visible: boolean;
3563
/**
@@ -59,31 +87,36 @@ export interface StreamLayout {
5987
textFont: string;
6088
/**
6189
* The font size to use for the stream content, in pixels.
90+
* Example: 12.
6291
*/
6392
textSize: number;
6493
/**
6594
* The color of the text in the stream content.
95+
* Can be color names (e.g. 'blue') or hex codes ('#00FF00').
6696
*/
6797
foregroundColor: string;
6898
/**
6999
* The color of the background in the stream content.
100+
* Can be color names (e.g. 'blue') or hex codes ('#00FF00').
70101
*/
71102
backgroundColor: string;
72103
/**
73104
* When this stream is not visible, redirect its content to another stream.
74105
* If that stream is also not visible, then it continues to be redirected
75106
* until either a visible stream in the chain is found or not.
76107
*
77-
* Example Scenario
78-
* ----------------
79-
* When StreamA is hidden it redirects to StreamB.
80-
* When StreamB is hidden it redirects to STreamC.
81-
* When StreamC is hidden it does not redirect anywhere.
108+
* Example Scenarios
109+
* -----------------
110+
* Given the following configuration:
111+
* - When StreamA is hidden it redirects to StreamB.
112+
* - When StreamB is hidden it redirects to StreamC.
113+
* - When StreamC is hidden it does not redirect anywhere.
82114
*
83-
* When all streams are visible then their content is displayed as normal.
84-
* When StreamA is hidden, its content is redirected to StreamB.
85-
* When StreamB is also hidden, both StreamA and StreamB redirect to StreamC.
86-
* When StreamC is also hidden, no content is displayed.
115+
* Then:
116+
* - When all streams are visible, their content is displayed as normal.
117+
* - When StreamA is hidden, its content is redirected to StreamB.
118+
* - When StreamB is also hidden, both StreamA and StreamB redirect to StreamC.
119+
* - When StreamC is also hidden, no content is displayed.
87120
*/
88-
whenHiddenStreamToId?: string;
121+
whenHiddenRedirectToId?: string | null;
89122
}

0 commit comments

Comments
 (0)