swing-ui 0.1.25 → 1.0.1

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.
Files changed (116) hide show
  1. package/LICENSE +5 -4
  2. package/README.md +144 -7
  3. package/SwingUI.js +2611 -0
  4. package/classes/Arc.js +185 -0
  5. package/classes/Button.js +55 -0
  6. package/classes/CheckBox.js +33 -0
  7. package/classes/CheckBoxMenuItem.js +24 -0
  8. package/classes/ComboBox.js +329 -0
  9. package/classes/ComponentContainer.js +828 -0
  10. package/classes/ContextMenu.js +141 -0
  11. package/classes/DocumentEditor.js +168 -0
  12. package/classes/Ellipse.js +76 -0
  13. package/classes/InternalWindow.js +397 -0
  14. package/classes/InternalWindowContainer.js +93 -0
  15. package/classes/Label.js +52 -0
  16. package/classes/Line.js +105 -0
  17. package/classes/List.js +452 -0
  18. package/classes/MediaPlayer.js +504 -0
  19. package/classes/Menu.js +74 -0
  20. package/classes/MenuBar.js +56 -0
  21. package/classes/MenuItem.js +92 -0
  22. package/classes/Panel.js +50 -0
  23. package/classes/PasswordField.js +47 -0
  24. package/classes/Polygon.js +236 -0
  25. package/classes/Polyline.js +240 -0
  26. package/classes/ProgressBar.js +62 -0
  27. package/classes/RadioButton.js +110 -0
  28. package/classes/RadioButtonMenuItem.js +106 -0
  29. package/classes/Rectangle.js +199 -0
  30. package/classes/ScrollPane.js +53 -0
  31. package/classes/ScrollableComponent.js +141 -0
  32. package/classes/Separator.js +24 -0
  33. package/classes/Shape.js +584 -0
  34. package/classes/ShapeContainer.js +231 -0
  35. package/classes/Slider.js +172 -0
  36. package/classes/Spinner.js +172 -0
  37. package/classes/SplitView.js +82 -0
  38. package/classes/Stroke.js +115 -0
  39. package/classes/Table.js +982 -0
  40. package/classes/Tabs.js +228 -0
  41. package/classes/TextArea.js +125 -0
  42. package/classes/TextComponent.js +207 -0
  43. package/classes/TextField.js +128 -0
  44. package/classes/TextShape.js +123 -0
  45. package/classes/ToggleButton.js +147 -0
  46. package/classes/ToolBar.js +120 -0
  47. package/classes/TrayIcon.js +54 -0
  48. package/classes/Tree.js +569 -0
  49. package/classes/UIComponent.js +2113 -0
  50. package/classes/Window.js +609 -0
  51. package/enums.js +298 -0
  52. package/fonts.conf +32 -0
  53. package/functions.js +254 -0
  54. package/icon.png +0 -0
  55. package/index.js +109 -4
  56. package/jar/gui-11.jar +0 -0
  57. package/jar/lib/flatlaf.jar +0 -0
  58. package/jar/lib/jna.jar +0 -0
  59. package/package.json +58 -33
  60. package/typedefs.js +973 -0
  61. package/types/SwingUI.d.ts +727 -0
  62. package/types/classes/Arc.d.ts +111 -0
  63. package/types/classes/Button.d.ts +38 -0
  64. package/types/classes/CheckBox.d.ts +22 -0
  65. package/types/classes/CheckBoxMenuItem.d.ts +18 -0
  66. package/types/classes/ComboBox.d.ts +172 -0
  67. package/types/classes/ComponentContainer.d.ts +131 -0
  68. package/types/classes/ContextMenu.d.ts +74 -0
  69. package/types/classes/DocumentEditor.d.ts +95 -0
  70. package/types/classes/Ellipse.d.ts +34 -0
  71. package/types/classes/InternalWindow.d.ts +163 -0
  72. package/types/classes/InternalWindowContainer.d.ts +36 -0
  73. package/types/classes/Label.d.ts +33 -0
  74. package/types/classes/Line.d.ts +48 -0
  75. package/types/classes/List.d.ts +223 -0
  76. package/types/classes/MediaPlayer.d.ts +381 -0
  77. package/types/classes/Menu.d.ts +43 -0
  78. package/types/classes/MenuBar.d.ts +26 -0
  79. package/types/classes/MenuItem.d.ts +57 -0
  80. package/types/classes/Panel.d.ts +28 -0
  81. package/types/classes/PasswordField.d.ts +22 -0
  82. package/types/classes/Polygon.d.ts +93 -0
  83. package/types/classes/Polyline.d.ts +96 -0
  84. package/types/classes/ProgressBar.d.ts +36 -0
  85. package/types/classes/RadioButton.d.ts +70 -0
  86. package/types/classes/RadioButtonMenuItem.d.ts +71 -0
  87. package/types/classes/Rectangle.d.ts +82 -0
  88. package/types/classes/ScrollPane.d.ts +23 -0
  89. package/types/classes/ScrollableComponent.d.ts +81 -0
  90. package/types/classes/Separator.d.ts +14 -0
  91. package/types/classes/Shape.d.ts +223 -0
  92. package/types/classes/ShapeContainer.d.ts +92 -0
  93. package/types/classes/Slider.d.ts +107 -0
  94. package/types/classes/Spinner.d.ts +129 -0
  95. package/types/classes/SplitView.d.ts +47 -0
  96. package/types/classes/Stroke.d.ts +99 -0
  97. package/types/classes/Table.d.ts +652 -0
  98. package/types/classes/Tabs.d.ts +118 -0
  99. package/types/classes/TextArea.d.ts +45 -0
  100. package/types/classes/TextComponent.d.ts +136 -0
  101. package/types/classes/TextField.d.ts +94 -0
  102. package/types/classes/TextShape.d.ts +73 -0
  103. package/types/classes/ToggleButton.d.ts +84 -0
  104. package/types/classes/ToolBar.d.ts +82 -0
  105. package/types/classes/TrayIcon.d.ts +43 -0
  106. package/types/classes/Tree.d.ts +354 -0
  107. package/types/classes/UIComponent.d.ts +945 -0
  108. package/types/classes/Window.d.ts +334 -0
  109. package/types/enums.d.ts +437 -0
  110. package/types/functions.d.ts +109 -0
  111. package/types/index.d.ts +188 -0
  112. package/types/typedefs.d.ts +1626 -0
  113. package/ui-process-manager.js +317 -0
  114. package/video-devices-linux.sh +72 -0
  115. package/video-devices-mac.sh +33 -0
  116. package/CHANGES.md +0 -3
package/typedefs.js ADDED
@@ -0,0 +1,973 @@
1
+ /**
2
+ * Type definitions
3
+ */
4
+
5
+ // region Event objects
6
+
7
+ /**
8
+ * An error event object received by the {@link UIComponent#onError|onError()} handler callback when error occurs.
9
+ *
10
+ * @typedef {Object} ErrorEvent
11
+ * @property {object} target - The component that triggered the event.
12
+ * @property {string} messsage - An error message.
13
+ *
14
+ * @see {@link UIComponent#onError|onError()}
15
+ */
16
+
17
+ /**
18
+ * A dispose event object received by the {@link UIComponent#onDispose|onDispose()} handler callback when a component gets disposed.
19
+ *
20
+ * @typedef {Object} DisposeEvent
21
+ * @property {object} target - The component that triggered the event.
22
+ *
23
+ * @see {@link UIComponent#onDispose|onDispose()}
24
+ */
25
+
26
+ /**
27
+ * Drop event received by the {@link UIComponent#onDropEvents|onDropEvents()} handler callback.
28
+ *
29
+ * @typedef {Object} DropEvent
30
+ * @property {object} target - The component that triggered the event.
31
+ * @property {object} [source] - The component being dragged onto this component.
32
+ * Present only for component-to-component dragging, and when `DataType.Components` is allowed for dropping.
33
+ * @property {object} [overComponent] - Descendent of the target component over which the event occurred. Only present for event types `dragover` and `drop`, if target is a container and the event occurred over one of target'a descendent.
34
+ * @property {string} type - One of `dragenter`, `dragover`, `dragleave`, `drop`.
35
+ * @property {string} [action] - One of the values of enum DragDropAction. Present when applicable.
36
+ * @property {object} [data] - Contains the data being dragged/dropped. NOTE: On macOS data is actually present only when type is `drop`, otherwise data types are present, but data is set to `null`.
37
+ * @property {number} [x] - X position of the pointer relative to this component. Present when type is `dragstart` or `drop`.
38
+ * @property {number} [y] - Y position of the pointer relative to this component. Present when type is `dragstart` or `drop`.
39
+ * @property {number} [screenX] - X position of the pointer relative to the screen. Present when type is `dragstart` or `drop`.
40
+ * @property {number} [screenY] - Y position of the pointer relative to the screen. Present when type is `dragstart` or `drop`.
41
+ * @property {number[]} [selected] - Selected indexes of a `List` component whose items are being dragged. Present only when dragging List items.
42
+ *
43
+ * @see {@link UIComponent#onDropEvents|onDropEvents()}
44
+ */
45
+
46
+ /**
47
+ * Drag event received by the {@link UIComponent#onDragEvents|onDragEvents()} handler callback.
48
+ *
49
+ * @typedef {Object} DragEvent
50
+ * @property {object} target - The component that triggered the event.
51
+ * @property {string} type - One of `dragstart`, `dragend`, `drag`, `cancel`.
52
+ * @property {string} [action] - One of the values of enum DragDropAction. Present when applicable.
53
+ * @property {number} [x] - X position of the pointer relative to this component. Present when type is `dragstart` or `dragend`.
54
+ * @property {number} [y] - Y position of the pointer relative to this component. Present when type is `dragstart` or `dragend`.
55
+ * @property {number} [screenX] - X position of the pointer relative to the screen. Present when type is `dragstart` or `dragend`.
56
+ * @property {number} [screenY] - Y position of the pointer relative to the screen. Present when type is `dragstart` or `dragend`.
57
+ * @property {number} [button] - Indicates a pointing device button involved in dragging. Value of `MouseButton` enum.
58
+ * @property {number} [modifiers] - Keyboard modifiers (bitmask or flags). Present when type is `dragstart`.
59
+ * @property {string} [modifiersText] - Human-readable keyboard modifiers. Present when type is `dragstart`.
60
+ * @property {boolean} [alt] - Indicates if ALT key was pressed. Present when type is `dragstart`.
61
+ * @property {boolean} [shift] - Indicates if SHIFT key was pressed. Present when type is `dragstart`.
62
+ * @property {boolean} [ctrl] - Indicates if CTRL key was pressed. Present when type is `dragstart`.
63
+ * @property {number[]} [selected] - Selected indexes of a `List` component whose items are being dragged. Present only when dragging List items.
64
+ *
65
+ * @see {@link UIComponent#onDragEvents|onDragEvents()}
66
+ */
67
+
68
+ /**
69
+ * Change event received by the {@link UIComponent#onChange|onChange()} handler callback.
70
+ *
71
+ * @typedef {Object} ChangeEvent
72
+ * @property {object} target - The component that triggered the event.
73
+ * @property {string} type - One of `change`, `changing`.
74
+ * `change` - when value has changed and is no longer being modified by the user.
75
+ * `changing` - when the value is still being modified, e.g. while moving a Slider knob.
76
+ * @property {boolean} [interactive] - Indicates if the change was made by user interacting with the component. `false` means the change was done programmatically.
77
+ * @property {string} [action] - One of `inserted`, `removed`. Present for some text editing components, indicates the action performed.
78
+ * @property {number} [position] - The position at which text was inserted. Present when `action` is present.
79
+ * @property {number} [length] - The number of characters inserted or removed. Present when `action` is present. Applies to text editing components only.
80
+ * @property {string|number} [value] - Value of a currently selected {@link RadioButton}, {@link RadioButtonMenuItem} or {@link ToggleButton} within a group.
81
+ * @property {number} [index] - Index of a currently selected {@link RadioButton}, {@link RadioButtonMenuItem} or {@link ToggleButton} within a group.
82
+ * @property {boolean} [selected] - Indicates if the target {@link RadioButton}, {@link RadioButtonMenuItem} or {@link ToggleButton} component's new state is selected.
83
+ *
84
+ * @see {@link UIComponent#onChange|onChange()}
85
+ * @see RadioButton
86
+ * @see RadioButtonMenuItem
87
+ * @see ToggleButton
88
+ */
89
+
90
+ /**
91
+ * Ancestor event received by the {@link UIComponent#onAncestorEvents|onAncestorEvents()} handler callback.
92
+ *
93
+ * @typedef {Object} AncestorEvent
94
+ * @property {object} target - The component that triggered the event.
95
+ * @property {string} type - One of `add`, `remove`, `move`.
96
+ * @property {object} ancestor - The ancestor component related to this event.
97
+ *
98
+ * @see {@link UIComponent#onAncestorEvents|onAncestorEvents()}
99
+ */
100
+
101
+ /**
102
+ * Scroll event received by the {@link UIComponent#onScroll|onScroll()} handler callback.
103
+ *
104
+ * @typedef {Object} ScrollEvent
105
+ * @property {object} target - The component that triggered the event.
106
+ * @property {string} type - One of `horizontal`, `vertical`.
107
+ * @property {number} x - The new horizontal scroll position.
108
+ * @property {number} y - The new vertical scroll position.
109
+ * @property {number} maxX - The maximum horizontal scroll position.
110
+ * @property {number} maxY - The maximum vertical scroll position.
111
+ *
112
+ * @see {@link UIComponent#onScroll|onScroll()}
113
+ */
114
+
115
+ /**
116
+ * Caret event received by the {@link UIComponent#onCaretEvents|onCaretEvents()} handler callback.
117
+ *
118
+ * @typedef {Object} CaretEvent
119
+ * @property {object} target - The component that triggered the event.
120
+ * @property {string} type - Always `change`.
121
+ * @property {number} position - The new caret position.
122
+ * @property {number} selectionStart - Start position of selected text.
123
+ * @property {number} selectionEnd - End position of selected text.
124
+ * @property {number} [line] - Line number where the caret is located. Present in components like `DocumentEditor`.
125
+ * @property {number} [column] - Column number (offset from line start) of the caret. Present in multi-line components like `DocumentEditor`.
126
+ * @property {object} [styles] - Text formatting information at the caret’s position. Present only for `DocumentEditor` when HTML is enabled.
127
+ * @property {string[]} [path] - HTML tag hierarchy at the caret’s position. Present only for `DocumentEditor` when HTML is enabled.
128
+ *
129
+ * @see {@link UIComponent#onCaretEvents|onCaretEvents()}
130
+ */
131
+
132
+ /**
133
+ * Action event received by the {@link UIComponent#onAction|onAction()} handler callback.
134
+ *
135
+ * @typedef {Object} ActionEvent
136
+ * @property {object} target - The component that triggered the event.
137
+ * @property {string} command - The command string, usually the button text or a custom value set with `.command("")`.
138
+ * @property {number} [modifiers] - Keyboard modifiers (bitmask or flags).
139
+ * @property {boolean} [alt] - Indicates if ALT key was pressed.
140
+ * @property {boolean} [shift] - Indicates if SHIFT key was pressed.
141
+ * @property {boolean} [ctrl] - Indicates if CTRL key was pressed.
142
+ * @property {string} type - One of `action` or `index_change`. Present when applicable.
143
+ * @property {number} [x] - Mouse X position relative to the component.
144
+ * @property {number} [y] - Mouse Y position relative to the component.
145
+ * @property {number} [screenX] - Mouse X position relative to the screen.
146
+ * @property {number} [screenY] - Mouse Y position relative to the screen.
147
+ * @property {boolean} [interactive] - Indicates if the action was triggered by user interaction (not programmatically).
148
+ * @property {boolean} [selected] - Indicates selection state when applicable.
149
+ *
150
+ * @see {@link UIComponent#onAction|onAction()}
151
+ */
152
+
153
+ /**
154
+ * Mouse event received by the {@link UIComponent#onMouseEvents|onMouseEvents()} handler callback.
155
+ *
156
+ * @typedef {Object} MouseEvent
157
+ * @property {object} target - The component that triggered the event.
158
+ * @property {string} type - One of `click`, `down`, `up`, `enter`, `leave`.
159
+ * @property {number} [button] - Button number. One of {@link MouseButton} enum values. Present when type is `click`, `down`, or `up`.
160
+ * @property {number} [clicks] - Number of times the button was clicked. Present only when applicable, such as when type is `click`.
161
+ * @property {number} [modifiers] - Keyboard modifiers (bitmask or flags).
162
+ * @property {boolean} [alt] - Indicates if ALT key was pressed.
163
+ * @property {boolean} [shift] - Indicates if SHIFT key was pressed.
164
+ * @property {boolean} [ctrl] - Indicates if CTRL key was pressed.
165
+ * @property {number} [x] - Mouse X position relative to the component. Present when applicable.
166
+ * @property {number} [y] - Mouse Y position relative to the component. Present when applicable.
167
+ * @property {number} [screenX] - Mouse X position relative to the primary screen. Present when applicable.
168
+ * @property {number} [screenY] - Mouse Y position relative to the primary screen. Present when applicable.
169
+ *
170
+ * @see {@link UIComponent#onMouseEvents|onMouseEvents()}
171
+ *
172
+ * @example <h2>Detecting a single mouse button left click</h2>
173
+ * const label = new Label("Click Me").addTo(panel).onMouseEvents(e=>{
174
+ * if(e.type === "click" && e.button === MouseButton.Left && e.clicks === 1)
175
+ * {
176
+ * console.log("User clicked this label: " + e.target.text());
177
+ * }
178
+ * });
179
+ */
180
+
181
+ /**
182
+ * Mouse motion event received by the {@link UIComponent#onMouseMotion|onMouseMotion()} handler callback.
183
+ *
184
+ * @typedef {Object} MouseMotionEvent
185
+ * @property {object} target - The component that triggered the event.
186
+ * @property {string} type - One of `move`, `drag`.
187
+ * @property {number} [button] - Button number. One of `MouseButton` enum values. Present when applicable.
188
+ * @property {number} [modifiers] - Keyboard modifiers (bitmask or flags).
189
+ * @property {number} x - Mouse X position relative to the component.
190
+ * @property {number} y - Mouse Y position relative to the component.
191
+ * @property {number} screenX - Mouse X position relative to the screen.
192
+ * @property {number} screenY - Mouse Y position relative to the screen.
193
+ *
194
+ * @see {@link UIComponent#onMouseMotion|onMouseMotion()}
195
+ */
196
+
197
+ /**
198
+ * Mouse wheel event received by the {@link UIComponent#onMouseWheel|onMouseWheel()} or {@link SwingUI#onMouseWheel|ui.onMouseWheel()} handler callback.
199
+ *
200
+ * @typedef {Object} MouseWheelEvent
201
+ * @property {object} target - The component that triggered the event.
202
+ * @property {string} type - One of: `pixels`, `line`, or `pages`.
203
+ * @property {number} deltaX - Amount of units scrolled in horizontal direction.
204
+ * @property {number} deltaY - Amount of units scrolled in vertical direction.
205
+ * @property {number} scrollAmount - Tells how many `pixels`, `line`, or `pages` to scroll, depending on teh `type`.
206
+ * @property {number} rotation - Number of wheel "clicks" rotated. Can be zero until a full click is accumulated on high-resolution wheels.
207
+ * @property {number} screenX - Mouse X position relative to the screen.
208
+ * @property {number} screenY - Mouse Y position relative to the screen.
209
+ * @property {number} [x] - Mouse X position relative to the component. (not present for global event)
210
+ * @property {number} [y] - Mouse Y position relative to the component. (not present for global event)
211
+ * @property {number} [button] - Button number. One of `MouseButton` enum values. Present when applicable.
212
+ * @property {number} [modifiers] - Keyboard modifiers (bitmask or flags).
213
+ * @property {boolean} [alt] - Indicates if ALT key was pressed.
214
+ * @property {boolean} [shift] - Indicates if SHIFT key was pressed.
215
+ * @property {boolean} [ctrl] - Indicates if CTRL key was pressed.
216
+ *
217
+ * @see {@link UIComponent#onMouseWheel|onMouseWheel()}
218
+ * @see {@link SwingUI#onMouseWheel|ui.onMouseWheel()}
219
+ */
220
+
221
+ /**
222
+ * Key event received by the {@link UIComponent#onKey|onKey()} handler callback.
223
+ *
224
+ * @typedef {Object} KeyEvent
225
+ * @property {object} target - The component that triggered the event.
226
+ * @property {string} type - One of `up`, `down`, `type`.
227
+ * @property {number} keyCode - Numeric code associated with the key.
228
+ * @property {number} [extendedKeyCode] - Unique id assigned to a key depending on the current keyboard layout. Not present for global ui.onKey() events.
229
+ * @property {string} [keyChar] - The character produced by the key. Present only for `type` events.
230
+ * @property {number} [modifiers] - Keyboard modifiers (bitmask or flags).
231
+ * @property {string} [modifiersText] - Human-readable representation of modifiers.
232
+ * @property {boolean} [alt] - Indicates if ALT key was pressed.
233
+ * @property {boolean} [shift] - Indicates if SHIFT key was pressed.
234
+ * @property {boolean} [ctrl] - Indicates if CTRL key was pressed.
235
+ * @property {boolean} [meta] - Indicates if META (Windows or Command) key was pressed.
236
+ * @property {string} [keyLocation] - One of `standard`, `numpad`, `left`, `right`. Present for `up` and `down` events.
237
+ *
238
+ * @see {@link UIComponent#onKey|onKey()}
239
+ */
240
+
241
+ /**
242
+ * Focus event received by the {@link UIComponent#onFocusEvents|onFocusEvents()} handler callback.
243
+ *
244
+ * @typedef {Object} FocusEvent
245
+ * @property {object} target - The component that triggered the event.
246
+ * @property {string} type - One of `focus`, `blur`.
247
+ * @property {string} cause - One of `Unknown`, `Activation`, `TraversalForward`, `TraversalBackward`.
248
+ * @property {boolean} temporary - Indicates if the focus change is temporary (lost and is expected to return, or gained after being lost tempararily).
249
+ * @property {boolean} interactive - Indicates if the focus was changed by user interaction. If `false`, then it was changed programmatically.
250
+ *
251
+ * @see {@link UIComponent#onFocusEvents|onFocusEvents()}
252
+ */
253
+
254
+ /**
255
+ * Component event received by the {@link UIComponent#onComponentEvents|onComponentEvents()} handler callback.
256
+ *
257
+ * @typedef {Object} ComponentEvent
258
+ * @property {object} target - The component that triggered the event.
259
+ * @property {string} type - One of `resize`, `move`, `show`, `hide`.
260
+ * @property {boolean} [interactive] - Indicates if the event was triggered by user interaction (not programmatically). Present for `move` and `resize` for component like Window, InternalWindow.
261
+ * @property {number} [x] - New X position of the component.
262
+ * @property {number} [y] - New Y position of the component.
263
+ * @property {number} [width] - New width of the component. Present when type is `resize`.
264
+ * @property {number} [height] - New height of the component. Present when type is `resize`.
265
+ * @property {number} [innerWidth] - New width of the content area. Present for `resize` when component is `Window` or `InternalWindow`.
266
+ * @property {number} [innerHeight] - New height of the content area. Present for `resize` when component is `Window` or `InternalWindow`.
267
+ *
268
+ * @see {@link UIComponent#onComponentEvents|onComponentEvents()}
269
+ */
270
+
271
+ /**
272
+ * Container event received by the {@link UIComponent#onContainerEvents|onContainerEvents()} handler callback.
273
+ *
274
+ * @typedef {Object} ContainerEvent
275
+ * @property {object} target - The container component that triggered the event.
276
+ * @property {string} type - One of `add`, `remove`.
277
+ * @property {object} child - The child component that was added or removed.
278
+ *
279
+ * @see {@link UIComponent#onContainerEvents|onContainerEvents()}
280
+ */
281
+
282
+ /**
283
+ * Property change event received by the {@link UIComponent#onPropertyChange|onPropertyChange()} handler callback.
284
+ *
285
+ * @typedef {Object} PropertyChangeEvent
286
+ * @property {object} target - The component that triggered the event.
287
+ * @property {string} type - Always `change`.
288
+ * @property {string} property - The property that was changed.
289
+ * @property {any} oldValue - Previous value of the changed property.
290
+ * @property {any} newValue - New value of the changed property.
291
+ *
292
+ * @see {@link UIComponent#onPropertyChange|onPropertyChange()}
293
+ */
294
+
295
+ /**
296
+ * Popup list event received by the onPopupEvents() handler callback in ComboBox, Menu and ContextMenu components.
297
+ *
298
+ * @typedef {Object} PopupEvent
299
+ * @property {object} target - The component that triggered the event.
300
+ * @property {string} type - One of `show`, `hide`, `cancel`.
301
+ * @property {number} [x] - Component's X position relative to invoker. For `Menu` component it's only present when invoker is not `null`.
302
+ * @property {number} [y] - Component's Y position relative to invoker. For `Menu` component it's only present when invoker is not `null`.
303
+ * @property {boolean} interactive - Indicates if the popup was triggered by user's interaction (not programmatically).
304
+ * @property {number} [screenX] - X position of a `Menu` component relative to default screen.
305
+ * @property {number} [screenY] - Y position of a `Menu` component relative to default screen.
306
+ * @property {object} [invoker] - UI Component that invoked the popup, or `null` if it was invoked programmatically.
307
+ *
308
+ * @see {@link ComboBox#onPopupEvents|ComboBox.onPopupEvents()}
309
+ * @see {@link Menu#onPopupEvents|Menu.onPopupEvents()}
310
+ * @see {@link ContextMenu#onPopupEvents|ContextMenu.onPopupEvents()}
311
+ */
312
+
313
+ /**
314
+ * Event object passed to hyperlink event handlers in {@link DocumentEditor#onLinkEvents}.
315
+ *
316
+ * @typedef {Object} LinkEvent
317
+ * @property {DocumentEditor} target - The component that triggered the event.
318
+ * @property {string} type - The event type: `click`, `mouseenter`, or `mouseleave`.
319
+ * @property {string} url - The `href` attribute of the `<a>` tag.
320
+ * @property {string} text - The text content of the hyperlink.
321
+ * @property {boolean} shift - Whether the Shift key was pressed.
322
+ * @property {boolean} ctrl - Whether the Ctrl key was pressed.
323
+ * @property {boolean} alt - Whether the Alt key was pressed.
324
+ * @property {string} modifiers - Keyboard modifiers mask.
325
+ * @property {string} modifiersText - String representation of the keyboard modifiers.
326
+ *
327
+ * @see DocumentEditor#onLinkEvents
328
+ */
329
+
330
+ /**
331
+ * Event object passed to MediaPlayer event handlers.
332
+ *
333
+ * @typedef {Object} PlayerEvent
334
+ * @property {string} type - Type of the event: `loadstart`, `loadedmetadata`, `seeking`, `timeupdate`, `play`, `stop`, `subtitle`.
335
+ * @property {string} [mediaType] - Type of media loaded in the player: `File`, `InputDevice`, `URL`.
336
+ * @property {Media} [media] - A {@link Media} object containing details about the loaded media.
337
+ * @property {number} [currentTime] - Current playback time in seconds.
338
+ * @property {number} [duration] - Total duration of the media in seconds. Present when `type` is `timeupdate`.
339
+ * @property {string} [reason] - Reason for stopping playback: `Pause`, `EndOfMediaFile`.
340
+ * @property {number} [index] - Index of a subtitle since the player started playing (not from the beginning of the video}. (Only present when event type is `subtitle`).
341
+ * @property {string} [fromTime] - Time when to show the subtitle relative to the position when the video started (not to the beginning of the video). (Only present when event type is `subtitle`).
342
+ * @property {string} [toTime] - Time when to show the subtitle relative to the position when the video started (not to the beginning of the video). (Only present when event type is `subtitle`).
343
+ * @property {string} [text] - Subtitle text. (Only present when event type is `subtitle`).
344
+ *
345
+ * @see MediaPlayer#onPlayerEvents
346
+ * @see Media
347
+ * @see VideoStream
348
+ * @see AudioStream
349
+ * @see SubtitleStream
350
+ */
351
+
352
+ /**
353
+ * Represents an event related to a Window and InternalWindow component. Used for handling window state changes
354
+ * such as activation, minimization, maximization, hiding, showing, and closing.
355
+ *
356
+ * @typedef {Object} WindowEvent
357
+ * @property {Window|InternalWindow} target - The window component that triggered the event.
358
+ * @property {string} type - The event type. One of: `activate`, `deactivate`, `minimize`, `restore`, `closing`, `close`, `show`.
359
+ * @property {boolean} interactive - Indicates if the event was triggered by the user's interaction with the window.
360
+ *
361
+ * @see Window#onWindowEvents
362
+ * @see InternalWindow#onWindowEvents
363
+ *
364
+ * @example <h2>Example of a WindowEvent object:</h2>
365
+ * const e = {
366
+ * target: myWindow,
367
+ * type: "activate",
368
+ * interactive: true
369
+ * };
370
+ */
371
+
372
+ /**
373
+ * Represents a window state change event. Used when a window changes its state
374
+ * such as minimized, maximized, or restored.
375
+ *
376
+ * @typedef {Object} WindowStateEvent
377
+ * @property {Window} target - The window component that triggered the event.
378
+ * @property {string} type - The event type. Always `change` for state changes.
379
+ * @property {Window.State} state - The new state of the window.
380
+ * @property {Window.State} new_state - The previous state of the window.
381
+ * @property {boolean} interactive - Indicates if the state change was triggered by the user's interaction with the window.
382
+ *
383
+ * @see Window#onStateChange
384
+ * @see InternalWindow#onStateChange
385
+ *
386
+ * @example <h2>Example of a WindowStateEvent object:</h2>
387
+ * const e = {
388
+ * target: myWindow,
389
+ * type: "change",
390
+ * oldValue: Window.State.Minimized,
391
+ * newValue: Window.State.Normal,
392
+ * interactive: true
393
+ * };
394
+ */
395
+
396
+ /**
397
+ * Represents an application event used in `{@link SwingUI#onAppEvents|ui.onAppEvents(callback)}`.
398
+ *
399
+ * @typedef {Object} AppEvent
400
+ * @property {string} type - One of event types: `about`, `foreground`, `background`, `searchTerm`, `files`, `print`, `uri`, `preferences`, `quit`, `screenSleep`, `screenAwake`, `systemSleep`, `systemAwake`
401
+ * @property {string[]} [files] - File list. Present when type is `files` or `print`.
402
+ * @property {string} [searchTerm] - Present when type is `files`.
403
+ *
404
+ * @see SwingUI#onAppEvents
405
+ *
406
+ * @example <h2>Example of a `print` AppEvent object:</h2>
407
+ * const e = {
408
+ * type: "print",
409
+ * files: [
410
+ * "/home/mike/Desktop/Document.pdf"
411
+ * ]
412
+ * };
413
+ */
414
+
415
+ /**
416
+ * Represents a table row event triggered by a `{@link Table}` component `{@link Table#onRowEvents}` events.
417
+ *
418
+ * @typedef {Object} RowEvent
419
+ * @property {Table} target - The Table component that triggered the event.
420
+ * @property {string} type - Type of the row event: `insert`, `remove`, `update`.
421
+ * @property {number} [row] - Index of the affected row. Present when a single row is affected.
422
+ * @property {number} [column] - Column index of the affected cell. Only present when type is `update`.
423
+ * A value of `-1` means all columns in the row were affected.
424
+ * @property {number} [fromRow] - Start index of affected row range. Present when multiple rows are affected.
425
+ * @property {number} [toRow] - End index of affected row range. Present when multiple rows are affected.
426
+ * @property {boolean} [interactive] - Only present when type is `update`.
427
+ * `true` if the update was triggered by user interaction, `false` if done programmatically.
428
+ *
429
+ * @see Table#onRowEvents
430
+ *
431
+ * @example <h2>Single row insert event:</h2>
432
+ * const e = {
433
+ * target: table,
434
+ * type: "insert",
435
+ * row: 3
436
+ * };
437
+ *
438
+ * @example <h2>Cell update by user:</h2>
439
+ * const e = {
440
+ * target: table,
441
+ * type: "update",
442
+ * row: 2,
443
+ * column: 1,
444
+ * interactive: true
445
+ * };
446
+ *
447
+ * @example <h2>Range removal:</h2>
448
+ * const e = {
449
+ * target: table,
450
+ * type: "remove",
451
+ * fromRow: 5,
452
+ * toRow: 10
453
+ * };
454
+ */
455
+
456
+ /**
457
+ * Represents a table column event triggered by a `{@link Table}` component.
458
+ *
459
+ * @typedef {Object} ColumnEvent
460
+ * @property {Table} target - The Table component that triggered the event.
461
+ * @property {string} type - Type of the column event: `insert`, `remove`, `move`, `resize`;
462
+ * @property {number} [index] - Column index. Present when type is `insert`, `remove`, or `resize`.
463
+ * @property {number} [fromIndex] - Previous column index. Present when type is `move`.
464
+ * @property {number} [toIndex] - New column index. Present when type is `move`.
465
+ * @property {number} [fromSize] - Previous column size. Present when type is `resize`.
466
+ * @property {number} [toSize] - New column size. Present when type is `resize`.
467
+ * @property {boolean} [interactive] - Present for `move` events. `true` if triggered by user interaction, `false` if done programmatically.
468
+ *
469
+ * @see Table#onColumnEvents
470
+ * @see Table
471
+ *
472
+ * @example <h2>Insert column:</h2>
473
+ * const e = {
474
+ * target: table,
475
+ * type: "insert",
476
+ * index: 2
477
+ * };
478
+ *
479
+ * @example <h2>Move column:</h2>
480
+ * const e = {
481
+ * target: table,
482
+ * type: "move",
483
+ * fromIndex: 1,
484
+ * toIndex: 4,
485
+ * interactive: true //
486
+ * };
487
+ *
488
+ * @example <h2>Resize column:</h2>
489
+ * const e = {
490
+ * target: table,
491
+ * type: "resize",
492
+ * index: 3,
493
+ * fromSize: 120,
494
+ * toSize: 200
495
+ * };
496
+ */
497
+
498
+ /**
499
+ * Represents a table sort event triggered by a `{@link Table}` component.
500
+ *
501
+ * @typedef {Object} SortEvent
502
+ * @property {Table} target - The Table component that triggered the event.
503
+ * @property {Table.SortOrder} type - Sort order state: `Table.SortOrder.None`, `Table.SortOrder.Ascending`, or `Table.SortOrder.Descending`.
504
+ * @property {number} [column] - Column index. Present when type is not `Table.SortOrder.None`.
505
+ * @property {number} [newOrderColumn] - New column index after reordering. Present when type is not `Table.SortOrder.None`.
506
+ * @property {boolean} interactive - `true` if triggered by user interaction, `false` if triggered programmatically.
507
+ *
508
+ * @see Table#onSort
509
+ * @see Table
510
+ *
511
+ * @example <h2>Clear sorting:</h2>
512
+ * const e = {
513
+ * target: table,
514
+ * type: Table.SortOrder.None,
515
+ * interactive: true
516
+ * };
517
+ *
518
+ * @example <h2>Ascending sort:</h2>
519
+ * const e = {
520
+ * target: table,
521
+ * type: Table.SortOrder.Ascending,
522
+ * column: 2,
523
+ * newOrderColumn: 0,
524
+ * interactive: true
525
+ * };
526
+ *
527
+ * @example <h2>Descending sort:</h2>
528
+ * const e = {
529
+ * target: table,
530
+ * type: Table.SortOrder.Descending,
531
+ * column: 1,
532
+ * newOrderColumn: 3,
533
+ * interactive: false
534
+ * };
535
+ */
536
+
537
+ /**
538
+ * Represents an event triggered by a performing a keyboard shortcut (one key or a key combination) on a component.
539
+ *
540
+ * @typedef {Object} ShortcutEvent
541
+ * @property {UIComponent} target - The component that triggered the event.
542
+ * @property {ShortcutScope} scope - One of values from {@link ShortcutScope} enum.
543
+ * @property {string} action - User provided action string, or the key exactly as user specifed it (not normalized).
544
+ * @property {string} key - The keyboard key or a key combination that triggered the shortcut (normalized, might be not exactly same as user specified).
545
+ *
546
+ * @see UIComponent#onShortcut
547
+ * @see UIComponent#shortcuts
548
+ * @see ShortcutScope
549
+ */
550
+
551
+ /**
552
+ * Shape event received by the {@link Panel#onShapeEvents|onShapeEvents()} and {@link Window#onShapeEvents|Window.onShapeEvents()} handler callback.
553
+ *
554
+ * @typedef {Object} ShapeEvent
555
+ * @property {object} target - The Panel component that triggered the event.
556
+ * @property {string} type - One of: `add`, `remove`, `click`, `mousedown`, `mouseup`, `mouseenter`, `mouseleave`, `mousemove`.
557
+ * @property {number} [x] - X position of the pointer relative to the target component.
558
+ * @property {number} [y] - Y position of the pointer relative to the target component.
559
+ * @property {number} shapeIndex - Index of the shape that triggered the event.
560
+ * @property {boolean} [dragging] - `true` if mouse is down while moving, otherwise `false`.
561
+ * @property {boolean} [alt] - `true` if Alt key was pressed on keyboard when event was emitted.
562
+ * @property {boolean} [shift] - `true` if Shift key was pressed on keyboard when event was emitted.
563
+ * @property {boolean} [ctrl] - `true` if Control key was pressed on keyboard when event was emitted.
564
+ * @property {string} [modifiers] - Modifiers used when the event was emitted.
565
+ * @property {string} [modifiersText] - Description of used modifiers.
566
+ *
567
+ * @see {@link Panel#onShapeEvents|Panel.onShapeEvents()}
568
+ * @see {@link Window#onShapeEvents|Window.onShapeEvents()}
569
+ * @see Shape#active
570
+ */
571
+
572
+ //endregion
573
+
574
+ //region Other
575
+
576
+ /**
577
+ * List item object used in {@link ComboBox}, {@link List}, and {@link Tree} components.
578
+ *
579
+ * @typedef {Object} ListItem
580
+ * @property {string} [text] - Item text. (Required for a new list item).
581
+ * @property {string|number} [id] - Value that can be used by software logic to identify this item.
582
+ * @property {string|number} [value] - Additional value to be stored in the item for later use.
583
+ * @property {string|null} [icon] - Absolute/relative path to icon image, base64 encoded image string, or `null` to remove icon.
584
+ * @property {string} [color] - Item text color as a hex string (e.g. `#665500`).
585
+ * @property {string} [background] - Item background color as a hex string (e.g. `#665500`).
586
+ * @property {string} [tooltip] - Tooltip text shown when hovering the item (only in List and Tree components).
587
+ * @property {Font} [font] - {@link Font} formatted object.
588
+ * @property {boolean} [editable] - Specifies if the Tree node Item text can be edited by the user. (only in Tree components)
589
+ * @property {number} [index] - In some cases items are returned with `index` property to indicate their position within component.
590
+ * @property {ListItem[]} [children] - For Tree component nodes only! An array of child nodes.
591
+ *
592
+ * @see List
593
+ * @see ComboBox
594
+ * @see Tree
595
+ * @see Font
596
+ */
597
+
598
+ /**
599
+ * Font object used in most UI components, {@link ListItem}, {@link TableColumn}, {@link Text} shape and other text-rendering components.
600
+ *
601
+ * @typedef {Object} Font
602
+ * @property {string|FontFamily} [name] - Font family name (e.g., `"sans-serif"`).
603
+ * @property {number} [size] - Font size in pixels.
604
+ * @property {boolean} [bold] - Whether the text is bold.
605
+ * @property {boolean} [italic] - Whether the text is italic.
606
+ * @property {boolean} [underlined] - Whether the text is underlined.
607
+ * @property {boolean} [strikethrough] - Whether the text has a strikethrough.
608
+ * @property {string} [direction] - Text direction: `"ltr"` or `"rtl"`.
609
+ * @property {boolean} [kerning] - Enable or disable kerning.
610
+ * @property {boolean} [ligatures] - Enable or disable font ligatures.
611
+ * @property {number} [tracking] - Letter spacing adjustment: -1, 0 (default), or 1.
612
+ *
613
+ * @see FontFamily
614
+ * @see UIComponent#font
615
+ * @see ListItem
616
+ * @see TableColumn
617
+ * @see Text
618
+ */
619
+
620
+ /**
621
+ * Border object used to define the visual border of UI components like Panel, Label, Button, TextField, TextArea and more.
622
+ *
623
+ * @typedef {Object} Border
624
+ * @property {BorderStyle} style - (Required) The border style.
625
+ * @property {number} [width] - Border width in pixels. Must be >= 1.
626
+ * @property {string} [padding] - Inner padding as a space-separated string of four integer values: `"top right bottom left"`. Example: `"5 10 5 10"`. Can be set even when `style` is `"none"`.
627
+ * @property {string} [color] - Border color. Only applicable for `"line"` or `"dashed"` styles.
628
+ * @property {boolean} [rounded] - If `true`, renders rounded corners for `"line"` style, or rounded dashes for `"dashed"` style. Only applicable for `"line"` or `"dashed"` styles.
629
+ * @property {number} [length] - Length of each dash. Only applicable for `"dashed"` style.
630
+ * @property {number} [spacing] - Length of the gaps between dashes. Only applicable for `"dashed"` style.
631
+ * @property {number} [offset] - Starting offset of the dash pattern. Can be used to animate dashes. Only applicable for `"dashed"` style.
632
+ * @property {string} [text] - Label text displayed at the top-left of the border, creating a titled border effect.
633
+ * @property {string} [alignment] - Placement of the border label text. Accepts a combination of: `"left"`, `"center"`, `"right"`, `"leading"`, `"trailing"`, `"top"`, `"bottom"`, `"above"`, `"below"`. `"above"` and `"below"` refer to placement relative to the border line itself. Defaults to `"top left"`.
634
+ * @property {Font} [font] - Font used to render the border label text.
635
+ *
636
+ * @see UIComponent#border
637
+ * @see BorderStyle
638
+ * @see Font
639
+ */
640
+
641
+ /**
642
+ * Table column configuration object used in {@link Table} components.
643
+ *
644
+ * @typedef {Object} TableColumn
645
+ * @property {string} [text] - The text to be displayed in the column header. (Required when creating a new column)
646
+ * @property {string} [type="text"] - Type of component to display/edit cell data. Possible values:
647
+ * - `text` - Plain text or HTML.
648
+ * - `password` - Masked password text field.
649
+ * - `textarea` - Multi-line text field.
650
+ * - `icon` - Displays an image loaded from the cell's value as a URL or path. Use table.onAction(callback) for click events.
651
+ * - `button` - A string of button names separated by `"|"`. Use table.onAction(callback) for click events.
652
+ * - `checkbox` - Boolean check mark selection component.
653
+ * - `combobox` - Drop-down list of values, can be editable.
654
+ * - `progress` - Progress bar showing integer value 0–100.
655
+ * @property {number} [width] - Initial desired width of the column.
656
+ * @property {number} [minWidth] - Minimum width column can be resized to.
657
+ * @property {number} [maxWidth] - Maximum width column can be resized to.
658
+ * @property {boolean} [editable=false] - Whether text fields are editable.
659
+ * @property {number} [clicksToEdit] - Number of clicks required to enter edit mode. Takes effect only when `editable` is `true`.
660
+ * @property {boolean} [resizable=true] - Indicates if the column can be resized by the user.
661
+ * @property {boolean} [autoResize=false] - Indicates if column auto-resizes with table (Has no effect if the table's auto-resize mode is Table.AutoResize.None).
662
+ * @property {boolean} [hidden=false] - Whether the column is hidden by collapsing its width to 0.
663
+ * @property {boolean} [primary=false] - Indicates a column with primary data, such as a URL or file path, used as the data source for list generation or drag-and-drop operations.
664
+ * @property {Table.Sorting} [sorting=Table.Sorting.Natural] - Sorting mode. `Table.Sorting.None` disables sorting.
665
+ * @property {string[]} [options] - List of values to choose from in a ComboBox component when type is `combobox`.
666
+ * @property {string} [echoChar] - The character used to mask input for the `password` type.
667
+ * @property {string} [icon] - Icon shown in the column header. Value can be a local file path, URI, or base64 encoded image string.
668
+ * @property {number} [iconSize] - For `"icon"` type, fixed width/height of the icon (largest dimension).
669
+ * @property {number} [cacheCapacity=10] - For `"icon"` type, number of images cached in RAM.
670
+ * @property {string} [tooltip] - Tooltip for the column header.
671
+ * @property {string|null} [color] - Text color of cells of the column.
672
+ * @property {string|null} [background] - Background color of cells of the column.
673
+ * @property {string|null} [headerColor] - Text color of a column header.
674
+ * @property {string|null} [headerBackground] - Background color of a column header.
675
+ * @property {Font|null} [font] - Font of cells of a column.
676
+ * @property {Font|null} [headerFont] - Font of a column header.
677
+ * @property {number} [min] - Minimum value for progress bar component when type is `progress`.
678
+ * @property {number} [max] - Maximum value for progress bar component when type is `progress`.
679
+ * @property {boolean} [showText] - Whether to display the value as text inside the progress bar component when type is `progress`.
680
+ * @property {string} [align] - Text alignment in cells of the column. Maximum one horizontal and one vertical alignment keywords: 'center','left','right','leading','trailing','top','bottom'.
681
+ * @property {string} [headerAlign] - Text alignment of a column header. Maximum one horizontal and one vertical alignment keywords: 'center','left','right','leading','trailing','top','bottom'.
682
+ *
683
+ * @see Table
684
+ * @see Table#columns
685
+ * @see Table#addColumn
686
+ * @see Font
687
+ *
688
+ * @example <h2>Creating a simple column object:</h2>
689
+ * let column = {
690
+ * text: "New Column",
691
+ * headerAlign: "center"
692
+ * };
693
+ */
694
+
695
+ /**
696
+ * Table cell coordinates containing column and row property.
697
+ *
698
+ * @typedef {Object} Cell
699
+ * @property {number} column - a column index of the cell
700
+ * @property {number} row - a row index of the cell
701
+ *
702
+ * @see Table#cellAt
703
+ * @see Table#findCell
704
+ * @see Table#findCells
705
+ *
706
+ */
707
+
708
+ /**
709
+ * Describes metadata and streams of the media.
710
+ *
711
+ * @typedef {Object} Media
712
+ * @property {number} [duration] - Duration of the media in seconds. Not present for live streams.
713
+ * @property {VideoStream[]} videoStreams - Array of video streams available in the media.
714
+ * @property {AudioStream[]} audioStreams - Array of audio streams available in the media.
715
+ * @property {SubtitleStream[]} subtitleStreams - Array of subtitle streams available in the media.
716
+ *
717
+ * @see MediaPlayer#onPlayerEvents
718
+ * @see VideoStream
719
+ * @see AudioStream
720
+ * @see SubtitleStream
721
+ */
722
+
723
+ /**
724
+ * Describes a video stream in the media.
725
+ *
726
+ * @typedef {Object} VideoStream
727
+ * @property {number} sampleWidth - Original width of the video frame in pixels.
728
+ * @property {number} sampleHeight - Original height of the video frame in pixels.
729
+ * @property {number} width - Display width of the video.
730
+ * @property {number} height - Display height of the video.
731
+ * @property {string} pixelAspectRatio - Pixel aspect ratio (e.g., `"1:1"`).
732
+ * @property {string} displayAspectRatio - Display aspect ratio (e.g., `"16:9"`).
733
+ * @property {number} frameRate - Frame rate of the video stream.
734
+ * @property {string} codec - Codec used to encode the video stream (e.g., `"h264"`).
735
+ * @property {string} pixelFormat - Pixel format of the video stream (e.g., `"yuv420p"`).
736
+ * @property {boolean} progressive - Whether the video stream is progressive or interlaced.
737
+ * @property {boolean} default - Indicates if this is the default video stream.
738
+ *
739
+ * @see MediaPlayer#onPlayerEvents
740
+ * @see Media
741
+ */
742
+
743
+ /**
744
+ * Describes an audio stream in the media.
745
+ *
746
+ * @typedef {Object} AudioStream
747
+ * @property {number} sampleRate - Sample rate of the audio stream in Hz.
748
+ * @property {number} channels - Number of audio channels (1 - mono, 2 - stereo, etc.)
749
+ * @property {number} bitDepth - Bit depth of the audio samples.
750
+ * @property {string} codec - Codec used to encode the audio stream (e.g., `"aac"`).
751
+ * @property {boolean} default - Indicates if this is the default audio stream.
752
+ *
753
+ * @see MediaPlayer#onPlayerEvents
754
+ * @see Media
755
+ */
756
+
757
+ /**
758
+ * Describes a subtitle stream in the media.
759
+ *
760
+ * @typedef {Object} SubtitleStream
761
+ * @property {string} language - Language of the subtitle stream (e.g., `"en"`).
762
+ * @property {string} codec - Codec used for the subtitle stream (e.g., `"srt"`).
763
+ * @property {boolean} default - Indicates if this is the default subtitle stream.
764
+ *
765
+ * @see MediaPlayer#onPlayerEvents
766
+ * @see Media
767
+ */
768
+
769
+ /**
770
+ * Represents a video input device, such as WebCam, video capture device, etc. Used when getting input devices with {@link MediaPlayer#videoInputDevices|videoInputDevices} getter and when setting input device with {@link MediaPlayer#setInputDevice|setInputDevice()} method.
771
+ *
772
+ * @typedef {Object} VideoDevice
773
+ * @property {string} [name] - Name of the video input device (only present when retrieving a list of video input devices).
774
+ * @property {string} id - ID of the video input device.
775
+ * @property {VideoFormat[]} [formats] - List of available video formats (only present when retrieving a list of video input devices).
776
+ * @property {VideoFormat} [format] - Chosen video format to use (required when setting a video input device).
777
+ *
778
+ * @see MediaPlayer#videoInputDevices
779
+ * @see MediaPlayer#setInputDevice
780
+ * @see VideoFormat
781
+ *
782
+ * @example <h2>Setting a video input device:</h2>
783
+ * const devices = player.videoInputDevices;
784
+ * console.log(devices[0].formats[0]); // prints first format of a first device
785
+ * const first_format = devices[0].formats[0];
786
+ *
787
+ * // create new VideoDevice formatted object
788
+ * const video_device = {
789
+ * id: devices[0].id,
790
+ * format: {
791
+ * size: first_format.size,
792
+ * fps: first_format.max_fps,
793
+ * pixel_format: first_format.pixel_format, // set pixel_format in case when it is used instead of vcodec
794
+ * vcodec: first_format.vcodec // set vcodec in case when it is used instead of pixel format
795
+ * }
796
+ * }
797
+ *
798
+ * // set the video device and start playing
799
+ * player.setInputDevice(video_device).play();
800
+ */
801
+
802
+ /**
803
+ * Represents a video format for a VideoDevice. When using this VideoFormat for video input device, make sure that either "pixel_format" or "vcodec" is specified as it was set when you retrieved the supported formats.
804
+ *
805
+ * @typedef {Object} VideoFormat
806
+ * @property {string} size - Video frame size in pixels (e.g., "1920x1080").
807
+ * @property {number} [min_fps] - Minimum available frame rate (e.g., 7.5). (provided when retrieving video input devices)
808
+ * @property {number} [max_fps] - Maximum available frame rate (e.g., 30). (provided when retrieving video input devices)
809
+ * @property {number} [fps] - Frame rate in frames per second (required when setting a video input device).
810
+ * @property {string} [pixel_format] - Frame image pixel format coming out of the device (e.g., "yuyv422"). If this is present, then `vcodec` is absent.
811
+ * @property {string} [vcodec] - Encoded video format that the video device supports (e.g., "mjpeg", "h264"). If this is present, then `pixel_format` is absent.
812
+ *
813
+ * @see VideoDevice
814
+ *
815
+ * @example <h2>Example of a VideoFormat object when retrieved with input devices:</h2>
816
+ * const devices = player.videoInputDevices;
817
+ * const first_format = devices[0].formats[0];
818
+ * console.log(first_format); // prints first format of a first device
819
+ *
820
+ * // outputs something like:
821
+ * {
822
+ * size: "1920x1080",
823
+ * min_fps: 5,
824
+ * max_fps: 30,
825
+ * pixel_format: "yuyv422"
826
+ * }
827
+ *
828
+ * @example <h2>Setting a video input device:</h2>
829
+ * const devices = player.videoInputDevices;
830
+ * console.log(devices[0].formats[0]); // prints first format of a first device
831
+ * const first_format = devices[0].formats[0];
832
+ *
833
+ * // create new VideoDevice formatted object
834
+ * const video_device = {
835
+ * id: devices[0].id,
836
+ * format: {
837
+ * size: first_format.size,
838
+ * fps: first_format.max_fps,
839
+ * pixel_format: first_format.pixel_format, // set pixel_format in case when it is used instead of vcodec
840
+ * vcodec: first_format.vcodec // set vcodec in case when it is used instead of pixel format
841
+ * }
842
+ * }
843
+ *
844
+ * // set the video device and start playing
845
+ * player.setInputDevice(video_device).play();
846
+ *
847
+ */
848
+
849
+ /**
850
+ * Represents an audio input or output device, such as a microphone, audio card, etc.
851
+ *
852
+ * @typedef {Object} AudioDevice
853
+ * @property {string} name - Name of the audio device (required when setting an audio input device).
854
+ * @property {string} [id] - ID of the audio device.
855
+ * @property {AudioFormat[]} [formats] - List of available audio formats provided when retrieving a list of installed audio devices.
856
+ * @property {AudioFormat} [format] - Specifies the chosen audio format to use (only when setting audio input device).
857
+ *
858
+ * @see MediaPlayer#audioInputDevices
859
+ * @see MediaPlayer#audioOutputDevice
860
+ * @see AudioFormat
861
+ */
862
+
863
+ /**
864
+ * Represents an audio format for an audio device.
865
+ *
866
+ * @typedef {Object} AudioFormat
867
+ * @property {number} channels - Number of audio channels. (1-Mono, 2-Stereo, etc.)
868
+ * @property {number} bits - Bits per audio sample.
869
+ * @property {number} [rate] - Sample rate in Hz (only available for audio input devices).
870
+ * @property {string} [encoding] - Audio encoding (e.g., "PCM_UNSIGNED", "PCM_SIGNED"); (only available for audio output device formats).
871
+ *
872
+ * @see AudioDevice
873
+ */
874
+
875
+ /**
876
+ * Represents a point in 2D space with X and Y coordinates. Used when setting or getting position of UI component, Shape position, or Shape's anchor.
877
+ *
878
+ * @typedef {Object} Point
879
+ * @property {number} x - The x-coordinate.
880
+ * @property {number} y - The y-coordinate.
881
+ *
882
+ * @see UIComponent#position
883
+ * @see Shape#position
884
+ * @see Shape#anchor
885
+ *
886
+ * @example <h2>Example of a Point object:</h2>
887
+ * const point = {x: 300, y: 200};
888
+ */
889
+
890
+ /**
891
+ * Represents the size of a 2D object. Used when setting or getting the size of UI component, Shape size, and more.
892
+ *
893
+ * @typedef {Object} Size
894
+ * @property {number} width - The width dimension.
895
+ * @property {number} height - The height dimension.
896
+ *
897
+ * @see UIComponent#size
898
+ * @see UIComponent#minSize
899
+ * @see UIComponent#maxSize
900
+ * @see Window#innerSize
901
+ * @see Window#screenSize
902
+ * @see InternalWindow#innerSize
903
+ * @see Shape#size
904
+ * @see Rectangle#size
905
+ * @see Ellipse#size
906
+ *
907
+ * @example <h2>Example of a Size object:</h2>
908
+ * const size = {width: 300, height: 200};
909
+ */
910
+
911
+ /**
912
+ * Options object for configuring file or directory selection dialogs. Used in {@link Window#chooseFile}.
913
+ *
914
+ * @typedef {Object} FileChooserOptions
915
+ * @property {boolean} directory - `true` to select directories, `false` to select files.
916
+ * @property {boolean} save - `true` to display a Save dialog, `false` for an Open dialog.
917
+ * @property {boolean} multiple - `true` to allow selection of multiple files or folders.
918
+ * @property {boolean} hidden - `true` to display hidden files.
919
+ * @property {string} filter - File type filter string (e.g. `"Documents:doc,docx,txt,rtf|Music:mp3,m4a,ogg,wma|Images:gif,jpg,jpeg,bmp,webp"`).
920
+ * @property {string} path - Initial directory path or file path to open in the dialog.
921
+ *
922
+ * @see Window#chooseFile
923
+ */
924
+
925
+ /**
926
+ * Options object that hold optional video filters to be applied to video by FFMPEG for MediaPlayer component. Used in {@link MediaPlayer#videoFilters}.
927
+ *
928
+ * @typedef {Object} VideoFilters
929
+ * @property {number} [rotate] - A number of degrees to rotate the video by.
930
+ * @property {string} [flip] - `h` for horizontal, `v` for vertical.
931
+ * @property {string} [color] - `gray`, `sepia`, or `negative`.
932
+ * @property {number} [brightness] - A number between 1 and -1. Default is 0.
933
+ * @property {number} [contrast] - A number between 0.0 and 2.0. Default is 1.
934
+ * @property {number} [saturation] - A number between 0.0 and 3.0. Default is 1.
935
+ * @property {number} [gamma] - A number between 0.1 and 10.0. Default is 1.
936
+ * @property {string} [custom] - Allows to insert any custom video filters separated by comma. Must be compatible with `ffmpeg -vf` option.
937
+ *
938
+ * @see MediaPlayer#videoFilters
939
+ */
940
+
941
+ /**
942
+ * An object returned by ui.fileStat(path), which contains information about a file or directory.
943
+ *
944
+ * @typedef {Object} FileStat
945
+ * @property {boolean} isFile - Indicates if the entry is a regular file
946
+ * @property {boolean} isDirectory - Indicates if the entry is a directory
947
+ * @property {boolean} isSymlink - Indicates if the entry is a symbolic link
948
+ * @property {number} dev - Device ID containing the file
949
+ * @property {number} rdev - Device ID (if special file)
950
+ * @property {number} nlink - Number of hard links
951
+ * @property {number} user - User ID of the file owner
952
+ * @property {number} group - Group ID of the file owner
953
+ * @property {number} size - Size of the file in bytes
954
+ * @property {number} mode - File mode (permissions and file type)
955
+ * @property {Date} atime - Last access time
956
+ * @property {Date} mtime - Last modification time (e.g. 2025-11-10T08:13:44.386Z)
957
+ * @property {Date} ctime - Last status change time (e.g. 2025-11-10T08:13:44.386Z)
958
+ * @property {Date} birthtime - File creation time (e.g. 2025-11-10T08:13:44.386Z)
959
+ *
960
+ * @see SwingUI#fileStat
961
+ */
962
+
963
+ /**
964
+ * An object returned and accepted by .scrollbars() method for components with scroll bars, which contains scroll bar settings for horizontal and vertical scroll bars.
965
+ *
966
+ * @typedef {Object} Scrollbars
967
+ * @property {boolean|null} [horizontal] - Visibility of horizontal scroll bar: `true` = visible, `false` = hidden, `null` = auto.
968
+ * @property {boolean|null} [vertical] - Visibility of horizontal scroll bar: `true` = visible, `false` = hidden, `null` = auto.
969
+ *
970
+ * @see UIComponent#scrollbars
971
+ */
972
+
973
+ //endregion