Skip to content

Commit 578d47f

Browse files
committed
_Bounds type
1 parent e8cb353 commit 578d47f

File tree

1 file changed

+24
-46
lines changed

1 file changed

+24
-46
lines changed

shared/ScriptUI.d.ts

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ declare const enum _BrushOrPenType {
2121
THEME_COLOR,
2222
}
2323

24+
type _Bounds = Bounds | [number, number, number, number]
25+
2426
/**
2527
* A global class containing central information about ScriptUI. Not instantiable.
2628
*/
@@ -151,7 +153,7 @@ declare class Window extends _Control {
151153
* The bounds of the window frame in screen coordinates.
152154
* The frame consists of the title bar and borders that enclose the content region of a window, depending on the windowing system.
153155
*/
154-
readonly frameBounds: Bounds | [number, number, number, number]
156+
readonly frameBounds: _Bounds
155157

156158
/**
157159
* The top left corner of the window frame in screen coordinates.
@@ -246,7 +248,7 @@ declare class Window extends _Control {
246248
constructor(
247249
type: string,
248250
title?: string,
249-
bounds?: Bounds | [number, number, number, number],
251+
bounds?: _Bounds,
250252
properties?: Partial<_AddControlPropertiesWindow>,
251253
)
252254

@@ -2524,7 +2526,7 @@ declare class _Control {
25242526
* The boundaries of the element, in parent-relative coordinates.
25252527
* Setting an element's size or location changes its bounds property, and vice-versa.
25262528
*/
2527-
bounds: Bounds | [number, number, number, number]
2529+
bounds: _Bounds
25282530

25292531
/**
25302532
* True if this element is enabled.
@@ -2596,7 +2598,7 @@ declare class _Control {
25962598
/**
25972599
* The bounds of this element relative to the top-level parent window.
25982600
*/
2599-
readonly windowBounds: Bounds | [number, number, number, number]
2601+
readonly windowBounds: _Bounds
26002602

26012603
/**
26022604
* Registers an event handler for a particular type of event occurring in this element.
@@ -2770,29 +2772,19 @@ interface _AddControl {
27702772
* The third argument can be the initial text value.
27712773
* Special name "ok" makes the button primary for parent dialog, and the special name "cancel" makes the button default cancel button for parent dialog.
27722774
*/
2773-
(
2774-
type: "button",
2775-
bounds?: Bounds | [number, number, number, number],
2776-
text?: string,
2777-
properties?: _AddControlProperties,
2778-
): Button
2775+
(type: "button", bounds?: _Bounds, text?: string, properties?: _AddControlProperties): Button
27792776

27802777
/**
27812778
* Creation of a CheckBox.
27822779
* The third argument is the text to be displayed.
27832780
*/
2784-
(
2785-
type: "checkbox",
2786-
bounds?: Bounds | [number, number, number, number],
2787-
text?: string,
2788-
properties?: _AddControlProperties,
2789-
): Checkbox
2781+
(type: "checkbox", bounds?: _Bounds, text?: string, properties?: _AddControlProperties): Checkbox
27902782

27912783
/**
27922784
*/
27932785
(
27942786
type: "dropdownlist",
2795-
bounds?: Bounds | [number, number, number, number],
2787+
bounds?: _Bounds,
27962788
items?: string[],
27972789
properties?: Partial<_AddControlPropertiesDropDownList>,
27982790
): DropDownList
@@ -2801,7 +2793,7 @@ interface _AddControl {
28012793
*/
28022794
(
28032795
type: "edittext",
2804-
bounds?: Bounds | [number, number, number, number],
2796+
bounds?: _Bounds,
28052797
text?: string,
28062798
properties?: Partial<_AddControlPropertiesEditText>,
28072799
): EditText
@@ -2810,42 +2802,33 @@ interface _AddControl {
28102802
*/
28112803
(
28122804
type: "flashplayer",
2813-
bounds?: Bounds | [number, number, number, number],
2805+
bounds?: _Bounds,
28142806
movieToLoad?: string | File,
28152807
properties?: _AddControlProperties,
28162808
): FlashPlayer
28172809

28182810
/**
28192811
*/
2820-
(
2821-
type: "group",
2822-
bounds?: Bounds | [number, number, number, number],
2823-
properties?: _AddControlProperties,
2824-
): Group
2812+
(type: "group", bounds?: _Bounds, properties?: _AddControlProperties): Group
28252813

28262814
/**
28272815
*/
28282816
(
28292817
type: "iconbutton",
2830-
bounds?: Bounds | [number, number, number, number],
2818+
bounds?: _Bounds,
28312819
icon?: string | File,
28322820
properties?: Partial<_AddControlPropertiesIconButton>,
28332821
): IconButton
28342822

28352823
/**
28362824
*/
2837-
(
2838-
type: "image",
2839-
bounds?: Bounds | [number, number, number, number],
2840-
icon?: string | File,
2841-
properties?: _AddControlProperties,
2842-
): Image
2825+
(type: "image", bounds?: _Bounds, icon?: string | File, properties?: _AddControlProperties): Image
28432826

28442827
/**
28452828
*/
28462829
(
28472830
type: "listbox",
2848-
bounds?: Bounds | [number, number, number, number],
2831+
bounds?: _Bounds,
28492832
items?: string[],
28502833
properties?: Partial<_AddControlPropertiesListBox>,
28512834
): ListBox
@@ -2854,7 +2837,7 @@ interface _AddControl {
28542837
*/
28552838
(
28562839
type: "panel",
2857-
bounds?: Bounds | [number, number, number, number],
2840+
bounds?: _Bounds,
28582841
text?: string,
28592842
properties?: Partial<_AddControlPropertiesPanel>,
28602843
): Panel
@@ -2865,7 +2848,7 @@ interface _AddControl {
28652848
*/
28662849
(
28672850
type: "progressbar",
2868-
bounds?: Bounds | [number, number, number, number],
2851+
bounds?: _Bounds,
28692852
value?: number,
28702853
max?: number,
28712854
properties?: _AddControlProperties,
@@ -2877,7 +2860,7 @@ interface _AddControl {
28772860
*/
28782861
(
28792862
type: "radiobutton",
2880-
bounds?: Bounds | [number, number, number, number],
2863+
bounds?: _Bounds,
28812864
text?: string,
28822865
properties?: _AddControlProperties,
28832866
): RadioButton
@@ -2888,7 +2871,7 @@ interface _AddControl {
28882871
*/
28892872
(
28902873
type: "scrollbar",
2891-
bounds?: Bounds | [number, number, number, number],
2874+
bounds?: _Bounds,
28922875
value?: number,
28932876
min?: number,
28942877
max?: number,
@@ -2901,7 +2884,7 @@ interface _AddControl {
29012884
*/
29022885
(
29032886
type: "slider",
2904-
bounds?: Bounds | [number, number, number, number],
2887+
bounds?: _Bounds,
29052888
value?: number,
29062889
min?: number,
29072890
max?: number,
@@ -2912,25 +2895,20 @@ interface _AddControl {
29122895
*/
29132896
(
29142897
type: "statictext",
2915-
bounds?: Bounds | [number, number, number, number],
2898+
bounds?: _Bounds,
29162899
text?: string,
29172900
properties?: Partial<_AddControlPropertiesStaticText>,
29182901
): StaticText
29192902

29202903
/**
29212904
*/
2922-
(
2923-
type: "tab",
2924-
bounds: Bounds | [number, number, number, number],
2925-
text?: string[],
2926-
properties?: _AddControlProperties,
2927-
): Tab
2905+
(type: "tab", bounds: _Bounds, text?: string[], properties?: _AddControlProperties): Tab
29282906

29292907
/**
29302908
*/
29312909
(
29322910
type: "tabbedpanel",
2933-
bounds?: Bounds | [number, number, number, number],
2911+
bounds?: _Bounds,
29342912
text?: string,
29352913
properties?: _AddControlProperties,
29362914
): TabbedPanel
@@ -2939,7 +2917,7 @@ interface _AddControl {
29392917
*/
29402918
(
29412919
type: "treeview",
2942-
bounds?: Bounds | [number, number, number, number],
2920+
bounds?: _Bounds,
29432921
items?: string[],
29442922
properties?: Partial<_AddControlPropertiesTreeView>,
29452923
): TreeView

0 commit comments

Comments
 (0)