Skip to content

Commit ddf8ffb

Browse files
hlesemannUJAM-JHpkellettagachuma
authored
🤖 Merge PR DefinitelyTyped#73470 Feature/ge-react-doc by @hlesemann
Co-authored-by: Jan Hörnle <[email protected]> Co-authored-by: Paul Kellett <[email protected]> Co-authored-by: Antony <[email protected]> Co-authored-by: Paul Kellett <[email protected]>
1 parent 2cea858 commit ddf8ffb

34 files changed

+1003
-11
lines changed

types/gorilla-engine/components/AmpEnv.d.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,65 @@
11
declare namespace GorillaEngine.UI {
22
interface AmpItem {
3+
/**
4+
* Sets the color of the respective envelope handle.
5+
* This can be a named color (e.g., "red") or a hexadecimal value (e.g., "FF0000"). To specify an RGBA color set the hex alpha as a prefix (e.g., "80FF0000").
6+
*/
37
color: string;
8+
/**
9+
* Sets the thickness of the respective envelope handle.
10+
*/
411
size: number;
12+
/**
13+
* Sets the corner radius for the respective envelope handle.
14+
*/
515
cornerRadius: number;
16+
/**
17+
* Sets the default value for the respective
18+
*/
619
value: number;
20+
/**
21+
* Sets a value binding for the respective envelope handle.
22+
*/
723
"value&": any;
24+
/**
25+
* Sets the visibility of the respective envelope handle.
26+
* If set to `false`, the handle will not be rendered.
27+
*/
828
visible: boolean;
29+
/**
30+
* Sets the path to the image used for the respective envelope handle.
31+
*/
932
imagePath: string;
33+
/**
34+
* Sets the text displayed on the respective envelope handle.
35+
*/
1036
text: string;
37+
/**
38+
* Sets the color of the text. This can be a named color (e.g., "red") or a hexadecimal value (e.g., "FF0000"). To specify an RGBA color set the hex alpha as a prefix (e.g., "80FF0000").
39+
*/
1140
textColor: string;
1241
}
1342

1443
interface AmpEnvProps extends Common, Bounds, Background, Font {
44+
/**
45+
* Configures the visual properties for the **attack** envelope handle.
46+
*/
1547
attack: Partial<AmpItem>;
48+
/**
49+
* Configures the visual properties for the **decay** envelope handle.
50+
*/
1651
decay: Partial<AmpItem>;
52+
/**
53+
* Configures the visual properties for the **sustain** envelope handle.
54+
*/
1755
sustain: Partial<AmpItem>;
56+
/**
57+
* Configures the visual properties for the **release** envelope handle.
58+
*/
1859
release: Partial<AmpItem>;
60+
/**
61+
* Configures the visual properties for the envelope curve.
62+
*/
1963
curve: Partial<{
2064
color: string;
2165
thickness: number;
Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,61 @@
11
declare namespace GorillaEngine.UI {
22
interface BarStepEditorProps extends Common, Bounds, Background, Clickable {
3-
value: any;
3+
/**
4+
* The spacing between the bars.
5+
*/
46
divSize: number;
57
min: number;
68
max: number;
9+
/**
10+
* The path to the respective script in the instrument.
11+
*/
712
paramPath: string;
13+
/**
14+
* Index of the first
15+
*/
816
startIndex: number;
917
endIndex: number;
10-
step: Partial<{
18+
/**
19+
* The dimension of the step
20+
*/
21+
step: Partial<{
22+
/**
23+
* The horizontal offset of the step relative to its default position
24+
*/
1125
x: number;
26+
/**
27+
* The vertical offset of the step relative to its default position
28+
*/
1229
y: number;
30+
/**
31+
* The width of a step.
32+
*/
1333
width: number;
34+
/**
35+
* The height of a step.
36+
*/
1437
height: number;
38+
/**
39+
* The corner radius of the step.
40+
*/
1541
cornerRadius: number;
42+
borderSizeX: number;
43+
borderSizeY: number;
44+
/**
45+
* The color of the step when it is active.
46+
*/
47+
activeColor: string;
48+
49+
markDefault: boolean;
1650
incrementHeight: number;
1751
backgroundColor: string;
18-
markDefault: boolean;
52+
/**
53+
* The color of the step when it is on.
54+
*/
1955
onColor: string;
56+
/**
57+
* The color of the step when it is off.
58+
*/
2059
offColor: string;
2160
}>;
2261
}
@@ -27,3 +66,4 @@ declare namespace GorillaEngine.UI {
2766
// tslint:disable-next-line:no-empty-interface
2867
interface BarStepEditor extends BarStepEditorProps {}
2968
}
69+

types/gorilla-engine/components/ComboBox.d.ts

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,94 @@ declare namespace GorillaEngine.UI {
66
bottom: number;
77
}
88
interface ComboBoxPopupStyles extends Font {
9+
/**
10+
* The background color of the dropdown popup itself.
11+
*/
912
backgroundColor: string;
13+
/**
14+
* The text color for standard, unselected items within the popup list.
15+
*/
1016
itemTextColor: string;
17+
/**
18+
* The text color for the **single selected item** in the popup list.
19+
*/
1120
itemSelectedTextColor: string;
21+
/**
22+
* The background color for the **single selected item** in the popup list.
23+
*/
1224
itemSelectedBackgroundColor: string;
25+
/**
26+
* The text color for items that are currently highlighted (e.g., by mouse hover or keyboard navigation)
27+
* but not yet selected.
28+
*/
1329
itemHighlightedTextColor: string;
30+
/**
31+
* The background color for items that are currently highlighted (e.g., by mouse hover or keyboard navigation)
32+
* but not yet selected.
33+
*/
1434
itemHighlightedBackgroundColor: string;
35+
/**
36+
* Specifies the alignment of the checkmark icon, indicating the selected item, within the popup.
37+
* It can be positioned either to the `left` or `right` of the item's text.
38+
*/
1539
checkmarkFloat: "left" | "right";
40+
/**
41+
* The radius for the corners of the popup, providing rounded edges.
42+
* A value of `0` results in sharp, square corners.
43+
*/
1644
cornerRadius: number;
17-
padding: ComboBoxPadding | number;
18-
checkmarkPadding: ComboBoxPadding;
45+
/**
46+
* Defines the padding space around the items within the popup.
47+
* This can be a uniform `number` (applying to all sides) or a `ComboBoxPadding` object
48+
* for more granular control over top, right, bottom, and left padding.
49+
*/
50+
padding: ComboBoxPadding | number; // Assuming ComboBoxPadding is defined elsewhere as { top, right, bottom, left }
51+
/**
52+
* Defines the padding specifically for the checkmark icon relative to its containing item.
53+
* This allows for fine-tuning the spacing around the checkmark.
54+
*/
55+
checkmarkPadding: ComboBoxPadding; // Assuming ComboBoxPadding is defined elsewhere as { top, right, bottom, left }
1956
}
2057

2158
interface ComboBoxProps extends Common, Bounds, Background, Clickable, Font, Highlight {
59+
60+
/**
61+
* The value of the combobox, which corresponds to the index of the initially selected item in the `items` array.
62+
*/
2263
value: number;
2364
/**
2465
* List of options
2566
*/
2667
items: string[];
2768
/**
28-
* The character that signifies heirarchy within the items array
69+
* The character that signifies heirarchy within the items array, will open a submenu at the position of the character.
2970
*/
3071
levelSeperator: string;
72+
/**
73+
* If `true`, the text within the combobox will stretch to fit the available width.
74+
*/
3175
stretchText: boolean;
76+
/**
77+
* If `true`, the combobox will allow scrolling through items using the mouse wheel.
78+
*/
3279
scrollWheelEnabled: boolean;
80+
/**
81+
* If true, the combobox will apply a specific style to submenus, which may include different background colors, fonts, or other visual elements.
82+
*/
3383
styleSubmenu: boolean;
84+
85+
/**
86+
* The background color of the combobox trigger in its clicked state (i.e., with its popup open).
87+
*/
3488
backgroundColorClicked: string;
89+
/**
90+
* The background color of the combobox trigger on mouse hover.
91+
*/
3592
backgroundColorHover: string;
93+
94+
/** TODO:: THIS has to be a callback function rather than a string for a view model
95+
* The action to perform when the selected item is selected again from the combobox.
96+
*/
3697
itemReselectedAction: string;
3798
padding: Partial<ComboBoxPadding> | number;
3899
images: Partial<{

types/gorilla-engine/components/Curve.d.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,72 @@
11
declare namespace GorillaEngine.UI {
2+
/**
3+
* TODO:: Is this control even exposed to the user? Or is it part of AmpEnv
4+
*/
25
interface CurveProps extends Common, Bounds, Background, Font, Clickable {
6+
/**
7+
* The value of the curve.
8+
*/
39
value: any;
10+
/**
11+
* The path to the parameter that the curve is bound to.
12+
*/
413
paramPath: string;
14+
/**
15+
* The color of the curve.
16+
*/
517
color: string;
18+
/**
19+
* The thickness of the curve.
20+
*/
621
thickness: number;
22+
/**
23+
* The handle configuration.
24+
*/
725
handle: Partial<{
26+
/**
27+
* The value of the handle.
28+
*/
29+
value: any;
30+
/**
31+
* The color of the handle.
32+
*/
833
color: string;
34+
/**
35+
* The corner radius of the handle.
36+
*/
937
cornerRadius: number;
38+
/**
39+
* The width of the handle.
40+
*/
1041
width: number;
42+
/**
43+
* The height of the handle.
44+
*/
1145
height: number;
46+
/**
47+
* Whether the handle is visible.
48+
*/
1249
visible: boolean;
1350
}>;
51+
/**
52+
* The marking configuration.
53+
*/
1454
marking: Partial<{
55+
/**
56+
* The color of the marking.
57+
*/
1558
color: string;
59+
/**
60+
* The text color of the marking.
61+
*/
1662
textColor: string;
63+
/**
64+
* The thickness of the marking.
65+
*/
1766
thickness: number;
67+
/**
68+
* Whether the marking is visible.
69+
*/
1870
visible: boolean;
1971
}>;
2072
}

types/gorilla-engine/components/Knob.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
declare namespace GorillaEngine.UI {
2+
23
interface KnobProps extends Common, Bounds, Clickable, Background, Skinnable, MIDILearn, Highlight {
4+
/**
5+
* The text displayed for component
6+
*/
37
text: string;
8+
/**
9+
* The minimum value of the knob.
10+
*/
411
min: number;
12+
/**
13+
* The maximum value of the knob.
14+
*/
515
max: number;
16+
/**
17+
* The initial value of the knob, which should be between `min` and `max`.
18+
*/
619
value: number;
20+
/**
21+
* The step size for the knob, which determines how much the value changes with each interaction.
22+
*/
723
stepSize: number;
24+
25+
826
inverted: boolean;
27+
/**
28+
* If `true`, the knob's value can be adjusted using the mouse scroll wheel.
29+
*/
930
scrollWheelEnabled: boolean;
31+
/**
32+
* The path to a single image used for the knob's appearance.
33+
*/
1034
image: string;
35+
/**TODO:: this is rather a slider prop than a knob prop
36+
*
37+
*/
1138
snapsToMousePosition: boolean;
39+
/**
40+
* Sets the minimum rotation angle for the knob image in degrees. Only relevant if `image` is set.
41+
*/
1242
minRotation: number;
43+
/**
44+
* Sets the maximum rotation angle for the knob image in degrees. Only relevant if `image` is set.
45+
*/
1346
maxRotation: number;
1447
}
1548

types/gorilla-engine/components/Label.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
declare namespace GorillaEngine.UI {
22
interface LabelProps extends Common, Bounds, Background, Font, Clickable, Margin, Keyable {
3+
/**
4+
* The initial text to display in the label. Doesn't update at runtime.
5+
*/
36
value: any;
7+
/**
8+
* The text to display in the label. Updates at runtime.
9+
*/
410
text: string | number;
511
format: string;
612
multiLine: boolean;

0 commit comments

Comments
 (0)