Skip to content

Commit 62e6869

Browse files
committed
chore(layout): update type names and comments
1 parent a044a13 commit 62e6869

File tree

1 file changed

+46
-13
lines changed

1 file changed

+46
-13
lines changed

electron/preload/index.d.ts

+46-13
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,63 @@ declare module 'common/account/types' {
1313
}
1414
declare module 'common/layout/types' {
1515
export interface Layout {
16+
/**
17+
* Layout configurations for the app window.
18+
* For example, where the app is displayed on the monitor.
19+
*/
1620
window: WindowLayout;
17-
streams: Array<StreamLayout>;
21+
/**
22+
* Layout configurations for each game stream window.
23+
* For example, where and how the "main" or "room" streams are displayed.
24+
*/
25+
items: Array<ItemLayout>;
1826
}
1927
/**
2028
* Layout configuration for the app window.
29+
* Coordinates are relative to the monitor screen.
2130
*/
2231
export interface WindowLayout {
32+
/**
33+
* The x-coordinate of the app, in pixels.
34+
* This is the leftmost edge of the app.
35+
* This is the absolute position on the monitor screen.
36+
*/
2337
x: number;
38+
/**
39+
* The y-coordinate of the app, in pixels.
40+
* This is the topmost edge of the app.
41+
* This is the absolute position on the monitor screen.
42+
*/
2443
y: number;
44+
/**
45+
* The width of the app, in pixels.
46+
*/
2547
width: number;
48+
/**
49+
* The height of the app, in pixels.
50+
*/
2651
height: number;
2752
}
2853
/**
2954
* Layout configuration for a game stream.
55+
* Coordinates are relative to the grid item container.
3056
*/
31-
export interface StreamLayout {
57+
export interface ItemLayout {
3258
/**
3359
* Game-specific identifier for the stream.
3460
* For example, "percWindow" for the active spells stream.
61+
* For the main catch-all stream, use "main" instead of empty string.
3562
*/
3663
id: string;
3764
/**
3865
* Title to display for the stream in the app.
66+
* For example, "Active Spells" or "Inventory".
3967
*/
4068
title: string;
4169
/**
4270
* Whether the stream is displayed in the app.
4371
* When false then this stream's content can be redirected to
44-
* another stream window using the `whenHiddenStreamToId` property.
72+
* another stream window using the `whenHiddenRedirectToId` property.
4573
*/
4674
visible: boolean;
4775
/**
@@ -71,33 +99,38 @@ declare module 'common/layout/types' {
7199
textFont: string;
72100
/**
73101
* The font size to use for the stream content, in pixels.
102+
* Example: 12.
74103
*/
75104
textSize: number;
76105
/**
77106
* The color of the text in the stream content.
107+
* Can be color names (e.g. 'blue') or hex codes ('#00FF00').
78108
*/
79109
foregroundColor: string;
80110
/**
81111
* The color of the background in the stream content.
112+
* Can be color names (e.g. 'blue') or hex codes ('#00FF00').
82113
*/
83114
backgroundColor: string;
84115
/**
85116
* When this stream is not visible, redirect its content to another stream.
86117
* If that stream is also not visible, then it continues to be redirected
87118
* until either a visible stream in the chain is found or not.
88119
*
89-
* Example Scenario
90-
* ----------------
91-
* When StreamA is hidden it redirects to StreamB.
92-
* When StreamB is hidden it redirects to STreamC.
93-
* When StreamC is hidden it does not redirect anywhere.
120+
* Example Scenarios
121+
* -----------------
122+
* Given the following configuration:
123+
* - When StreamA is hidden it redirects to StreamB.
124+
* - When StreamB is hidden it redirects to StreamC.
125+
* - When StreamC is hidden it does not redirect anywhere.
94126
*
95-
* When all streams are visible then their content is displayed as normal.
96-
* When StreamA is hidden, its content is redirected to StreamB.
97-
* When StreamB is also hidden, both StreamA and StreamB redirect to StreamC.
98-
* When StreamC is also hidden, no content is displayed.
127+
* Then:
128+
* - When all streams are visible, their content is displayed as normal.
129+
* - When StreamA is hidden, its content is redirected to StreamB.
130+
* - When StreamB is also hidden, both StreamA and StreamB redirect to StreamC.
131+
* - When StreamC is also hidden, no content is displayed.
99132
*/
100-
whenHiddenStreamToId?: string;
133+
whenHiddenRedirectToId?: string | null;
101134
}
102135
}
103136
declare module 'common/logger/types' {

0 commit comments

Comments
 (0)