-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOmniFocus.d.ts
1700 lines (1423 loc) · 44.6 KB
/
OmniFocus.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
// From Omni Automation... doc, Release Notes, Jan 5th 2021, "Typescript API definitions" link
// TypeScript definitions for OmniFocus 3.11.7 (149.14) on macOS 10.15.7
// Generated on 2021-05-31 08:03:26 +0000
// To use these definitions, save this file as `OmniFocus.d.ts`
// and create a `tsconfig.json` file with compiler settings which indicate
// an appropriate set of implicitly defined TypeScript libraries:
//
// {
// "compilerOptions": {
// "lib": ["es7"]
// }
// }
// Alert
declare class Alert {
constructor (title: string, message: string);
show(callback: Function | null): Promise<number>;
addOption(string: string);
}
// Application
declare class Application {
openDocument(from: Document | null, url: URL, completed: Function);
readonly buildVersion: Version;
readonly commandKeyDown: boolean;
readonly controlKeyDown: boolean;
readonly name: string;
readonly optionKeyDown: boolean;
readonly platformName: string;
readonly shiftKeyDown: boolean;
readonly userVersion: Version;
readonly version: string;
}
// ApplyResult
declare namespace ApplyResult {
const SkipChildren: ApplyResult;
const SkipPeers: ApplyResult;
const Stop: ApplyResult;
const all: Array<ApplyResult>;
}
declare class ApplyResult {
}
// FolderArray
declare class FolderArray extends Array {
byName(name: string): Folder | null;
}
// ProjectArray
declare class ProjectArray extends Array {
byName(name: string): Project | null;
}
// SectionArray
declare class SectionArray extends Array {
byName(name: string): Project | Folder | null;
}
// Library
declare class Library extends SectionArray {
apply(f: Function): ApplyResult | null;
readonly beginning: Folder.ChildInsertionLocation;
readonly ending: Folder.ChildInsertionLocation;
}
// TagArray
declare class TagArray extends Array {
byName(name: string): Tag | null;
}
// Tags
declare class Tags extends TagArray {
apply(f: Function): ApplyResult | null;
readonly beginning: Tag.ChildInsertionLocation;
readonly ending: Tag.ChildInsertionLocation;
}
// TaskArray
declare class TaskArray extends Array {
byName(name: string): Task | null;
}
// Inbox
declare class Inbox extends TaskArray {
apply(f: Function): ApplyResult | null;
readonly beginning: Task.ChildInsertionLocation;
readonly ending: Task.ChildInsertionLocation;
}
// Calendar
declare namespace Calendar {
const buddhist: Calendar;
const chinese: Calendar;
const coptic: Calendar;
const current: Calendar;
const ethiopicAmeteAlem: Calendar;
const ethiopicAmeteMihret: Calendar;
const gregorian: Calendar;
const hebrew: Calendar;
const indian: Calendar;
const islamic: Calendar;
const islamicCivil: Calendar;
const islamicTabular: Calendar;
const islamicUmmAlQura: Calendar;
const iso8601: Calendar;
const japanese: Calendar;
const persian: Calendar;
const republicOfChina: Calendar;
}
declare class Calendar {
dateByAddingDateComponents(date: Date, components: DateComponents): Date | null;
dateFromDateComponents(components: DateComponents): Date | null;
dateComponentsFromDate(date: Date): DateComponents;
dateComponentsBetweenDates(start: Date, end: Date): DateComponents;
startOfDay(date: Date): Date;
readonly identifier: string;
readonly locale: Locale | null;
readonly timeZone: TimeZone;
}
// Color
declare namespace Color {
function RGB(r: number, g: number, b: number, a: number | null): Color;
function HSB(h: number, s: number, b: number, a: number | null): Color;
function White(w: number, a: number | null): Color;
const black: Color;
const blue: Color;
const brown: Color;
const clear: Color;
const cyan: Color;
const darkGray: Color;
const gray: Color;
const green: Color;
const lightGray: Color;
const magenta: Color;
const orange: Color;
const purple: Color;
const red: Color;
const white: Color;
const yellow: Color;
}
declare class Color {
blend(otherColor: Color, fraction: number): Color | null;
readonly alpha: number;
readonly blue: number;
readonly brightness: number;
readonly colorSpace: ColorSpace;
readonly green: number;
readonly hue: number;
readonly red: number;
readonly saturation: number;
readonly white: number;
}
// ColorSpace
declare namespace ColorSpace {
const CMYK: ColorSpace;
const HSB: ColorSpace;
const Named: ColorSpace;
const Pattern: ColorSpace;
const RGB: ColorSpace;
const White: ColorSpace;
const all: Array<ColorSpace>;
}
declare class ColorSpace {
}
// Console
declare class Console {
log(message: Object, additional: Array<Object | null>);
error(message: Object, additional: Array<Object | null>);
info(message: Object, additional: Array<Object | null>);
warn(message: Object, additional: Array<Object | null>);
clear();
}
// Credentials
declare class Credentials {
constructor ();
read(service: string): object | null;
write(service: string, username: string, password: string);
remove(service: string);
readBookmark(service: string): URL.Bookmark | null;
writeBookmark(service: string, bookmark: URL.Bookmark);
}
// Data
declare namespace Data {
function fromString(string: string): Data;
function fromBase64(string: string): Data;
}
declare class Data {
toString(): string;
toBase64(): string;
readonly length: number;
readonly toObject: Object | null;
}
// Database
declare class Database {
tagNamed(name: string): Tag | null;
folderNamed(name: string): Folder | null;
projectNamed(name: string): Project | null;
projectsMatching(search: string): Array<Project>;
foldersMatching(search: string): Array<Folder>;
tagsMatching(search: string): Array<Tag>;
taskNamed(name: string): Task | null;
save();
moveTasks(tasks: Array<Task>, position: Project | Task | Task.ChildInsertionLocation);
duplicateTasks(tasks: Array<Task>, position: Project | Task | Task.ChildInsertionLocation): TaskArray;
convertTasksToProjects(tasks: Array<Task>, position: Folder | Folder.ChildInsertionLocation): Array<Project>;
moveSections(sections: Array<Project | Folder>, position: Folder | Folder.ChildInsertionLocation);
duplicateSections(sections: Array<Project | Folder>, position: Folder | Folder.ChildInsertionLocation): SectionArray;
moveTags(tags: Array<Tag>, position: Tag | Tag.ChildInsertionLocation);
duplicateTags(tags: Array<Tag>, position: Tag | Tag.ChildInsertionLocation): TagArray;
cleanUp();
undo();
redo();
deleteObject(object: DatabaseObject);
copyTasksToPasteboard(tasks: Array<Task>, pasteboard: Pasteboard);
canPasteTasks(pasteboard: Pasteboard): boolean;
pasteTasksFromPasteboard(pasteboard: Pasteboard): Array<Task>;
readonly canRedo: boolean;
readonly canUndo: boolean;
readonly document: DatabaseDocument | null;
readonly flattenedFolders: FolderArray;
readonly flattenedProjects: ProjectArray;
readonly flattenedSections: SectionArray;
readonly flattenedTags: TagArray;
readonly flattenedTasks: TaskArray;
readonly folders: FolderArray;
readonly inbox: Inbox;
readonly library: Library;
readonly projects: ProjectArray;
readonly settings: Settings;
readonly tags: Tags;
}
// DatabaseObject
declare class DatabaseObject {
readonly id: ObjectIdentifier;
}
// DatedObject
declare class DatedObject extends DatabaseObject {
added: Date | null;
modified: Date | null;
}
// ActiveObject
declare class ActiveObject extends DatedObject {
active: boolean;
readonly effectiveActive: boolean;
}
// Folder
declare namespace Folder {
function byIdentifier(identifier: string): Folder | null;
}
declare class Folder extends ActiveObject {
constructor (name: string, position: Folder | Folder.ChildInsertionLocation | null);
folderNamed(name: string): Folder | null;
projectNamed(name: string): Project | null;
sectionNamed(name: string): Project | Folder | null;
childNamed(name: string): Project | Folder | null;
apply(f: Function): ApplyResult | null;
readonly after: Folder.ChildInsertionLocation;
readonly before: Folder.ChildInsertionLocation;
readonly beginning: Folder.ChildInsertionLocation;
readonly children: SectionArray;
readonly ending: Folder.ChildInsertionLocation;
readonly flattenedChildren: SectionArray;
readonly flattenedFolders: FolderArray;
readonly flattenedProjects: ProjectArray;
readonly flattenedSections: SectionArray;
readonly folders: FolderArray;
name: string;
readonly parent: Folder | null;
readonly projects: ProjectArray;
readonly sections: SectionArray;
status: Folder.Status;
}
// Tag
declare namespace Tag {
function byIdentifier(identifier: string): Tag | null;
const forecastTag: Tag | null;
}
declare class Tag extends ActiveObject {
constructor (name: string, position: Tag | Tag.ChildInsertionLocation | null);
tagNamed(name: string): Tag | null;
childNamed(name: string): Tag | null;
apply(f: Function): ApplyResult | null;
readonly after: Tag.ChildInsertionLocation;
allowsNextAction: boolean;
readonly availableTasks: TaskArray;
readonly before: Tag.ChildInsertionLocation;
readonly beginning: Tag.ChildInsertionLocation;
readonly children: TagArray;
readonly ending: Tag.ChildInsertionLocation;
readonly flattenedChildren: TagArray;
readonly flattenedTags: TagArray;
name: string;
readonly parent: Tag | null;
readonly projects: ProjectArray;
readonly remainingTasks: TaskArray;
status: Tag.Status;
readonly tags: TagArray;
readonly tasks: TaskArray;
}
// Task
declare namespace Task {
function byParsingTransportText(text: string, singleTask: boolean | null): Array<Task>;
function byIdentifier(identifier: string): Task | null;
}
declare class Task extends ActiveObject {
constructor (name: string, position: Project | Task | Task.ChildInsertionLocation | null);
taskNamed(name: string): Task | null;
childNamed(name: string): Task | null;
appendStringToNote(stringToAppend: string);
addLinkedFileURL(url: URL);
removeLinkedFileWithURL(url: URL);
addAttachment(attachment: FileWrapper);
removeAttachmentAtIndex(index: number);
addTag(tag: Tag);
addTags(tags: Array<Tag>);
removeTag(tag: Tag);
removeTags(tags: Array<Tag>);
clearTags();
markComplete(date: Date | null): Task;
markIncomplete();
drop(allOccurrences: boolean);
apply(f: Function): ApplyResult | null;
addNotification(info: number | Date): Task.Notification;
removeNotification(notification: Task.Notification);
readonly after: Task.ChildInsertionLocation;
assignedContainer: Project | Task | Inbox | null;
attachments: Array<FileWrapper>;
readonly before: Task.ChildInsertionLocation;
readonly beginning: Task.ChildInsertionLocation;
readonly children: TaskArray;
readonly completed: boolean;
completedByChildren: boolean;
readonly completionDate: Date | null;
readonly containingProject: Project | null;
deferDate: Date | null;
readonly dropDate: Date | null;
dueDate: Date | null;
readonly effectiveCompletedDate: Date | null;
readonly effectiveDeferDate: Date | null;
readonly effectiveDropDate: Date | null;
readonly effectiveDueDate: Date | null;
readonly effectiveFlagged: boolean;
readonly ending: Task.ChildInsertionLocation;
estimatedMinutes: number | null;
flagged: boolean;
readonly flattenedChildren: TaskArray;
readonly flattenedTasks: TaskArray;
readonly hasChildren: boolean;
readonly inInbox: boolean;
readonly linkedFileURLs: Array<URL>;
name: string;
note: string;
readonly notifications: Array<Task.Notification>;
readonly parent: Task | null;
readonly project: Project | null;
repetitionRule: Task.RepetitionRule | null;
sequential: boolean;
shouldUseFloatingTimeZone: boolean;
readonly tags: TagArray;
readonly taskStatus: Task.Status;
readonly tasks: TaskArray;
}
// Perspective.Custom
declare namespace Perspective.Custom {
function byName(name: string): Perspective.Custom | null;
function byIdentifier(identifier: string): Perspective.Custom | null;
const all: Array<Perspective.Custom>;
}
declare namespace Perspective {
class Custom extends DatedObject {
fileWrapper(): FileWrapper;
writeFileRepresentationIntoDirectory(parentURL: URL): URL;
readonly identifier: string;
readonly name: string;
}
}
// Task.Notification
declare namespace Task {
class Notification extends DatedObject {
absoluteFireDate: Date;
readonly initialFireDate: Date;
readonly isSnoozed: boolean;
readonly kind: Task.Notification.Kind;
readonly nextFireDate: Date | null;
relativeFireOffset: number;
repeatInterval: number;
readonly task: Task | null;
readonly usesFloatingTimeZone: boolean;
}
}
// Project
declare namespace Project {
function byIdentifier(identifier: string): Project | null;
}
declare class Project extends DatabaseObject {
constructor (name: string, position: Folder | Folder.ChildInsertionLocation | null);
taskNamed(name: string): Task | null;
appendStringToNote(stringToAppend: string);
addAttachment(attachment: FileWrapper);
removeAttachmentAtIndex(index: number);
markComplete(date: Date | null): Task;
markIncomplete();
addNotification(info: number | Date): Task.Notification;
removeNotification(notification: Task.Notification);
addTag(tag: Tag);
addTags(tags: Array<Tag>);
removeTag(tag: Tag);
removeTags(tags: Array<Tag>);
clearTags();
addLinkedFileURL(url: URL);
removeLinkedFileWithURL(url: URL);
readonly after: Folder.ChildInsertionLocation;
attachments: Array<FileWrapper>;
readonly before: Folder.ChildInsertionLocation;
readonly beginning: Task.ChildInsertionLocation;
readonly children: TaskArray;
readonly completed: boolean;
completedByChildren: boolean;
completionDate: Date | null;
containsSingletonActions: boolean;
defaultSingletonActionHolder: boolean;
deferDate: Date | null;
dropDate: Date | null;
dueDate: Date | null;
readonly effectiveCompletedDate: Date | null;
readonly effectiveDeferDate: Date | null;
readonly effectiveDropDate: Date | null;
readonly effectiveDueDate: Date | null;
readonly effectiveFlagged: boolean;
readonly ending: Task.ChildInsertionLocation;
estimatedMinutes: number | null;
flagged: boolean;
readonly flattenedChildren: TaskArray;
readonly flattenedTasks: TaskArray;
readonly hasChildren: boolean;
lastReviewDate: Date | null;
readonly linkedFileURLs: Array<URL>;
name: string;
nextReviewDate: Date | null;
readonly nextTask: Task | null;
note: string;
readonly notifications: Array<Task.Notification>;
readonly parentFolder: Folder | null;
repetitionRule: Task.RepetitionRule | null;
reviewInterval: Project.ReviewInterval;
sequential: boolean;
shouldUseFloatingTimeZone: boolean;
status: Project.Status;
readonly tags: TagArray;
readonly task: Task;
readonly taskStatus: Task.Status;
readonly tasks: TaskArray;
}
// DateComponents
declare class DateComponents {
constructor ();
readonly date: Date | null;
day: number | null;
era: number | null;
hour: number | null;
minute: number | null;
month: number | null;
nanosecond: number | null;
second: number | null;
timeZone: TimeZone | null;
year: number | null;
}
// DateRange
declare class DateRange {
readonly end: Date;
readonly name: string;
readonly start: Date;
}
// Decimal
declare namespace Decimal {
function fromString(string: string): Decimal;
const maximum: Decimal;
const minimum: Decimal;
const notANumber: Decimal;
const one: Decimal;
const zero: Decimal;
}
declare class Decimal {
toString(): string;
add(number: Decimal): Decimal;
subtract(number: Decimal): Decimal;
multiply(number: Decimal): Decimal;
divide(number: Decimal): Decimal;
compare(number: Decimal): number;
equals(number: Decimal): boolean;
}
// Device
declare namespace Device {
const current: Device;
}
declare class Device {
readonly iOS: boolean;
readonly iPad: boolean;
readonly mac: boolean;
readonly operatingSystemVersion: Version;
readonly type: DeviceType | null;
}
// DeviceType
declare namespace DeviceType {
const all: Array<DeviceType>;
const iPad: DeviceType;
const iPhone: DeviceType;
const mac: DeviceType;
}
declare class DeviceType {
}
// Document
declare namespace Document {
function makeNew(resultFunction: Function | null): Promise<Document>;
function makeNewAndShow(resultFunction: Function | null): Promise<Document>;
}
declare class Document {
close(didCancel: Function | null);
save();
fileWrapper(type: string | null): FileWrapper;
makeFileWrapper(baseName: string, type: string | null): Promise<FileWrapper>;
undo();
redo();
show(resultFunction: Function | null);
readonly canRedo: boolean;
readonly canUndo: boolean;
readonly fileType: string | null;
readonly name: string | null;
readonly writableTypes: Array<string>;
}
// DatabaseDocument
declare class DatabaseDocument extends Document {
newWindow(): Promise<DocumentWindow>;
newTabOnWindow(window: DocumentWindow): Promise<DocumentWindow>;
readonly windows: Array<DocumentWindow>;
}
// Email
declare class Email {
constructor ();
generate();
blindCarbonCopy: string | Array<string> | null;
body: string | null;
carbonCopy: string | Array<string> | null;
fileWrappers: Array<FileWrapper>;
receiver: string | Array<string> | null;
subject: string | null;
}
// FilePicker
declare class FilePicker {
constructor ();
show(): Promise<Array<URL>>;
folders: boolean;
message: string;
multiple: boolean;
types: Array<TypeIdentifier> | null;
}
// FileSaver
declare class FileSaver {
constructor ();
show(fileWrapper: FileWrapper): Promise<URL>;
message: string;
nameLabel: string;
prompt: string;
types: Array<TypeIdentifier> | null;
}
// FileWrapper
declare namespace FileWrapper {
function withContents(name: string | null, contents: Data): FileWrapper;
function withChildren(name: string | null, children: Array<FileWrapper>): FileWrapper;
}
declare class FileWrapper {
filenameForChild(child: FileWrapper): string | null;
readonly children: Array<FileWrapper>;
readonly contents: Data | null;
readonly destination: URL | null;
filename: string | null;
preferredFilename: string | null;
readonly type: FileWrapper.Type;
}
// FileWrapper.Type
declare namespace FileWrapper.Type {
const Directory: FileWrapper.Type;
const File: FileWrapper.Type;
const Link: FileWrapper.Type;
const all: Array<FileWrapper.Type>;
}
declare namespace FileWrapper {
class Type {
}
}
// Folder.ChildInsertionLocation
declare namespace Folder {
class ChildInsertionLocation {
}
}
// Folder.Status
declare namespace Folder.Status {
const Active: Folder.Status;
const Dropped: Folder.Status;
const all: Array<Folder.Status>;
}
declare namespace Folder {
class Status {
}
}
// ForecastDay
declare namespace ForecastDay {
let badgeCountsIncludeDeferredItems: boolean;
}
declare class ForecastDay {
badgeKind(): ForecastDay.Status;
readonly badgeCount: number;
readonly date: Date;
readonly deferredCount: number;
readonly kind: ForecastDay.Kind;
readonly name: string;
}
// ForecastDay.Kind
declare namespace ForecastDay.Kind {
const Day: ForecastDay.Kind;
const DistantFuture: ForecastDay.Kind;
const FutureMonth: ForecastDay.Kind;
const Past: ForecastDay.Kind;
const Today: ForecastDay.Kind;
const all: Array<ForecastDay.Kind>;
}
declare namespace ForecastDay {
class Kind {
}
}
// ForecastDay.Status
declare namespace ForecastDay.Status {
const Available: ForecastDay.Status;
const DueSoon: ForecastDay.Status;
const NoneAvailable: ForecastDay.Status;
const Overdue: ForecastDay.Status;
const all: Array<ForecastDay.Status>;
}
declare namespace ForecastDay {
class Status {
}
}
// Form
declare class Form {
constructor ();
addField(field: Form.Field, index: number | null);
removeField(field: Form.Field);
show(title: string, confirmTitle: string): Promise<Form>;
readonly fields: Array<Form.Field>;
validate: Function | null;
readonly values: Object;
}
// Form.Field
declare namespace Form {
class Field {
readonly displayName: string | null;
readonly key: string;
}
}
// Form.Field.Checkbox
declare namespace Form.Field {
class Checkbox extends Form.Field {
constructor (key: string, displayName: string | null, value: boolean | null);
}
}
// Form.Field.Date
declare namespace Form.Field {
class Date extends Form.Field {
constructor (key: string, displayName: string | null, value: Date | null, formatter: Formatter.Date | null);
}
}
// Form.Field.MultipleOptions
declare namespace Form.Field {
class MultipleOptions extends Form.Field {
constructor (key: string, displayName: string | null, options: Array<Object>, names: Array<string> | null, selected: Array<Object>);
}
}
// Form.Field.Option
declare namespace Form.Field {
class Option extends Form.Field {
constructor (key: string, displayName: string | null, options: Array<Object>, names: Array<string> | null, selected: Object | null, nullOptionTitle: string | null);
allowsNull: boolean;
nullOptionTitle: string | null;
}
}
// Form.Field.Password
declare namespace Form.Field {
class Password extends Form.Field {
constructor (key: string, displayName: string | null, value: string | null);
}
}
// Form.Field.String
declare namespace Form.Field {
class String extends Form.Field {
constructor (key: string, displayName: string | null, value: Object | null, formatter: Formatter | null);
}
}
// Formatter
declare class Formatter {
}
// Formatter.Date
declare namespace Formatter.Date {
function withStyle(dateStyle: Formatter.Date.Style, timeStyle: Formatter.Date.Style | null): Formatter.Date;
function withFormat(format: string): Formatter.Date;
const iso8601: Formatter.Date;
}
declare namespace Formatter {
class Date extends Formatter {
stringFromDate(date: Date): string;
dateFromString(string: string): Date | null;
calendar: Calendar;
readonly dateFormat: string;
locale: Locale;
timeZone: TimeZone;
}
}
// Formatter.Decimal
declare namespace Formatter.Decimal {
function currency(code: string | null): Formatter.Decimal;
const currencyCodes: Array<string>;
const custom: Formatter.Decimal;
const decimal: Formatter.Decimal;
const percent: Formatter.Decimal;
const percentWithDecimal: Formatter.Decimal;
const plain: Formatter.Decimal;
const thousandsAndDecimal: Formatter.Decimal;
}
declare namespace Formatter {
class Decimal extends Formatter {
stringFromDecimal(number: Decimal): string | null;
decimalFromString(string: string): Decimal | null;
decimalSeparator: string;
negativeFormat: string;
positiveFormat: string;
thousandsSeparator: string | null;
zeroSymbol: string | null;
}
}
// Formatter.Duration
declare namespace Formatter {
class Duration extends Formatter {
constructor ();
stringFromDecimal(number: Decimal): string | null;
decimalFromString(string: string): Decimal | null;
hoursPerDay: number;
hoursPerWeek: number;
useVerboseFormat: boolean;
}
}
// Formatter.Date.Style
declare namespace Formatter.Date.Style {
const Full: Formatter.Date.Style;
const Long: Formatter.Date.Style;
const Medium: Formatter.Date.Style;
const Short: Formatter.Date.Style;
const all: Array<Formatter.Date.Style>;
}
declare namespace Formatter.Date {
class Style {
}
}
// Image
declare class Image {
}
// LigatureStyle
declare namespace LigatureStyle {
const All: LigatureStyle;
const Essential: LigatureStyle;
const Standard: LigatureStyle;
const all: Array<LigatureStyle>;
}
declare class LigatureStyle {
}
// Locale
declare namespace Locale {
const identifiers: Array<string>;
}
declare class Locale {
constructor (identifier: string);
readonly calendar: Calendar;
readonly currencyCode: string | null;
readonly identifier: string;
}
// MenuItem
declare class MenuItem {
checked: boolean;
label: string;
}
// NamedStyle.List
declare namespace NamedStyle {
class List {
add(name: string | null): NamedStyle;
byName(name: string): NamedStyle | null;
byIdentifier(identifier: string): NamedStyle | null;
moveStyles(styles: Array<NamedStyle>, position: NamedStylePosition);
duplicateStyles(styles: Array<NamedStyle>, position: NamedStylePosition): Array<NamedStyle>;
readonly all: Array<NamedStyle>;
readonly beginning: NamedStylePosition;
readonly end: NamedStylePosition;
}
}
// NamedStylePosition
declare class NamedStylePosition {
}
// ObjectIdentifier
declare class ObjectIdentifier {
readonly objectClass: Object | null;
readonly primaryKey: string;
}
// Pasteboard
declare namespace Pasteboard {
function makeUnique(): Pasteboard;
const general: Pasteboard;
}
declare class Pasteboard {
availableType(types: Array<TypeIdentifier>): TypeIdentifier | null;
addItems(items: Array<Pasteboard.Item>);
clear();
dataForType(type: TypeIdentifier): Data | null;
setDataForType(data: Data, type: TypeIdentifier);
stringForType(type: TypeIdentifier): string | null;
setStringForType(string: string, type: TypeIdentifier);
URL: URL | null;
URLs: Array<URL> | null;
color: Color | null;
colors: Array<Color> | null;
readonly hasColors: boolean;
readonly hasImages: boolean;
readonly hasStrings: boolean;
readonly hasURLs: boolean;
image: Image | null;
images: Array<Image> | null;
items: Array<Pasteboard.Item>;
string: string | null;
strings: Array<string> | null;
readonly types: Array<TypeIdentifier>;
}
// Pasteboard.Item
declare namespace Pasteboard {
class Item {
constructor ();
dataForType(type: TypeIdentifier): Data | null;
setDataForType(data: Data, type: TypeIdentifier);
stringForType(type: TypeIdentifier): string | null;
setStringForType(string: string, type: TypeIdentifier);
readonly types: Array<TypeIdentifier>;
}
}
// Perspective