forked from gebeto/scriptables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
6674 lines (5964 loc) · 247 KB
/
index.d.ts
File metadata and controls
6674 lines (5964 loc) · 247 KB
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
// Type definitions for non-npm package scriptable-ios 1.6
// Project: https://scriptable.app/
// Definitions by: schl3ck <https://github.com/schl3ck>
// FuJuntao <https://github.com/FuJuntao>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* _Presents an alert._
* @see https://docs.scriptable.app/alert/#-new-alert
*/
declare class Alert {
/**
* _Title displayed in the alert. Usually a short string._
* @see https://docs.scriptable.app/alert/#title
*/
title: string;
/**
* _Detailed message displayed in the alert._
* @see https://docs.scriptable.app/alert/#message
*/
message: string;
/**
* _Presents an alert._
* @see https://docs.scriptable.app/alert/#-new-alert
*/
constructor();
/**
* _Adds an action to the alert._
*
* Adds an action button to the alert. To check if an action was selected, you should use the first parameter provided when the promise returned by presentAlert() and presentSheet()
* is resolved.
* @param title - Title of the action.
* @see https://docs.scriptable.app/alert/#-addaction
*/
addAction(title: string): void;
/**
* _Adds a destructive action to the alert._
*
* Destructive action titles have a red text color, signaling that the action may modify or delete data.
* @param title - Title of the action.
* @see https://docs.scriptable.app/alert/#-adddestructiveaction
*/
addDestructiveAction(title: string): void;
/**
* _Adds a cancel action to the alert._
*
* Adds a cancel action to the alert. When a cancel action is selected, the index provided by presentAlert() or presentSheet() will always be -1. Please note that when running on the
* iPad and presenting using presentSheet(), the action will not be shown in the list of actions. The operation is cancelled by tapping outside the sheet.
* @param title - Title of the action.
* @see https://docs.scriptable.app/alert/#-addcancelaction
*/
addCancelAction(title: string): void;
/**
* _Adds a text field prompting for user input._
*
* Adds a text field to the alert controller prompting for user input. Retrieve the value for the text field using textFieldValue() and supply the index of the text field. Indices
* for text fields are assigned in the same order as they are added to the alert starting at 0.
*
* Text fields are not supported when using the sheet presentation.
* @param placeholder - Optional placeholder that will be displayed when the text field is empty.
* @param text - Optional default value for the text field.
* @see https://docs.scriptable.app/alert/#-addtextfield
*/
addTextField(placeholder?: string, text?: string): void;
/**
* _Adds a secure text field prompting for user input._
*
* Adds a secure text field to the alert controller prompting for user input. Values entered into a secure text field will be hidden behind dots. Retrieve the value for the text field
* using textFieldValue() and supply the index of the text field. Indices for text fields are assigned in the same order as they are added to the alert starting at 0.
* @param placeholder - Optional placeholder that will be displayed when the text field is empty.
* @param text - Optional default value for the text field.
* @see https://docs.scriptable.app/alert/#-addsecuretextfield
*/
addSecureTextField(placeholder?: string, text?: string): void;
/**
* _Retrieves value of a text field._
*
* Retrieves the value of a text field added using addTextField() or addSecureTextField(). Indices for text fields are assigned in the same order as they are added to the alert
* starting at 0.
* @param index - Index of text field to retrieve for value.
* @see https://docs.scriptable.app/alert/#-textfieldvalue
*/
textFieldValue(index: number): string;
/**
* _Presents the alert modally._
*
* This is a shorthand for presentAlert().
* @see https://docs.scriptable.app/alert/#-present
*/
present(): Promise<number>;
/**
* _Presents the alert modally._
* @see https://docs.scriptable.app/alert/#-presentalert
*/
presentAlert(): Promise<number>;
/**
* _Presents the alert as a sheet._
* @see https://docs.scriptable.app/alert/#-presentsheet
*/
presentSheet(): Promise<number>;
}
/**
* _Arguments passed to the script._
* @see https://docs.scriptable.app/args
*/
declare var args: {
/**
* _Plain texts supplied by a share sheet or a shortcut action._
*
* All plain texts passed to the script from a share sheet or a shortcut action.
*
* If you have enabled "Text" as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares plain text.
* @see https://docs.scriptable.app/args/#plaintexts
*/
plainTexts: string[];
/**
* _URLs supplied by a share sheet or a shortcut action._
*
* All URLs passed to the script from a share sheet or a shortcut action.
*
* If you have enabled "URLs" as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares URLs.
* @see https://docs.scriptable.app/args/#urls
*/
urls: string[];
/**
* _File URLs supplied by a share sheet or a shortcut action._
*
* All file URLs passed to the script from a share sheet or a shortcut action.
*
* If you have enabled "File URLs" as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares URLs pointing to a
* file.
*
* When large files are passed from a share sheet or a shortcut action, the system may terminate the process due to memory constraints. In that case, you should enable "Run in App" in
* the script settings or in the shortcut.
* @see https://docs.scriptable.app/args/#fileurls
*/
fileURLs: string[];
/**
* _Images supplied by a share sheet or a shortcut action._
*
* All images passed to the script from a share sheet or a shortcut action.
*
* If you have enabled "Images" as a share sheet input from the script settings, the script can be run from any share sheet throughout the system that shares images.
*
* When large images are passed from a share sheet or a shortcut action, the system may terminate the process due to memory constraints. In that case, you should enable "Run in App"
* in the script settings or in the shortcut.
* @see https://docs.scriptable.app/args/#images
*/
images: Image[];
/**
* _Query parameters from a URL scheme._
*
* Query parameters are supplied to a script when running it from a URL scheme. See the documentation on Scriptables URL schemes for more information.
* @see https://docs.scriptable.app/args/#queryparameters
*/
queryParameters: { [key: string]: string };
/**
* _Parameter passed to a Shortcut._
*
* When creating a shortcut using the Shortcuts app, you can pass an input parameter that can be read in your script using `args.shortcutParameter`.
*
* This parameter can be any text, list, dictionary or file and will be exposed in your script using the appropriate type. When passing a file, the "Run Script" action will attempt to
* read the file as JSON or a plain text. If the file cannot be read as JSON or a plain text, a path to the file will be passed as the input parameter.
* @see https://docs.scriptable.app/args/#shortcutparameter
*/
shortcutParameter: any;
/**
* _Parameter passed to a widget._
*
* When creating a widget on the Home screen, you can define a parameter that can be read in your script using `args.widgetParameter`.
*
* The parameter can be used to differentiate the behavior of multiple widgets.
* @see https://docs.scriptable.app/args/#widgetparameter
*/
widgetParameter: any;
/**
* _Notification being handled by the script._
*
* The notification that a script is being run in or the application was opened from.
*
* The notification contains all information that was set when the notification was originally scheduled, including the `userInfo` property which can be used to contain custom data
* that might be relevant when running the script.
* @see https://docs.scriptable.app/args/#notification
*/
notification: Notification;
};
/**
* _Holds reminders and events._
* @see https://docs.scriptable.app/calendar
*/
declare class Calendar {
/**
* _Calendar identifier._
* @see https://docs.scriptable.app/calendar/#identifier
*/
identifier: string;
/**
* _Title of calendar._
* @see https://docs.scriptable.app/calendar/#title
*/
title: string;
/**
* _Whether the calendar is a subscribed calendar._
* @see https://docs.scriptable.app/calendar/#issubscribed
*/
isSubscribed: boolean;
/**
* _Indicates whether items can be added, edited, and deleted in the calendar._
* @see https://docs.scriptable.app/calendar/#allowscontentmodifications
*/
allowsContentModifications: boolean;
/**
* _Color of calendar._
* @see https://docs.scriptable.app/calendar/#color
*/
color: Color;
/**
* _Fetches calendars for reminders._
*
* A calendar can only hold either reminders or events. Call this function to fetch all calendars that can hold reminders.
* @see https://docs.scriptable.app/calendar/#forreminders
*/
static forReminders(): Promise<Calendar[]>;
/**
* _Fetches calendars for events._
*
* A calendar can only hold either reminders or events. Call this function to fetch all calendars that can hold events.
* @see https://docs.scriptable.app/calendar/#forevents
*/
static forEvents(): Promise<Calendar[]>;
/**
* _Fetches a calendar that holds reminders._
* @param title - Title of calendar.
* @see https://docs.scriptable.app/calendar/#forremindersbytitle
*/
static forRemindersByTitle(title: string): Promise<Calendar>;
/**
* _Fetches a calendar that holds events._
* @param title - Title of calendar.
* @see https://docs.scriptable.app/calendar/#foreventsbytitle
*/
static forEventsByTitle(title: string): Promise<Calendar>;
/**
* _Create a new calendar that holds reminders._
*
* This will create a new list for reminders in the Reminders app. The list is automatically saved so there is no need to call `save()` after creating the list.
* @see https://docs.scriptable.app/calendar/#createforreminders
*/
static createForReminders(title: string): Promise<Calendar>;
/**
* _Find or create a new calendar that holds reminders._
*
* This will attempt to find a calendar for reminders with the specified name. If no calendar is found, a new calendar is created and the calendar will appear as a reminder list in
* the Reminders app. If multiple calendars are found for the specified name, the first one will be returned. The list is automatically saved so there is no need to call `save()` in
* the case the list was created.
* @see https://docs.scriptable.app/calendar/#findorcreateforreminders
*/
static findOrCreateForReminders(title: string): Promise<Calendar>;
/**
* _Default calendar for reminders._
*
* A calendar can only hold either reminders or events. Call this function to get the default calendar that can hold reminders.
* @see https://docs.scriptable.app/calendar/#defaultforreminders
*/
static defaultForReminders(): Promise<Calendar>;
/**
* _Default calendar for events._
*
* A calendar can only hold either reminders or events. Call this function to get the default calendar that can hold events.
* @see https://docs.scriptable.app/calendar/#defaultforevents
*/
static defaultForEvents(): Promise<Calendar>;
/**
* _Presents a view for picking calendars._
* @param allowMultiple - Whether to allow picking multiple calenders. Defaults to false.
* @see https://docs.scriptable.app/calendar/#presentpicker
*/
static presentPicker(allowMultiple?: boolean): Promise<Calendar[]>;
/**
* _Checks if the calendar supports availability._
*
* The following values are supported:
*
* * busy
* * free
* * tentative
* * unavailable
*
* Not all calendars support all of these availabilities and some calendars may not support availability at all. Use this function to check if the calendar supports a specific
* availability.
* @param availability - Availability to check against.
* @see https://docs.scriptable.app/calendar/#-supportsavailability
*/
supportsAvailability(availability: 'busy' | 'free' | 'tentative' | 'unavailable'): boolean;
/**
* _Saves calendar._
*
* Saves changes to the calendar.
* @see https://docs.scriptable.app/calendar/#-save
*/
save(): void;
/**
* _Removes calendar._
*
* The calendar is removed immediately. This cannot be undone.
* @see https://docs.scriptable.app/calendar/#-remove
*/
remove(): void;
}
declare namespace CalendarEvent {
interface Attendees {
isCurrentUser: boolean;
name: string;
status: string;
type: string;
role: string;
}
}
/**
* _Manages events in calendars._
*
* In order to add the event to your calendar, you must call the save() function.
* @see https://docs.scriptable.app/calendarevent/#-new-calendarevent
*/
declare class CalendarEvent {
/**
* _Identifier of event._
* @see https://docs.scriptable.app/calendarevent/#identifier
*/
identifier: string;
/**
* _Title of event._
* @see https://docs.scriptable.app/calendarevent/#title
*/
title: string;
/**
* _Location of event._
* @see https://docs.scriptable.app/calendarevent/#location
*/
location: string;
/**
* _Notes associated with event._
* @see https://docs.scriptable.app/calendarevent/#notes
*/
notes: string;
/**
* _Start date of event._
* @see https://docs.scriptable.app/calendarevent/#startdate
*/
startDate: Date;
/**
* _End date of event._
* @see https://docs.scriptable.app/calendarevent/#enddate
*/
endDate: Date;
/**
* _Whether the event is an all-day event._
* @see https://docs.scriptable.app/calendarevent/#isallday
*/
isAllDay: boolean;
/**
* _Attendees associated with the event._
*
* An array of objects on the following form:
*
* {
* "isCurrentUser": false,
* "name": "John Appleseed",
* "status": "accepted",
* "type": "person",
* "role": "required"
* }
*
* Note that the property is read-only since iOS does not expose API to modify the attendees of an event.
* @see https://docs.scriptable.app/calendarevent/#attendees
*/
attendees: CalendarEvent.Attendees[];
/**
* _Availability during the event._
*
* Indicates how the event should be treated for scheduling purposes. The following values are supported:
*
* * busy
* * free
* * tentative
* * unavailable
*
* Be aware that not all calendars support all of these availabilities and some calendars may not support availability at all. Use `Calendar.supportsAvailability()` to check if a
* calendar supports a specific availability.
* @see https://docs.scriptable.app/calendarevent/#availability
*/
availability: 'busy' | 'free' | 'tentative' | 'unavailable';
/**
* _Time zone of event._
*
* Geopolitical region identifier that identifies the time zone, e.g. "Europe/Copenhagen", "America/New\_York" and "Asia/Tokyo".
* @see https://docs.scriptable.app/calendarevent/#timezone
*/
timeZone: string;
/**
* _Calendar the event is stored in._
* @see https://docs.scriptable.app/calendarevent/#calendar
*/
calendar: Calendar;
/**
* _Manages events in calendars._
*
* In order to add the event to your calendar, you must call the save() function.
* @see https://docs.scriptable.app/calendarevent/#-new-calendarevent
*/
constructor();
/**
* _Presents a view for creating a calendar event._
*
* The presented view supports editing various attributes of the event, including title, location, dates, recurrence and alerts.
* @see https://docs.scriptable.app/calendarevent/#presentcreate
*/
static presentCreate(): Promise<CalendarEvent>;
/**
* _Events occurring today._
* @param calendars - Calendars to fetch events for. Defaults to all calendars.
* @see https://docs.scriptable.app/calendarevent/#today
*/
static today(calendars?: Calendar[]): Promise<CalendarEvent[]>;
/**
* _Events occurring tomorrow._
* @param calendars - Calendars to fetch events for. Defaults to all calendars.
* @see https://docs.scriptable.app/calendarevent/#tomorrow
*/
static tomorrow(calendars?: Calendar[]): Promise<CalendarEvent[]>;
/**
* _Events that occurred yesterday._
* @param calendars - Calendars to fetch events for. Defaults to all calendars.
* @see https://docs.scriptable.app/calendarevent/#yesterday
*/
static yesterday(calendars?: Calendar[]): Promise<CalendarEvent[]>;
/**
* _Events that occur this week._
* @param calendars - Calendars to fetch events for. Defaults to all calendars.
* @see https://docs.scriptable.app/calendarevent/#thisweek
*/
static thisWeek(calendars?: Calendar[]): Promise<CalendarEvent[]>;
/**
* _Events that occur next week._
* @param calendars - Calendars to fetch events for. Defaults to all calendars.
* @see https://docs.scriptable.app/calendarevent/#nextweek
*/
static nextWeek(calendars?: Calendar[]): Promise<CalendarEvent[]>;
/**
* _Events that occurred last week._
* @param calendars - Calendars to fetch events for. Defaults to all calendars.
* @see https://docs.scriptable.app/calendarevent/#lastweek
*/
static lastWeek(calendars?: Calendar[]): Promise<CalendarEvent[]>;
/**
* _Events that occurs between two dates._
* @param startDate - Start date to fetch events for.
* @param endDate - End date to fetch events for.
* @param calendars - Calendars to fetch events for. Defaults to all calendars.
* @see https://docs.scriptable.app/calendarevent/#between
*/
static between(startDate: Date, endDate: Date, calendars?: Calendar[]): Promise<CalendarEvent[]>;
/**
* _Adds a recurrence rule._
*
* Recurrence rules specify when the event or reminder should be repeated. See the documentation of RecurrenceRule for more information on creating rules.
* @param recurrenceRule - Recurrence rule to add to the reminder.
* @see https://docs.scriptable.app/calendarevent/#-addrecurrencerule
*/
addRecurrenceRule(recurrenceRule: RecurrenceRule): void;
/**
* _Removes all recurrence rules._
* @see https://docs.scriptable.app/calendarevent/#-removeallrecurrencerules
*/
removeAllRecurrenceRules(): void;
/**
* _Saves event._
*
* Saves changes to an event, inserting it into the calendar if it is newly created.
* @see https://docs.scriptable.app/calendarevent/#-save
*/
save(): void;
/**
* _Removes event from calendar._
* @see https://docs.scriptable.app/calendarevent/#-remove
*/
remove(): void;
/**
* _Presents a view for editing the calendar event._
*
* The presented view supports editing various attributes of the event, including title, location, dates, recurrence and alerts.
* @see https://docs.scriptable.app/calendarevent/#-presentedit
*/
presentEdit(): Promise<CalendarEvent>;
}
/**
* _Open x-callback-url requests._
*
* Constructs an object that opens x-callback-url requests and waits for a response from the target app.
* @see https://docs.scriptable.app/callbackurl/#-new-callbackurl
*/
declare class CallbackURL {
/**
* _Open x-callback-url requests._
*
* Constructs an object that opens x-callback-url requests and waits for a response from the target app.
* @param baseURL - Base URL of the request. This is usally something like my-app://x-callback-url/action
* @see https://docs.scriptable.app/callbackurl/#-new-callbackurl
*/
constructor(baseURL: string);
/**
* _Construct CallbackURL._
*
* Appends a key/value pair to the base URL as a query parameter. The name and value are automatically encoded. Do not add the x-callback-url paramters, i.e. x-source, x-success,
* x-error and x-cancel as Scriptable will add those.
* @param name - Name of the query parameter to add.
* @param value - Value of the query parameter to add.
* @see https://docs.scriptable.app/callbackurl/#-addparameter
*/
addParameter(name: string, value: string): void;
/**
* _Opens the callback URL._
*
* Opens the target app and waits for the target app to perform the action. The returned promise contains the query parameters supplied by the target app when it invokes the callback.
* If the action failed in the target app or the action was cancelled, the promise will be rejected. The promise is also rejected if the action times out because the target app did
* not invoke the callback.
* @see https://docs.scriptable.app/callbackurl/#-open
*/
open(): Promise<any>;
/**
* _Creates the callback URL._
*
* Creates a callback URL with the specified base URL and query parameters.
* @see https://docs.scriptable.app/callbackurl/#-geturl
*/
getURL(): string;
}
/**
* _Stores color data including opacity._
*
* Constructs a new color with a hex value and optionally an alpha value. The hex value may specify the alpha value but this will be ignored if the alpha value parameter is provided.
* Examples of valid hex values: #ff0000, #00ff0080 #00f and #ff. The hashtag is optional.
* @see https://docs.scriptable.app/color/#-new-color
*/
declare class Color {
/**
* _HEX representation._
* @see https://docs.scriptable.app/color/#hex
*/
hex: string;
/**
* _Amount of red in the color._
* @see https://docs.scriptable.app/color/#red
*/
red: number;
/**
* _Amount of green in the color._
* @see https://docs.scriptable.app/color/#green
*/
green: number;
/**
* _Amount of blue in the color._
* @see https://docs.scriptable.app/color/#blue
*/
blue: number;
/**
* _Alpha of the color._
* @see https://docs.scriptable.app/color/#alpha
*/
alpha: number;
/**
* _Stores color data including opacity._
*
* Constructs a new color with a hex value and optionally an alpha value. The hex value may specify the alpha value but this will be ignored if the alpha value parameter is provided.
* Examples of valid hex values: #ff0000, #00ff0080 #00f and #ff. The hashtag is optional.
* @param hex - Hex value.
* @param alpha - Alpha value.
* @see https://docs.scriptable.app/color/#-new-color
*/
constructor(hex: string, alpha: number);
/**
* _Constructs a black color._
* @see https://docs.scriptable.app/color/#black
*/
static black(): Color;
/**
* _Constructs a dark gray color._
* @see https://docs.scriptable.app/color/#darkgray
*/
static darkGray(): Color;
/**
* _Constructs a light gray color._
* @see https://docs.scriptable.app/color/#lightgray
*/
static lightGray(): Color;
/**
* _Constructs a white color._
* @see https://docs.scriptable.app/color/#white
*/
static white(): Color;
/**
* _Constructs a gray color._
* @see https://docs.scriptable.app/color/#gray
*/
static gray(): Color;
/**
* _Constructs a red color._
* @see https://docs.scriptable.app/color/#red
*/
static red(): Color;
/**
* _Constructs a green color._
* @see https://docs.scriptable.app/color/#green
*/
static green(): Color;
/**
* _Constructs a blue color._
* @see https://docs.scriptable.app/color/#blue
*/
static blue(): Color;
/**
* _Constructs a cyan color._
* @see https://docs.scriptable.app/color/#cyan
*/
static cyan(): Color;
/**
* _Constructs a yellow color._
* @see https://docs.scriptable.app/color/#yellow
*/
static yellow(): Color;
/**
* _Constructs a magenta color._
* @see https://docs.scriptable.app/color/#magenta
*/
static magenta(): Color;
/**
* _Constructs a orange color._
* @see https://docs.scriptable.app/color/#orange
*/
static orange(): Color;
/**
* _Constructs a purple color._
* @see https://docs.scriptable.app/color/#purple
*/
static purple(): Color;
/**
* _Constructs a brown color._
* @see https://docs.scriptable.app/color/#brown
*/
static brown(): Color;
/**
* _Constructs a transparent color._
* @see https://docs.scriptable.app/color/#clear
*/
static clear(): Color;
/**
* _Creates a dynamic color._
*
* The dynamic color will use either its light or dark variant depending on the appearance of the system.
*
* Dynamic colors are not supported when used with `DrawContext`.
* @param lightColor - Color used in light appearance.
* @param darkColor - Color used in dark appearance.
* @see https://docs.scriptable.app/color/#dynamic
*/
static dynamic(lightColor: Color, darkColor: Color): Color;
}
/**
* _Configuration the script runs with._
* @see https://docs.scriptable.app/config
*/
declare var config: {
/**
* Whether the script is running in the app.
* @see https://docs.scriptable.app/config/#runsinapp
*/
runsInApp: boolean;
/**
* Whether the script is running in the action extension.
* @see https://docs.scriptable.app/config/#runsinactionextension
*/
runsInActionExtension: boolean;
/**
* Whether the script is running with Siri.
* @see https://docs.scriptable.app/config/#runswithsiri
*/
runsWithSiri: boolean;
/**
* Whether the script is running in a widget.
* @see https://docs.scriptable.app/config/#runsinwidget
*/
runsInWidget: boolean;
/**
* Whether the script is running in a notification.
* @see https://docs.scriptable.app/config/#runsinnotification
*/
runsInNotification: boolean;
/**
* Whether the script was run from the home screen. You can add a script to the home screen from the script settings.
* @see https://docs.scriptable.app/config/#runsfromhomescreen
*/
runsFromHomeScreen: boolean;
/**
* The size of the widget the script is running in.
*
* Possible values are: `small`, `medium`, `large` and `null`. The value is `null` when the script is not running in a widget.
* @see https://docs.scriptable.app/config/#widgetfamily
*/
widgetFamily: string;
};
/**
* _Adds messages to the log._
* @see https://docs.scriptable.app/console
*/
declare var console: {
/**
* _Logs a message to the console._
*
* The message will have a default appearance. Refer to `console.error(message)` to log errors.
*
* You can also use the global function `log(message)` which is a shorthand for `console.log`.
* @param message - Message to log to the console.
* @see https://docs.scriptable.app/console/#log
*/
log(message: any): void;
/**
* _Logs a warning message to the console._
*
* The message will have a distinctive appearance. Refer to `console.log(message)` to log informative messages and `console.error(message)` to log errors.
*
* You can also use the global function `logWarning(message)` which is a shorthand for `console.warn`.
* @param message - Message to log to the console.
* @see https://docs.scriptable.app/console/#warn
*/
warn(message: any): void;
/**
* _Logs an error message to the console._
*
* The message will have a distinctive appearance. Refer to `console.log(message)` to log informative message and `console.warn(message)` to log warnings.
*
* You can also use the global function `logError(message)` which is a shorthand for `console.error`.
* @param message - Message to log to the console.
* @see https://docs.scriptable.app/console/#error
*/
error(message: any): void;
};
declare namespace Contact {
interface EmailAddresses {
identifier?: string;
label?: string;
localizedLabel?: string;
value: string;
}
interface PhoneNumbers {
identifier?: string;
label?: string;
localizedLabel?: string;
value: string;
}
interface PostalAddresses {
identifier?: string;
label: string;
localizedLabel: string;
street: string;
city: string;
state: string;
postalCode: string;
country: string;
}
interface SocialProfiles {
identifier?: string;
label: string;
localizedLabel: string;
service: string;
url: string;
userIdentifier: string;
username: string;
}
}
/**
* _Contact in the address book._
*
* In order to add the contact to your address book, you must queue it for insertion using `Contact.add()`. When you're done making changes to the address book you should call
* `Contact.persistChanges()` to persist the changes.
* @see https://docs.scriptable.app/contact/#-new-contact
*/
declare class Contact {
/**
* _Uniquely identifies the contact on the device._
* @see https://docs.scriptable.app/contact/#identifier
*/
identifier: string;
/**
* _Name prefix._
* @see https://docs.scriptable.app/contact/#nameprefix
*/
namePrefix: string;
/**
* _Given name._
* @see https://docs.scriptable.app/contact/#givenname
*/
givenName: string;
/**
* _Middle name._
* @see https://docs.scriptable.app/contact/#middlename
*/
middleName: string;
/**
* _Family name._
* @see https://docs.scriptable.app/contact/#familyname
*/
familyName: string;
/**
* _Nickname._
* @see https://docs.scriptable.app/contact/#nickname
*/
nickname: string;
/**
* _Birthday._
* @see https://docs.scriptable.app/contact/#birthday
*/
birthday: Date;
/**
* _Profile picture._
* @see https://docs.scriptable.app/contact/#image
*/
image: Image;
/**
* _Email addresses._
*
* An array of objects on the following form:
*
* {
* "identifier": "UUID-ABC-123",
* "label": "Home",
* "localizedLabel": "Home",
* "value": "my@example.com"
* }
*
* The identifier uniquely identifies the email address on this device. The label is a description of the email address and the value holds the email address itself.
*
* When updating this property, you must set the entire array of email addresses that you would like to store on the contact. Each value in the array must have the "value" key. The
* other keys are optional.
* @see https://docs.scriptable.app/contact/#emailaddresses
*/
emailAddresses: Contact.EmailAddresses[];
/**
* _Phone numbers._
*
* An array of objects on the following form:
*
* {
* "identifier": "UUID-ABC-123",
* "label": "Home",
* "localizedLabel": "Home",
* "value": "(111)234-5678"
* }
*
* The identifier uniquely identifies the phone number on this device. The label is a description of the phone number and the value holds the phone number itself.
*
* When updating this property, you must set the entire array of phone numbers that you would like to store on the contact. Each value in the array must have the "value" key. The
* other keys are optional.
* @see https://docs.scriptable.app/contact/#phonenumbers
*/
phoneNumbers: Contact.PhoneNumbers[];
/**
* _Postal addresses._
*
* An array of objects on the following form:
*
* {
* "identifier": "UUID-ABC-123",
* "label": "Home",
* "localizedLabel": "Home",
* "street": "240 Terry Lane",
* "city": "New York",
* "state": "New York",
* "postalCode": "10001",
* "country": "United States of America"
* }
*
* The identifier uniquely identifies the postal address on this device. The label is a description of the postal address.
*
* When updating this property, you must set the entire array of postal addresses that you would like to store on the contact. The "identifier" key is optional.
* @see https://docs.scriptable.app/contact/#postaladdresses
*/
postalAddresses: Contact.PostalAddresses[];
/**
* _Social profiles._