summaryrefslogtreecommitdiffstats
path: root/comm/mail/components/extensions/schemas/compose.json
blob: f6915fc363939f25ebafed2957de62c2f6ace059 (plain)
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
[
  {
    "namespace": "manifest",
    "types": [
      {
        "$extend": "OptionalPermission",
        "choices": [
          {
            "type": "string",
            "enum": ["compose", "compose.save", "compose.send"]
          }
        ]
      }
    ]
  },
  {
    "namespace": "compose",
    "types": [
      {
        "id": "ComposeRecipient",
        "choices": [
          {
            "type": "string",
            "description": "A name and email address in the format <value>Name <email@example.com></value>, or just an email address."
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The ID of a contact or mailing list from the :doc:`contacts` and :doc:`mailingLists` APIs."
              },
              "type": {
                "type": "string",
                "description": "Which sort of object this ID is for.",
                "enum": ["contact", "mailingList"]
              }
            }
          }
        ]
      },
      {
        "id": "ComposeRecipientList",
        "choices": [
          {
            "$ref": "ComposeRecipient"
          },
          {
            "type": "array",
            "items": {
              "$ref": "ComposeRecipient"
            }
          }
        ]
      },
      {
        "id": "ComposeState",
        "type": "object",
        "description": "Represent the state of the message composer.",
        "properties": {
          "canSendNow": {
            "type": "boolean",
            "description": "The message can be send now."
          },
          "canSendLater": {
            "type": "boolean",
            "description": "The message can be send later."
          }
        }
      },
      {
        "id": "ComposeDetails",
        "type": "object",
        "description": "Used by various functions to represent the state of a message being composed. Note that functions using this type may have a partial implementation.",
        "properties": {
          "identityId": {
            "type": "string",
            "description": "The ID of an identity from the :doc:`accounts` API. The settings from the identity will be used in the composed message. If ``replyTo`` is also specified, the ``replyTo`` property of the identity is overridden. The permission <permission>accountsRead</permission> is required to include the ``identityId``.",
            "optional": true
          },
          "from": {
            "$ref": "ComposeRecipient",
            "description": "*Caution*: Setting a value for ``from`` does not change the used identity, it overrides the FROM header. Many email servers do not accept emails where the FROM header does not match the sender identity. Must be set to exactly one valid email address.",
            "optional": true
          },
          "to": {
            "$ref": "ComposeRecipientList",
            "optional": true
          },
          "cc": {
            "$ref": "ComposeRecipientList",
            "optional": true
          },
          "bcc": {
            "$ref": "ComposeRecipientList",
            "optional": true
          },
          "overrideDefaultFcc": {
            "type": "boolean",
            "optional": true,
            "description": "Indicates whether the default fcc setting (defined by the used identity) is being overridden for this message. Setting <value>false</value> will clear the override. Setting <value>true</value> will throw an <em>ExtensionError</em>, if ``overrideDefaultFccFolder`` is not set as well."
          },
          "overrideDefaultFccFolder": {
            "choices": [
              {
                "$ref": "folders.MailFolder"
              },
              {
                "type": "string",
                "enum": [""]
              }
            ],
            "optional": true,
            "description": " This value overrides the default fcc setting (defined by the used identity) for this message only. Either a :ref:`folders.MailFolder` specifying the folder for the copy of the sent message, or an empty string to not save a copy at all."
          },
          "additionalFccFolder": {
            "choices": [
              {
                "$ref": "folders.MailFolder"
              },
              {
                "type": "string",
                "enum": [""]
              }
            ],
            "description": "An additional fcc folder which can be selected while composing the message, an empty string if not used.",
            "optional": true
          },
          "replyTo": {
            "$ref": "ComposeRecipientList",
            "optional": true
          },
          "followupTo": {
            "$ref": "ComposeRecipientList",
            "optional": true
          },
          "newsgroups": {
            "description": "A single newsgroup name or an array of newsgroup names.",
            "choices": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "optional": true
          },
          "relatedMessageId": {
            "description": "The id of the original message (in case of draft, template, forward or reply). Read-only. Is <value>null</value> in all other cases or if the original message was opened from file.",
            "type": "integer",
            "optional": true
          },
          "subject": {
            "type": "string",
            "optional": true
          },
          "type": {
            "type": "string",
            "description": "Read-only. The type of the message being composed, depending on how the compose window was opened by the user.",
            "enum": ["draft", "new", "redirect", "reply", "forward"],
            "optional": true
          },
          "body": {
            "type": "string",
            "description": "The HTML content of the message.",
            "optional": true
          },
          "plainTextBody": {
            "type": "string",
            "description": "The plain text content of the message.",
            "optional": true
          },
          "isPlainText": {
            "type": "boolean",
            "description": "Whether the message is an HTML message or a plain text message.",
            "optional": true
          },
          "deliveryFormat": {
            "type": "string",
            "enum": ["auto", "plaintext", "html", "both"],
            "description": "Defines the mime format of the sent message (ignored on plain text messages). Defaults to <value>auto</value>, which will send html messages as plain text, if they do not include any formatting, and as <value>both</value> otherwise (a multipart/mixed message).",
            "optional": true
          },
          "customHeaders": {
            "type": "array",
            "items": {
              "$ref": "CustomHeader"
            },
            "description": "Array of custom headers. Headers will be returned in <em>Http-Header-Case</em> (a.k.a. <em>Train-Case</em>). Set an empty array to clear all custom headers.",
            "optional": true
          },
          "priority": {
            "type": "string",
            "enum": ["lowest", "low", "normal", "high", "highest"],
            "description": "The priority of the message.",
            "optional": true
          },
          "returnReceipt": {
            "type": "boolean",
            "optional": true,
            "description": "Add the <em>Disposition-Notification-To</em> header to the message to requests the recipients email client to send a reply once the message has been received. Recipient server may strip the header and the recipient might ignore the request."
          },
          "deliveryStatusNotification": {
            "type": "boolean",
            "optional": true,
            "description": "Let the sender know when the recipient's server received the message. Not supported by all servers."
          },
          "attachVCard": {
            "type": "boolean",
            "optional": true,
            "description": "Wether or not the vCard of the used identity will be attached to the message during send. Note: If the value has not been modified, selecting a different identity will load the default value of the new identity."
          },
          "attachments": {
            "type": "array",
            "items": {
              "choices": [
                {
                  "$ref": "FileAttachment"
                },
                {
                  "$ref": "ComposeAttachment"
                }
              ]
            },
            "description": "Only used in the begin* functions. Attachments to add to the message.",
            "optional": true
          }
        }
      },
      {
        "id": "FileAttachment",
        "type": "object",
        "description": "Object used to add, update or rename an attachment in a message being composed.",
        "properties": {
          "file": {
            "type": "object",
            "isInstanceOf": "File",
            "additionalProperties": true,
            "description": "The new content for the attachment.",
            "optional": true
          },
          "name": {
            "type": "string",
            "description": "The new name for the attachment, as displayed to the user. If not specified, the name of the provided ``file`` object is used.",
            "optional": true
          }
        }
      },
      {
        "id": "ComposeAttachment",
        "type": "object",
        "description": "Represents an attachment in a message being composed.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "A unique identifier for this attachment."
          },
          "name": {
            "type": "string",
            "optional": true,
            "description": "The name of this attachment, as displayed to the user."
          },
          "size": {
            "type": "integer",
            "optional": true,
            "description": "The size in bytes of this attachment. Read-only."
          }
        }
      },
      {
        "id": "CustomHeader",
        "type": "object",
        "description": "A custom header definition.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of a custom header, must have a <value>X-</value> prefix.",
            "pattern": "^X-.*$"
          },
          "value": {
            "type": "string"
          }
        }
      },
      {
        "id": "ComposeDictionaries",
        "type": "object",
        "additionalProperties": {
          "type": "boolean"
        },
        "description": "A <em>dictionary object</em> with entries for all installed dictionaries, having a language identifier as <em>key</em> (for example <value>en-US</value>) and a boolean expression as <em>value</em>, indicating whether that dictionary is enabled for spellchecking or not."
      }
    ],
    "events": [
      {
        "name": "onBeforeSend",
        "type": "function",
        "description": "Fired when a message is about to be sent from the compose window. This is a user input event handler. For asynchronous listeners some `restrictions <|link-user-input-restrictions|>`__ apply.",
        "permissions": ["compose"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "details",
            "$ref": "ComposeDetails",
            "description": "The current state of the compose window. This is functionally the same as calling the :ref:`compose.getComposeDetails` function."
          }
        ],
        "returns": {
          "type": "object",
          "properties": {
            "cancel": {
              "type": "boolean",
              "optional": true,
              "description": "Cancels the send."
            },
            "details": {
              "$ref": "ComposeDetails",
              "optional": true,
              "description": "Updates the compose window. This is functionally the same as calling the :ref:`compose.setComposeDetails` function."
            }
          }
        }
      },
      {
        "name": "onAfterSend",
        "type": "function",
        "description": "Fired when sending a message succeeded or failed.",
        "permissions": ["compose"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "sendInfo",
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "description": "The used send mode.",
                "enum": ["sendNow", "sendLater"]
              },
              "error": {
                "type": "string",
                "description": "An error description, if sending the message failed.",
                "optional": true
              },
              "headerMessageId": {
                "type": "string",
                "description": "The header messageId of the outgoing message. Only included for actually sent messages.",
                "optional": true
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "messages.MessageHeader"
                },
                "description": "Copies of the sent message. The number of created copies depends on the applied file carbon copy configuration (fcc)."
              }
            }
          }
        ]
      },
      {
        "name": "onAfterSave",
        "type": "function",
        "description": "Fired when saving a message as draft or template succeeded or failed.",
        "permissions": ["compose"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "saveInfo",
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "description": "The used save mode.",
                "enum": ["draft", "template"]
              },
              "error": {
                "type": "string",
                "description": "An error description, if saving the message failed.",
                "optional": true
              },
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "messages.MessageHeader"
                },
                "description": "The saved message(s). The number of saved messages depends on the applied file carbon copy configuration (fcc)."
              }
            }
          }
        ]
      },
      {
        "name": "onAttachmentAdded",
        "type": "function",
        "description": "Fired when an attachment is added to a message being composed.",
        "permissions": ["compose"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "attachment",
            "$ref": "ComposeAttachment"
          }
        ]
      },
      {
        "name": "onAttachmentRemoved",
        "type": "function",
        "description": "Fired when an attachment is removed from a message being composed.",
        "permissions": ["compose"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "attachmentId",
            "type": "integer"
          }
        ]
      },
      {
        "name": "onIdentityChanged",
        "type": "function",
        "description": "Fired when the user changes the identity that will be used to send a message being composed.",
        "permissions": ["accountsRead"],
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "identityId",
            "type": "string"
          }
        ]
      },
      {
        "name": "onComposeStateChanged",
        "type": "function",
        "description": "Fired when the state of the message composer changed.",
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "state",
            "$ref": "ComposeState"
          }
        ]
      },
      {
        "name": "onActiveDictionariesChanged",
        "type": "function",
        "description": "Fired when one or more dictionaries have been activated or deactivated.",
        "parameters": [
          {
            "name": "tab",
            "$ref": "tabs.Tab"
          },
          {
            "name": "dictionaries",
            "$ref": "ComposeDictionaries"
          }
        ]
      }
    ],
    "functions": [
      {
        "name": "beginNew",
        "type": "function",
        "description": "Open a new message compose window.\n\n**Note:** The compose format can be set by ``details.isPlainText`` or by specifying only one of ``details.body`` or ``details.plainTextBody``. Otherwise the default compose format of the selected identity is used.\n\n**Note:** Specifying ``details.body`` and ``details.plainTextBody`` without also specifying ``details.isPlainText`` threw an exception in Thunderbird up to version 97. Since Thunderbird 98, this combination creates a compose window with the compose format of the selected identity, using the matching ``details.body`` or ``details.plainTextBody`` value.\n\n**Note:** If no identity is specified, this function is using the default identity and not the identity of the referenced message.",
        "async": "callback",
        "parameters": [
          {
            "name": "messageId",
            "description": "If specified, the message or template to edit as a new message.",
            "type": "integer",
            "optional": true,
            "minimum": 1
          },
          {
            "name": "details",
            "$ref": "ComposeDetails",
            "optional": true
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "return",
                "$ref": "tabs.Tab"
              }
            ]
          }
        ]
      },
      {
        "name": "beginReply",
        "type": "function",
        "description": "Open a new message compose window replying to a given message.\n\n**Note:** The compose format can be set by ``details.isPlainText`` or by specifying only one of ``details.body`` or ``details.plainTextBody``. Otherwise the default compose format of the selected identity is used.\n\n**Note:** Specifying ``details.body`` and ``details.plainTextBody`` without also specifying ``details.isPlainText`` threw an exception in Thunderbird up to version 97. Since Thunderbird 98, this combination creates a compose window with the compose format of the selected identity, using the matching ``details.body`` or ``details.plainTextBody`` value.\n\n**Note:** If no identity is specified, this function is using the default identity and not the identity of the referenced message.",
        "async": "callback",
        "parameters": [
          {
            "name": "messageId",
            "description": "The message to reply to, as retrieved using other APIs.",
            "type": "integer",
            "minimum": 1
          },
          {
            "name": "replyType",
            "type": "string",
            "enum": ["replyToSender", "replyToList", "replyToAll"],
            "optional": true
          },
          {
            "name": "details",
            "$ref": "ComposeDetails",
            "optional": true
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "return",
                "$ref": "tabs.Tab"
              }
            ]
          }
        ]
      },
      {
        "name": "beginForward",
        "type": "function",
        "description": "Open a new message compose window forwarding a given message.\n\n**Note:** The compose format can be set by ``details.isPlainText`` or by specifying only one of ``details.body`` or ``details.plainTextBody``. Otherwise the default compose format of the selected identity is used.\n\n**Note:** Specifying ``details.body`` and ``details.plainTextBody`` without also specifying ``details.isPlainText`` threw an exception in Thunderbird up to version 97. Since Thunderbird 98, this combination creates a compose window with the compose format of the selected identity, using the matching ``details.body`` or ``details.plainTextBody`` value.\n\n**Note:** If no identity is specified, this function is using the default identity and not the identity of the referenced message.",
        "async": "callback",
        "parameters": [
          {
            "name": "messageId",
            "description": "The message to forward, as retrieved using other APIs.",
            "type": "integer",
            "minimum": 1
          },
          {
            "name": "forwardType",
            "type": "string",
            "enum": ["forwardInline", "forwardAsAttachment"],
            "optional": true
          },
          {
            "name": "details",
            "$ref": "ComposeDetails",
            "optional": true
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "return",
                "$ref": "tabs.Tab"
              }
            ]
          }
        ]
      },
      {
        "name": "getComposeDetails",
        "type": "function",
        "async": "callback",
        "description": "Fetches the current state of a compose window. Currently only a limited amount of information is available, more will be added in later versions.",
        "permissions": ["compose"],
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "ComposeDetails"
              }
            ]
          }
        ]
      },
      {
        "name": "setComposeDetails",
        "type": "function",
        "async": true,
        "description": "Updates the compose window. The properties of the given :ref:`compose.ComposeDetails` object will be used to overwrite the current values of the specified compose window, so only properties that are to be changed should be included.\n\nWhen updating any of the array properties (``customHeaders`` and most address fields), make sure to first get the current values to not accidentally remove all existing entries when setting the new value.\n\n**Note:** The compose format of an existing compose window cannot be changed. Since Thunderbird 98, setting conflicting values for ``details.body``, ``details.plainTextBody`` or ``details.isPlaintext`` no longer throws an exception, instead the compose window chooses the matching ``details.body`` or ``details.plainTextBody`` value and ignores the other.",
        "permissions": ["compose"],
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "name": "details",
            "$ref": "ComposeDetails"
          }
        ]
      },
      {
        "name": "getActiveDictionaries",
        "type": "function",
        "async": "callback",
        "description": "Returns a :ref:`compose.ComposeDictionaries` object, listing all installed dictionaries, including the information whether they are currently enabled or not.",
        "permissions": ["compose"],
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "ComposeDictionaries"
              }
            ]
          }
        ]
      },
      {
        "name": "setActiveDictionaries",
        "type": "function",
        "async": true,
        "description": "Updates the active dictionaries. Throws if the ``activeDictionaries`` array contains unknown or invalid language identifiers.",
        "permissions": ["compose"],
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "name": "activeDictionaries"
          }
        ]
      },
      {
        "name": "listAttachments",
        "type": "function",
        "description": "Lists all of the attachments of the message being composed in the specified tab.",
        "permissions": ["compose"],
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "type": "array",
                "items": {
                  "$ref": "ComposeAttachment"
                }
              }
            ]
          }
        ]
      },
      {
        "name": "getAttachmentFile",
        "type": "function",
        "description": "Gets the content of a :ref:`compose.ComposeAttachment` as a |File| object.",
        "async": "callback",
        "parameters": [
          {
            "name": "id",
            "type": "integer",
            "description": "The unique identifier for the attachment."
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "type": "object",
                "isInstanceOf": "File",
                "additionalProperties": true
              }
            ]
          }
        ]
      },
      {
        "name": "addAttachment",
        "type": "function",
        "description": "Adds an attachment to the message being composed in the specified tab.",
        "permissions": ["compose"],
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer"
          },
          {
            "name": "attachment",
            "choices": [
              {
                "$ref": "FileAttachment"
              },
              {
                "$ref": "ComposeAttachment"
              }
            ]
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "ComposeAttachment"
              }
            ]
          }
        ]
      },
      {
        "name": "updateAttachment",
        "type": "function",
        "description": "Updates the name and/or the content of an attachment in the message being composed in the specified tab. If the specified attachment is a cloud file attachment and the associated provider failed to update the attachment, the function will throw an <em>ExtensionError</em>.",
        "permissions": ["compose"],
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer"
          },
          {
            "name": "attachmentId",
            "type": "integer"
          },
          {
            "name": "attachment",
            "$ref": "FileAttachment"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "$ref": "ComposeAttachment"
              }
            ]
          }
        ]
      },
      {
        "name": "removeAttachment",
        "type": "function",
        "description": "Removes an attachment from the message being composed in the specified tab.",
        "permissions": ["compose"],
        "async": true,
        "parameters": [
          {
            "name": "tabId",
            "type": "integer"
          },
          {
            "name": "attachmentId",
            "type": "integer"
          }
        ]
      },
      {
        "name": "sendMessage",
        "permissions": ["compose.send"],
        "type": "function",
        "description": "Sends the message currently being composed. If the send mode is not specified or set to <value>default</value>, the message will be send directly if the user is online and placed in the users outbox otherwise. The returned Promise fulfills once the message has been successfully sent or placed in the user's outbox. Throws when the send process has been aborted by the user, by an :ref:`compose.onBeforeSend` event or if there has been an error while sending the message to the outgoing mail server.",
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer"
          },
          {
            "name": "options",
            "type": "object",
            "optional": true,
            "properties": {
              "mode": {
                "type": "string",
                "enum": ["default", "sendNow", "sendLater"]
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "return",
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "description": "The used send mode.",
                    "enum": ["sendNow", "sendLater"]
                  },
                  "headerMessageId": {
                    "type": "string",
                    "description": "The header messageId of the outgoing message. Only included for actually sent messages.",
                    "optional": true
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "$ref": "messages.MessageHeader"
                    },
                    "description": "Copies of the sent message. The number of created copies depends on the applied file carbon copy configuration (fcc)."
                  }
                }
              }
            ]
          }
        ]
      },
      {
        "name": "saveMessage",
        "permissions": ["compose.save"],
        "type": "function",
        "description": "Saves the message currently being composed as a draft or as a template. If the save mode is not specified, the message will be saved as a draft. The returned Promise fulfills once the message has been successfully saved.",
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer"
          },
          {
            "name": "options",
            "type": "object",
            "optional": true,
            "properties": {
              "mode": {
                "type": "string",
                "enum": ["draft", "template"]
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "return",
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "description": "The used save mode.",
                    "enum": ["draft", "template"]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "$ref": "messages.MessageHeader"
                    },
                    "description": "The saved message(s). The number of saved messages depends on the applied file carbon copy configuration (fcc)."
                  }
                }
              }
            ]
          }
        ]
      },
      {
        "name": "getComposeState",
        "type": "function",
        "description": "Returns information about the current state of the message composer.",
        "async": "callback",
        "parameters": [
          {
            "name": "tabId",
            "type": "integer"
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "return",
                "$ref": "ComposeState"
              }
            ]
          }
        ]
      }
    ]
  }
]