@workers-community/workers-types 4.20260120.0 → 4.20260123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +37 -0
  2. package/index.ts +37 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -10600,6 +10600,10 @@ interface D1Meta {
10600
10600
  * The region of the database instance that executed the query.
10601
10601
  */
10602
10602
  served_by_region?: string;
10603
+ /**
10604
+ * The three letters airport code of the colo that executed the query.
10605
+ */
10606
+ served_by_colo?: string;
10603
10607
  /**
10604
10608
  * True if-and-only-if the database instance that executed the query was the primary.
10605
10609
  */
@@ -10742,11 +10746,44 @@ interface ForwardableEmailMessage extends EmailMessage {
10742
10746
  */
10743
10747
  reply(message: EmailMessage): Promise<EmailSendResult>;
10744
10748
  }
10749
+ /** A file attachment for an email message */
10750
+ type EmailAttachment =
10751
+ | {
10752
+ disposition: "inline";
10753
+ contentId: string;
10754
+ filename: string;
10755
+ type: string;
10756
+ content: string | ArrayBuffer | ArrayBufferView;
10757
+ }
10758
+ | {
10759
+ disposition: "attachment";
10760
+ contentId?: undefined;
10761
+ filename: string;
10762
+ type: string;
10763
+ content: string | ArrayBuffer | ArrayBufferView;
10764
+ };
10765
+ /** An Email Address */
10766
+ interface EmailAddress {
10767
+ name: string;
10768
+ email: string;
10769
+ }
10745
10770
  /**
10746
10771
  * A binding that allows a Worker to send email messages.
10747
10772
  */
10748
10773
  interface SendEmail {
10749
10774
  send(message: EmailMessage): Promise<EmailSendResult>;
10775
+ send(builder: {
10776
+ from: string | EmailAddress;
10777
+ to: string | string[];
10778
+ subject: string;
10779
+ replyTo?: string | EmailAddress;
10780
+ cc?: string | string[];
10781
+ bcc?: string | string[];
10782
+ headers?: Record<string, string>;
10783
+ text?: string;
10784
+ html?: string;
10785
+ attachments?: EmailAttachment[];
10786
+ }): Promise<EmailSendResult>;
10750
10787
  }
10751
10788
  declare abstract class EmailEvent extends ExtendableEvent {
10752
10789
  readonly message: ForwardableEmailMessage;
package/index.ts CHANGED
@@ -10626,6 +10626,10 @@ export interface D1Meta {
10626
10626
  * The region of the database instance that executed the query.
10627
10627
  */
10628
10628
  served_by_region?: string;
10629
+ /**
10630
+ * The three letters airport code of the colo that executed the query.
10631
+ */
10632
+ served_by_colo?: string;
10629
10633
  /**
10630
10634
  * True if-and-only-if the database instance that executed the query was the primary.
10631
10635
  */
@@ -10768,11 +10772,44 @@ export interface ForwardableEmailMessage extends EmailMessage {
10768
10772
  */
10769
10773
  reply(message: EmailMessage): Promise<EmailSendResult>;
10770
10774
  }
10775
+ /** A file attachment for an email message */
10776
+ export type EmailAttachment =
10777
+ | {
10778
+ disposition: "inline";
10779
+ contentId: string;
10780
+ filename: string;
10781
+ type: string;
10782
+ content: string | ArrayBuffer | ArrayBufferView;
10783
+ }
10784
+ | {
10785
+ disposition: "attachment";
10786
+ contentId?: undefined;
10787
+ filename: string;
10788
+ type: string;
10789
+ content: string | ArrayBuffer | ArrayBufferView;
10790
+ };
10791
+ /** An Email Address */
10792
+ export interface EmailAddress {
10793
+ name: string;
10794
+ email: string;
10795
+ }
10771
10796
  /**
10772
10797
  * A binding that allows a Worker to send email messages.
10773
10798
  */
10774
10799
  export interface SendEmail {
10775
10800
  send(message: EmailMessage): Promise<EmailSendResult>;
10801
+ send(builder: {
10802
+ from: string | EmailAddress;
10803
+ to: string | string[];
10804
+ subject: string;
10805
+ replyTo?: string | EmailAddress;
10806
+ cc?: string | string[];
10807
+ bcc?: string | string[];
10808
+ headers?: Record<string, string>;
10809
+ text?: string;
10810
+ html?: string;
10811
+ attachments?: EmailAttachment[];
10812
+ }): Promise<EmailSendResult>;
10776
10813
  }
10777
10814
  export declare abstract class EmailEvent extends ExtendableEvent {
10778
10815
  readonly message: ForwardableEmailMessage;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "author": "Workers Community",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260120.0",
10
+ "version": "4.20260123.0",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./index.d.ts",