-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
1093 lines (940 loc) · 26.5 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Phoenix (kasper/phoenix) typings for TypeScript.
*/
interface Error {
line: number;
column: number;
}
/**
* A simple point object for 2D-coordinates.
*/
interface Point {
x: number;
y: number;
}
/**
* A simple 2D-size object.
*/
interface Size {
width: number;
height: number;
}
/**
* A 2D-rectangle representation of a Point and Size.
*/
interface Rectangle extends Point, Size {}
/**
* Image represents an image that can e.g. be used in a modal.
*/
type Image = Phoenix.Icon;
interface ImageObject {
/**
* Loads an image from the given path, the path is resolved before attempting
* to load the image, returns `undefined` if unsuccessful.
*/
fromFile(path: string): Image;
}
/**
* Use the `Image`-object to construct images.
*/
declare var Image: ImageObject;
interface Modal extends Phoenix.ModalProperties, Phoenix.Identifiable {
/**
* Dynamic property for the origin of the modal, the enclosed properties are
* read-only so you must pass an object for this property, bottom-left based
* origin, by default `(0, 0)`.
*/
origin: Readonly<Point>;
/**
* Returns the frame for the modal, the frame is adjusted for the current
* content, therefore you must first set the weight, icon and text to get an
* accurate frame, an input modal has a fixed width of 600, bottom left based
* origin.
*/
frame(): Rectangle;
/**
* Shows the modal.
*/
show(): void;
/**
* Closes the modal.
*/
close(): void;
/**
* Sets a custom text colour with the given RGBA values, for example
* `setTextColor(34, 139, 34, 1)`.
*/
setTextColor(red: number, green: number, blue: number, alpha: number): void;
setTextColour(red: number, green: number, blue: number, alpha: number): void;
}
interface ModalObject {
new (): Modal;
prototype: Modal;
/**
* Builds a modal with the specified properties and returns it.
*/
build(
properties: Partial<Phoenix.ModalProperties> & {
/**
* Function that receives the frame for the modal and returns a Point
* which will be set as the origin for the modal.
*/
origin?(frame: Rectangle): Point;
}
): Modal;
}
/**
* Use the Modal-object to display messages as modal windows.
*/
declare var Modal: ModalObject;
interface Screen extends Phoenix.Identifiable, Phoenix.Iterable<Screen> {
/**
* Returns the UUID for the screen.
*/
identifier(): string;
/**
* Returns the whole frame for the screen, bottom-left based origin.
*/
frame(): Rectangle;
/**
* Returns the visible frame for the screen subtracting the Dock and Menu from
* the frame when visible, bottom-left based origin.
*/
visibleFrame(): Rectangle;
/**
* Returns the whole frame for the screen, top-left based origin.
*/
flippedFrame(): Rectangle;
/**
* Returns the visible frame for the screen subtracting the Dock and Menu from
* the frame when visible, top-left based origin.
*/
flippedVisibleFrame(): Rectangle;
/**
* Returns the current space for the screen (macOS 10.11+, returns `undefined`
* otherwise).
*/
currentSpace(): Space | undefined;
/**
* Returns all spaces for the screen (macOS 10.11+, returns an empty list
* otherwise).
*/
spaces(): Space[]; // macOS 10.11+
/**
* Returns all windows for the screen if no optionals are given.
*/
windows(options?: {visible?: boolean}): Window[];
}
interface ScreenObject {
prototype: Screen;
/**
* Returns the screen containing the window with the keyboard focus.
*/
main(): Screen;
/**
* Returns all screens, the first screen in this array corresponds to the
* primary screen for the system.
*/
all(): Screen[];
}
/**
* Use the Screen-object to access frame sizes and other screens on a
* multi-screen setup. Get the current screen for a window through the
* Window-object. Beware that a screen can get stale if you keep a reference to
* it and it is for instance disconnected while you do so.
*/
declare var Screen: ScreenObject;
interface Space extends Phoenix.Identifiable, Phoenix.Iterable<Space> {
/**
* Returns true if the space is a normal space.
*/
isNormal(): boolean;
/**
* Returns true if the space is a full screen space.
*/
isFullScreen(): boolean;
/**
* Returns all screens to which the space belongs to.
*/
screens(): Screen[];
/**
* Returns all windows for the space if no optionals are given.
*/
windows(options?: {visible?: boolean}): Window[];
/**
* Adds the given windows to the space.
*/
addWindows(windows: Window[]): void;
/**
* Removes the given windows from the space.
*/
removeWindows(windows: Window[]): void;
/**
* Moves the given windows to the space (macOS 10.13+).
*/
moveWindows(windows: Window[]): void;
}
interface SpaceObject {
prototype: Space;
/**
* Returns the space containing the window with the keyboard focus (macOS
* 10.11+, returns undefined otherwise).
*/
active(): Space | undefined; // macOS 10.11+
/**
* Returns all spaces, the first space in this array corresponds to the
* primary space (macOS 10.11+, returns an empty list otherwise).
*/
all(): Space[]; // macOS 10.11+
}
/**
* Use the Space-object to control spaces. These features are only supported on
* El Capitan (10.11) and upwards. A single window can be in multiple spaces at
* the same time. To move a window to a different space, remove it from any
* existing spaces and add it to a new one. You can switch to a space by
* focusing on a window in that space. Beware that a space can get stale if you
* keep a reference to it and it is for instance closed while you do so.
*/
declare var Space: SpaceObject;
interface Mouse {
/**
* Returns the cursor position.
*/
location(): Point;
/**
* Moves the cursor to a given position, returns true if successful.
*/
move(point: Point): boolean;
}
/**
* Use the Mouse-object to control the cursor.
*/
declare var Mouse: Mouse;
interface App extends Phoenix.Identifiable {
/**
* Returns the process identifier (PID) for the app, returns -1 if the app
* does not have a PID.
*/
processIdentifier(): number;
/**
* Returns the bundle identifier for the app.
*/
bundleIdentifier(): string;
/**
* Returns the name for the app.
*/
name(): string;
/**
* Returns the app icon.
*/
icon(): Image;
/**
* Returns true if the app is currently frontmost.
*/
isActive(): boolean;
/**
* Returns true if the app is hidden.
*/
isHidden(): boolean;
/**
* Returns true if the app has been terminated.
*/
isTerminated(): boolean;
/**
* Returns the main window for the app, returns `undefined` if the app does
* not currently have a main window.
*/
mainWindow(): Window | undefined;
/**
* Returns all windows for the app if no optionals are given.
*/
windows(options?: {visible: boolean}): Window[];
/**
* Activates the app and brings its windows forward, returns true if
* successful.
*/
activate(): boolean;
/**
* Activates the app and brings its windows to focus, returns true if
* successful.
*/
focus(): boolean;
/**
* Shows the app, returns true if successful.
*/
show(): boolean;
/**
* Hides the app, returns true if successful.
*/
hide(): boolean;
/**
* Terminates the app, returns true if successful.
*/
terminate(options?: {force?: boolean}): boolean;
}
interface LaunchOptionals {
/**
* If set `true`, the launched app will be automatically focused. You don't
* need to call app.focus() to bring it forward.
*/
focus?: boolean;
}
interface AppObject {
prototype: App;
/**
* Returns the running app with the given name, returns undefined if the app
* is not currently running.
*/
get(appName: string): App | undefined;
/**
* Launches to the background and returns the app with the given name, returns
* undefined if unsuccessful.
*/
launch(appName: string, optionals?: LaunchOptionals): App | undefined;
/**
* Returns the focused app.
*/
focused(): App;
/**
* Returns all running apps.
*/
all(): App[];
}
/**
* Use the App-object to control apps. Beware that an app can get stale if you
* keep a reference to it and it is for instance terminated while you do so, see
* isTerminated().
*/
declare var App: AppObject;
interface Window extends Phoenix.Identifiable {
/**
* Returns all other windows on all screens if no optionals are given.
*/
others(options?: {screen?: Screen; visible?: boolean}): Window[];
/**
* Returns the title for the window.
*/
title(): string;
/**
* Returns true if the window is the main window for its app.
*/
isMain(): boolean;
/**
* Returns true if the window is a normal window.
*/
isNormal(): boolean;
/**
* Returns true if the window is a full screen window.
*/
isFullScreen(): boolean;
/**
* Returns true if the window is minimised.
*/
isMinimized(): boolean;
/**
* Returns true if the window is a normal and unminimised window that belongs
* to an unhidden app.
*/
isVisible(): boolean;
/**
* Returns the app for the window.
*/
app(): App;
/**
* Returns the screen where most or all of the window is currently present.
*/
screen(): Screen;
/**
* Returns the spaces where the window is currently present (macOS 10.11+,
* returns an empty list otherwise).
*/
spaces(): Space[]; // macOS 10.11+
/**
* Returns the top left point for the window.
*/
topLeft(): Point;
/**
* Returns the size for the window.
*/
size(): Size;
/**
* Returns the frame for the window.
*/
frame(): Rectangle;
/**
* Sets the top left point for the window, returns true if successful.
*/
setTopLeft(point: Point): boolean;
/**
* Sets the size for the window, returns true if successful.
*/
setSize(size: Size): boolean;
/**
* Sets the frame for the window, returns true if successful.
*/
setFrame(frame: Rectangle): boolean;
/**
* Sets whether the window is full screen, returns true if successful.
*/
setFullScreen(value: boolean): boolean;
/**
* Resizes the window to fit the whole visible frame for the screen, returns
* true if successful.
*/
maximize(): boolean;
/**
* Minimises the window, returns true if successful.
*/
minimize(): boolean;
/**
* Unminimises the window, returns true if successful.
*/
unminimize(): boolean;
/**
* Returns windows to the direction of the window.
*/
neighbors(direction: Phoenix.Direction): Window[];
/**
* Raises the window so it will be beneath the focused window, returns `true`
* if successful.
*/
raise(): boolean;
/**
* Focuses the window, returns true if successful.
*/
focus(): boolean;
/**
* Focuses the closest window to the direction of the window, returns `true`
* if successful.
*/
focusClosestNeighbor(direction: Phoenix.Direction): boolean;
/**
* Closes the window, returns `true` if successful.
*/
close(): boolean;
}
interface WindowObject {
prototype: Window;
/**
* Returns the focused window for the currently active app, can be undefined
* if no window is focused currently.
*/
focused(): Window | undefined;
/**
* Returns the topmost window at the specified point, can be undefined if no
* window is present at the given position.
*/
at(point: Point): Window | undefined;
/**
* Returns all windows in screens if no optionals are given.
*/
all(options?: {visible?: boolean}): Window[];
/**
* Returns all visible windows in the order as they appear on the screen (from
* front to back), essentially returning them in the most-recently-used order.
*/
recent(): Window[];
}
/**
* Use the Window-object to control windows. Every screen (i.e. display)
* combines to form a large rectangle. Every window lives within this rectangle
* and their position can be altered by giving coordinates inside this
* rectangle.
* To position a window to a specific display, you need to calculate its
* position within the large rectangle. To figure out the coordinates for a
* given screen, use the functions in Screen. Beware that a window can get stale
* if you keep a reference to it and it is for instance closed while you do so.
*/
declare var Window: WindowObject;
interface Key extends Phoenix.Identifiable {
/**
* Read-only property for the key character in lower case or case sensitive
* special key.
*/
readonly key: Phoenix.KeyIdentifier;
/**
* Read-only property for the key modifiers in lower case.
*/
readonly modifiers: Phoenix.ModifierKey[];
/**
* Returns true if the key handler is enabled, by default true.
*/
isEnabled(): boolean;
/**
* Enables the key handler, any previous handler for the same key combination
* will automatically be disabled, returns true if successful.
*/
enable(): boolean;
/**
* Disables the key handler, returns true if successful.
*/
disable(): boolean;
}
interface KeyObject {
/**
* Constructs and binds the key character with the specified modifiers (can be
* an empty list) to a callback function and returns the handler (undefined if
* not supported), you must keep a reference to the handler in order for your
* callback to get called, you can have multiple handlers for a single key
* combination, however only one can be enabled at a time, any previous
* handler for the same key combination will automatically be disabled, the
* callback function receives its handler as the only argument.
*/
new (
key: Phoenix.KeyIdentifier,
modifiers: Phoenix.ModifierKey[],
callback: (handler: Key, repeated: boolean) => void
): Key;
prototype: Key;
/**
* Constructs a managed handler for a key and returns the identifier for the
* handler.
*/
on(
key: Phoenix.KeyIdentifier,
modifiers: Phoenix.ModifierKey[],
callback: (handler: Key, repeated: boolean) => void
): number;
/**
* Disables the managed handler for a key with the given identifier.
*/
off(identifier: number): void;
/**
* Constructs a managed handler for a key that is by default only triggered
* one time and then disabled, for more control you can explicitly return
* `false` from the callback function and the handler will not be disabled
* until you return something else, for arguments see `new Key(...)`.
*/
once(
key: Phoenix.KeyIdentifier,
modifiers: Phoenix.ModifierKey[],
callback: (handler: Key, repeated: boolean) => false | any
): void;
}
/**
* Use the Key-object to enable or disable keys. You can have multiple handlers
* for a single key combination, however only one can be enabled at a time. A
* key is disabled automatically when you release your reference to the handler.
* Keys are always reset on context reload. Enabling a key combination that has
* been exclusively registered by another app will fail.
*/
declare var Key: KeyObject;
interface MousePoint extends Point {
/**
* Contains the key modifiers pressed when the mouse event is triggered.
*/
readonly modifiers: Phoenix.ModifierKey[];
}
interface Event extends Phoenix.Identifiable {
/**
* Read-only property for the event name.
*/
readonly name: string;
/**
* Disable the event handler.
*/
disable(): void;
}
interface EventObject {
/**
* Constructs and binds an event to a callback function and returns the
* handler (undefined if not supported), you must keep a reference to the
* handler in order for your callback to get called, you can have multiple
* handlers for a single event, the callback function receives its handler as
* the last argument, for any additional arguments see events.
*/
new (event: Phoenix.Event, callback: (handler: Event) => void): Event;
new (
event: Phoenix.AppEvent,
callback: (target: App, handler: Event) => void
): Event;
new (
event: Phoenix.MouseEvent,
callback: (target: MousePoint, handler: Event) => void
): Event;
new (
event: Phoenix.WindowEvent,
callback: (target: Window, handler: Event) => void
): Event;
prototype: Event;
/**
* Constructs a managed handler for an event and returns the identifier for
* the handler.
*/
on(event: Phoenix.Event, callback: (handler: Event) => void): number;
on(
event: Phoenix.AppEvent,
callback: (target: App, handler: Event) => void
): number;
on(
event: Phoenix.MouseEvent,
callback: (target: MousePoint, handler: Event) => void
): number;
on(
event: Phoenix.WindowEvent,
callback: (target: Window, handler: Event) => void
): number;
/**
* Disables the managed handler for an event with the given identifier.
*/
off(identifier: number): void;
/**
* Constructs a managed handler for an event that is by default only triggered
* one time and then disabled, for more control you can explicitly return
* `false` from the callback function and the handler will not be disabled
* until you return something else, for arguments see `new Event(...)`.
*/
once(event: Phoenix.Event, callback: (handler: Event) => false | any): void;
once(
event: Phoenix.AppEvent,
callback: (target: App, handler: Event) => false | any
): void;
once(
event: Phoenix.MouseEvent,
callback: (target: MousePoint, handler: Event) => false | any
): void;
once(
event: Phoenix.WindowEvent,
callback: (target: Window, handler: Event) => false | any
): void;
}
/**
* Use the Event-object to access event properties. You can have multiple
* handlers for a single event. To disable an event, release your reference to
* the handler. Events are always reset on context reload.
*/
declare var Event: EventObject;
interface Timer extends Phoenix.Identifiable {
/**
* Stops the timer immediately.
*/
stop(): void;
}
interface TimerObject {
/**
* Constructs a timer that fires the callback once or repeatedly until stopped
* with the given interval (in seconds) and returns the handler, you must keep
* a reference to the handler in order for your callback to get called, the
* callback function receives its handler as the only argument.
*/
new (interval: number, callback: (handler: Timer) => void): Timer;
prototype: Timer;
/**
* Constructs a managed handler for a timer that fires only once and returns
* the identifier for the handler.
*/
after(interval: number, callback: (handler: Timer) => void): number;
/**
* Constructs a managed handler for a timer that fires repeatedly and returns
* the identifier for the handler.
*/
every(interval: number, callback: (handler: Timer) => void): number;
/**
* Disables the managed handler for a timer with the given identifier.
*/
off(identifier: number): void;
}
declare var Timer: TimerObject;
interface Task extends Phoenix.Identifiable {
/**
* Read-only property for the termination status.
*/
readonly status: number;
/**
* Read-only property for the standard output.
*/
readonly output: string;
/**
* Read-only property for the standard error.
*/
readonly error: string;
/**
* Terminate the task immediately.
*/
terminate(): void;
}
interface TaskObject {
/**
* Constructs a task that asynchronously executes.
*/
new (path: string, args: string[], callback?: (task: Task) => void): Task;
prototype: Task;
/**
* Constructs a managed handler for a task and returns the identifier.
*/
run(path: string, args: string[], callback?: (task: Task) => void): number;
/**
* Terminates the managed handler for a task with the given identifier.
*/
terminate(identifier: number): void;
}
/**
* Use the Task-object to access task properties. To terminate a task, release
* your reference to the handler. Tasks are always reset on context reload.
* Beware that some task properties are only set after the task has completed.
*/
declare var Task: TaskObject;
interface Storage {
/**
* Stores the value for the key, any previously set value with the same key
* will be overridden.
*/
set(key: string, value: any): void;
/**
* Retrieves and returns the value for the key (`undefined` if no value has
* been set).
*/
get(key: string): any | undefined;
/**
* Removes the key and the value associated with it.
*/
remove(key: string): void;
}
declare var Storage: Storage;
interface Phoenix {
/**
* Manually reloads the context and any changes in the configuration files.
*/
reload(): void;
/**
* Sets the preferences from the given key–value map, any previously set
* preferences with the same key will be overridden.
*/
set(preferences: Phoenix.Preferences): void;
/**
* Logs the arguments to the Console (app).
*/
log(...arguments: any[]): void;
/**
* Logs the error and stack trace to the Console (app).
*/
log(err: Error): void;
/**
* Delivers the message to the Notification Center.
*/
notify(message: string): void;
}
/**
* Use the Phoenix-object for API-level tasks.
*/
declare var Phoenix: Phoenix;
/**
* You can modularise your configuration using the require function. It will
* load the referenced JavaScript file and reload it if any changes are
* detected. If the path is relative, it is resolved relatively to the absolute
* location of the primary configuration file. If this file is a symlink, it
* will be resolved before resolving the location of the required file. If the
* file does not exist, require will throw an error.
*/
declare function require(path: string): void;
interface console {
/**
* Alias for Phoenix.log.
*/
log: typeof Phoenix.log;
}
declare var console: console;
declare function clearInterval(handle: number): void;
declare function clearTimeout(handle: number): void;
declare function setInterval(
handler: (...args: any[]) => void,
timeout: number
): number;
declare function setTimeout(
handler: (...args: any[]) => void,
timeout: number
): number;
declare namespace Phoenix {
interface Preferences {
/**
* If set true Phoenix will run completely in the background, this also
* removes the status bar menu, defaults to false.
*/
daemon?: boolean;
/**
* If set true Phoenix will automatically open at login, defaults to false.
*/
openAtLogin?: boolean;
}
/**
* Icon is deprecated, use Image instead.
*/
interface Icon extends Phoenix.Identifiable {}
interface ModalProperties {
/**
* Property for the duration (in seconds) for the modal, if the duration is
* set to 0 the modal will remain open until closed, by default 0.
*/
duration: number;
/**
* Property for the animation duration (in seconds) for showing and closing
* the modal, if the duration is set to `0` the animation will be disabled, by
* default `0.2`.
*/
animationDuration: number;
/**
* Dynamic property for the weight of the modal (in points), by default `24`.
*/
weight: number;
/**
* Property for the appearance of the modal, by default `dark`.
*/
appearance: Phoenix.ModalAppearance;
/**
* Property for whether the modal has a shadow, by default `true`.
*/
hasShadow: boolean;
/**
* Dynamic property for the icon displayed in the modal.
*/
icon: Image | undefined;
/**
* Dynamic property for the text displayed in the modal.
*/
text: string;
/**
* Property for the alignment of the text, by default `left`.
*/
textAlignment: Phoenix.TextAlignment;
/**
* Dynamic property for the font name used for the text, by default `System`.
*/
font: string;
/**
* Property for whether the modal behaves as an input modal, by default `false`.
*/
isInput: boolean;
/**
* Property for the placeholder string that will be displayed when the input
* is empty, by default empty.
*/
inputPlaceholder: string;
/**
* Callback function to call when the input modal’s text field value changes,
* receives the value as the first argument for the callback.
*/
textDidChange(value: string): void;
}
type ModalAppearance = 'dark' | 'light' | 'transparent';
type TextAlignment = 'left' | 'right' | 'centre' | 'center';
type Direction = 'west' | 'east' | 'north' | 'south';
// Events with no additional object passed to callback.
type Event = Phoenix | DeviceEvent | ScreenEvent | SpaceEvent;
type PhoenixEvent = 'didLaunch' | 'willTerminate';
type DeviceEvent = 'deviceWillSleep' | 'deviceDidWake';
type ScreenEvent = 'screensDidChange';
type SpaceEvent = 'spaceDidChange';
// Special events with object passed to callback.
type MouseEvent =
| 'mouseDidMove'
| 'mouseDidMove'
| 'mouseDidLeftClick'
| 'mouseDidRightClick'
| 'mouseDidLeftDrag'
| 'mouseDidRightDrag';
type AppEvent =
| 'appDidLaunch'
| 'appDidTerminate'
| 'appDidActivate'
| 'appDidHide'
| 'appDidShow';
type WindowEvent =
| 'windowDidOpen'
| 'windowDidClose'
| 'windowDidFocus'
| 'windowDidMove'
| 'windowDidResize'
| 'windowDidMinimize'
| 'windowDidUnminimize'
| 'windowDidMinimise'
| 'windowDidUnminimise';
type ModifierKey =
| 'command'