@cloudflare/workers-types 4.20230321.0 → 4.20230404.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.
- package/2021-11-03/index.d.ts +58 -17
- package/2021-11-03/index.ts +51 -17
- package/2022-01-31/index.d.ts +58 -17
- package/2022-01-31/index.ts +51 -17
- package/2022-03-21/index.d.ts +58 -17
- package/2022-03-21/index.ts +51 -17
- package/2022-08-04/index.d.ts +58 -17
- package/2022-08-04/index.ts +51 -17
- package/2022-10-31/index.d.ts +58 -17
- package/2022-10-31/index.ts +51 -17
- package/2022-11-30/index.d.ts +58 -17
- package/2022-11-30/index.ts +51 -17
- package/README.md +1 -1
- package/experimental/index.d.ts +58 -17
- package/experimental/index.ts +51 -17
- package/index.d.ts +58 -17
- package/index.ts +51 -17
- package/oldest/index.d.ts +58 -17
- package/oldest/index.ts +51 -17
- package/package.json +1 -1
package/2022-03-21/index.ts
CHANGED
|
@@ -361,13 +361,24 @@ export interface DurableObjectNamespace {
|
|
|
361
361
|
id: DurableObjectId,
|
|
362
362
|
options?: DurableObjectNamespaceGetDurableObjectOptions
|
|
363
363
|
): DurableObjectStub;
|
|
364
|
-
jurisdiction(jurisdiction:
|
|
364
|
+
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
|
|
365
365
|
}
|
|
366
|
+
export type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
366
367
|
export interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
367
|
-
jurisdiction?:
|
|
368
|
-
}
|
|
368
|
+
jurisdiction?: DurableObjectJurisdiction;
|
|
369
|
+
}
|
|
370
|
+
export type DurableObjectLocationHint =
|
|
371
|
+
| "wnam"
|
|
372
|
+
| "enam"
|
|
373
|
+
| "sam"
|
|
374
|
+
| "weur"
|
|
375
|
+
| "eeur"
|
|
376
|
+
| "apac"
|
|
377
|
+
| "oc"
|
|
378
|
+
| "afr"
|
|
379
|
+
| "me";
|
|
369
380
|
export interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
370
|
-
locationHint?:
|
|
381
|
+
locationHint?: DurableObjectLocationHint;
|
|
371
382
|
}
|
|
372
383
|
export interface DurableObjectState {
|
|
373
384
|
waitUntil(promise: Promise<any>): void;
|
|
@@ -1297,12 +1308,18 @@ export interface R2HTTPMetadata {
|
|
|
1297
1308
|
cacheControl?: string;
|
|
1298
1309
|
cacheExpiry?: Date;
|
|
1299
1310
|
}
|
|
1300
|
-
export
|
|
1311
|
+
export type R2Objects = {
|
|
1301
1312
|
objects: R2Object[];
|
|
1302
|
-
truncated: boolean;
|
|
1303
|
-
cursor?: string;
|
|
1304
1313
|
delimitedPrefixes: string[];
|
|
1305
|
-
}
|
|
1314
|
+
} & (
|
|
1315
|
+
| {
|
|
1316
|
+
truncated: true;
|
|
1317
|
+
cursor: string;
|
|
1318
|
+
}
|
|
1319
|
+
| {
|
|
1320
|
+
truncated: false;
|
|
1321
|
+
}
|
|
1322
|
+
);
|
|
1306
1323
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1307
1324
|
readonly scheduledTime: number;
|
|
1308
1325
|
readonly cron: string;
|
|
@@ -1513,13 +1530,19 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
1513
1530
|
get writable(): WritableStream<I>;
|
|
1514
1531
|
}
|
|
1515
1532
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
1516
|
-
constructor(
|
|
1533
|
+
constructor(
|
|
1534
|
+
expectedLength: number | bigint,
|
|
1535
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
1536
|
+
);
|
|
1517
1537
|
}
|
|
1518
1538
|
export declare class IdentityTransformStream extends TransformStream<
|
|
1519
1539
|
ArrayBuffer | ArrayBufferView,
|
|
1520
1540
|
Uint8Array
|
|
1521
1541
|
> {
|
|
1522
|
-
constructor();
|
|
1542
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
1543
|
+
}
|
|
1544
|
+
export interface IdentityTransformStreamQueuingStrategy {
|
|
1545
|
+
highWaterMark?: number | bigint;
|
|
1523
1546
|
}
|
|
1524
1547
|
export interface ReadableStreamValuesOptions {
|
|
1525
1548
|
preventCancel?: boolean;
|
|
@@ -2788,7 +2811,7 @@ export declare abstract class D1PreparedStatement {
|
|
|
2788
2811
|
raw<T = unknown>(): Promise<T[]>;
|
|
2789
2812
|
}
|
|
2790
2813
|
/**
|
|
2791
|
-
*
|
|
2814
|
+
* An email message that can be sent from a Worker.
|
|
2792
2815
|
*/
|
|
2793
2816
|
export interface EmailMessage {
|
|
2794
2817
|
/**
|
|
@@ -2799,14 +2822,19 @@ export interface EmailMessage {
|
|
|
2799
2822
|
* Envelope To attribute of the email message.
|
|
2800
2823
|
*/
|
|
2801
2824
|
readonly to: string;
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2825
|
+
}
|
|
2826
|
+
/**
|
|
2827
|
+
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
2828
|
+
*/
|
|
2829
|
+
export interface ForwardableEmailMessage extends EmailMessage {
|
|
2806
2830
|
/**
|
|
2807
2831
|
* Stream of the email message content.
|
|
2808
2832
|
*/
|
|
2809
2833
|
readonly raw: ReadableStream;
|
|
2834
|
+
/**
|
|
2835
|
+
* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
|
|
2836
|
+
*/
|
|
2837
|
+
readonly headers: Headers;
|
|
2810
2838
|
/**
|
|
2811
2839
|
* Size of the email message content.
|
|
2812
2840
|
*/
|
|
@@ -2825,11 +2853,17 @@ export interface EmailMessage {
|
|
|
2825
2853
|
*/
|
|
2826
2854
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
2827
2855
|
}
|
|
2856
|
+
/**
|
|
2857
|
+
* A binding that allows a Worker to send email messages.
|
|
2858
|
+
*/
|
|
2859
|
+
export interface SendEmail {
|
|
2860
|
+
send(message: EmailMessage): Promise<void>;
|
|
2861
|
+
}
|
|
2828
2862
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
2829
|
-
readonly message:
|
|
2863
|
+
readonly message: ForwardableEmailMessage;
|
|
2830
2864
|
}
|
|
2831
2865
|
export type EmailExportedHandler<Env = unknown> = (
|
|
2832
|
-
message:
|
|
2866
|
+
message: ForwardableEmailMessage,
|
|
2833
2867
|
env: Env,
|
|
2834
2868
|
ctx: ExecutionContext
|
|
2835
2869
|
) => void | Promise<void>;
|
package/2022-08-04/index.d.ts
CHANGED
|
@@ -359,13 +359,24 @@ declare interface DurableObjectNamespace {
|
|
|
359
359
|
id: DurableObjectId,
|
|
360
360
|
options?: DurableObjectNamespaceGetDurableObjectOptions
|
|
361
361
|
): DurableObjectStub;
|
|
362
|
-
jurisdiction(jurisdiction:
|
|
362
|
+
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
|
|
363
363
|
}
|
|
364
|
+
declare type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
364
365
|
declare interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
365
|
-
jurisdiction?:
|
|
366
|
-
}
|
|
366
|
+
jurisdiction?: DurableObjectJurisdiction;
|
|
367
|
+
}
|
|
368
|
+
declare type DurableObjectLocationHint =
|
|
369
|
+
| "wnam"
|
|
370
|
+
| "enam"
|
|
371
|
+
| "sam"
|
|
372
|
+
| "weur"
|
|
373
|
+
| "eeur"
|
|
374
|
+
| "apac"
|
|
375
|
+
| "oc"
|
|
376
|
+
| "afr"
|
|
377
|
+
| "me";
|
|
367
378
|
declare interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
368
|
-
locationHint?:
|
|
379
|
+
locationHint?: DurableObjectLocationHint;
|
|
369
380
|
}
|
|
370
381
|
declare interface DurableObjectState {
|
|
371
382
|
waitUntil(promise: Promise<any>): void;
|
|
@@ -1296,12 +1307,18 @@ declare interface R2HTTPMetadata {
|
|
|
1296
1307
|
cacheControl?: string;
|
|
1297
1308
|
cacheExpiry?: Date;
|
|
1298
1309
|
}
|
|
1299
|
-
declare
|
|
1310
|
+
declare type R2Objects = {
|
|
1300
1311
|
objects: R2Object[];
|
|
1301
|
-
truncated: boolean;
|
|
1302
|
-
cursor?: string;
|
|
1303
1312
|
delimitedPrefixes: string[];
|
|
1304
|
-
}
|
|
1313
|
+
} & (
|
|
1314
|
+
| {
|
|
1315
|
+
truncated: true;
|
|
1316
|
+
cursor: string;
|
|
1317
|
+
}
|
|
1318
|
+
| {
|
|
1319
|
+
truncated: false;
|
|
1320
|
+
}
|
|
1321
|
+
);
|
|
1305
1322
|
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1306
1323
|
readonly scheduledTime: number;
|
|
1307
1324
|
readonly cron: string;
|
|
@@ -1512,13 +1529,19 @@ declare class TransformStream<I = any, O = any> {
|
|
|
1512
1529
|
get writable(): WritableStream<I>;
|
|
1513
1530
|
}
|
|
1514
1531
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
1515
|
-
constructor(
|
|
1532
|
+
constructor(
|
|
1533
|
+
expectedLength: number | bigint,
|
|
1534
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
1535
|
+
);
|
|
1516
1536
|
}
|
|
1517
1537
|
declare class IdentityTransformStream extends TransformStream<
|
|
1518
1538
|
ArrayBuffer | ArrayBufferView,
|
|
1519
1539
|
Uint8Array
|
|
1520
1540
|
> {
|
|
1521
|
-
constructor();
|
|
1541
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
1542
|
+
}
|
|
1543
|
+
declare interface IdentityTransformStreamQueuingStrategy {
|
|
1544
|
+
highWaterMark?: number | bigint;
|
|
1522
1545
|
}
|
|
1523
1546
|
declare interface ReadableStreamValuesOptions {
|
|
1524
1547
|
preventCancel?: boolean;
|
|
@@ -2784,7 +2807,7 @@ declare abstract class D1PreparedStatement {
|
|
|
2784
2807
|
raw<T = unknown>(): Promise<T[]>;
|
|
2785
2808
|
}
|
|
2786
2809
|
/**
|
|
2787
|
-
*
|
|
2810
|
+
* An email message that can be sent from a Worker.
|
|
2788
2811
|
*/
|
|
2789
2812
|
declare interface EmailMessage {
|
|
2790
2813
|
/**
|
|
@@ -2795,14 +2818,19 @@ declare interface EmailMessage {
|
|
|
2795
2818
|
* Envelope To attribute of the email message.
|
|
2796
2819
|
*/
|
|
2797
2820
|
readonly to: string;
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2821
|
+
}
|
|
2822
|
+
/**
|
|
2823
|
+
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
2824
|
+
*/
|
|
2825
|
+
declare interface ForwardableEmailMessage extends EmailMessage {
|
|
2802
2826
|
/**
|
|
2803
2827
|
* Stream of the email message content.
|
|
2804
2828
|
*/
|
|
2805
2829
|
readonly raw: ReadableStream;
|
|
2830
|
+
/**
|
|
2831
|
+
* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
|
|
2832
|
+
*/
|
|
2833
|
+
readonly headers: Headers;
|
|
2806
2834
|
/**
|
|
2807
2835
|
* Size of the email message content.
|
|
2808
2836
|
*/
|
|
@@ -2821,14 +2849,27 @@ declare interface EmailMessage {
|
|
|
2821
2849
|
*/
|
|
2822
2850
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
2823
2851
|
}
|
|
2852
|
+
/**
|
|
2853
|
+
* A binding that allows a Worker to send email messages.
|
|
2854
|
+
*/
|
|
2855
|
+
declare interface SendEmail {
|
|
2856
|
+
send(message: EmailMessage): Promise<void>;
|
|
2857
|
+
}
|
|
2824
2858
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
2825
|
-
readonly message:
|
|
2859
|
+
readonly message: ForwardableEmailMessage;
|
|
2826
2860
|
}
|
|
2827
2861
|
declare type EmailExportedHandler<Env = unknown> = (
|
|
2828
|
-
message:
|
|
2862
|
+
message: ForwardableEmailMessage,
|
|
2829
2863
|
env: Env,
|
|
2830
2864
|
ctx: ExecutionContext
|
|
2831
2865
|
) => void | Promise<void>;
|
|
2866
|
+
declare module "cloudflare:email" {
|
|
2867
|
+
let _EmailMessage: {
|
|
2868
|
+
prototype: EmailMessage;
|
|
2869
|
+
new (from: string, to: string, raw: ReadableStream | string): EmailMessage;
|
|
2870
|
+
};
|
|
2871
|
+
export { _EmailMessage as EmailMessage };
|
|
2872
|
+
}
|
|
2832
2873
|
declare type Params<P extends string = any> = Record<P, string | string[]>;
|
|
2833
2874
|
declare type EventContext<Env, P extends string, Data> = {
|
|
2834
2875
|
request: Request;
|
package/2022-08-04/index.ts
CHANGED
|
@@ -361,13 +361,24 @@ export interface DurableObjectNamespace {
|
|
|
361
361
|
id: DurableObjectId,
|
|
362
362
|
options?: DurableObjectNamespaceGetDurableObjectOptions
|
|
363
363
|
): DurableObjectStub;
|
|
364
|
-
jurisdiction(jurisdiction:
|
|
364
|
+
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
|
|
365
365
|
}
|
|
366
|
+
export type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
366
367
|
export interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
367
|
-
jurisdiction?:
|
|
368
|
-
}
|
|
368
|
+
jurisdiction?: DurableObjectJurisdiction;
|
|
369
|
+
}
|
|
370
|
+
export type DurableObjectLocationHint =
|
|
371
|
+
| "wnam"
|
|
372
|
+
| "enam"
|
|
373
|
+
| "sam"
|
|
374
|
+
| "weur"
|
|
375
|
+
| "eeur"
|
|
376
|
+
| "apac"
|
|
377
|
+
| "oc"
|
|
378
|
+
| "afr"
|
|
379
|
+
| "me";
|
|
369
380
|
export interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
370
|
-
locationHint?:
|
|
381
|
+
locationHint?: DurableObjectLocationHint;
|
|
371
382
|
}
|
|
372
383
|
export interface DurableObjectState {
|
|
373
384
|
waitUntil(promise: Promise<any>): void;
|
|
@@ -1298,12 +1309,18 @@ export interface R2HTTPMetadata {
|
|
|
1298
1309
|
cacheControl?: string;
|
|
1299
1310
|
cacheExpiry?: Date;
|
|
1300
1311
|
}
|
|
1301
|
-
export
|
|
1312
|
+
export type R2Objects = {
|
|
1302
1313
|
objects: R2Object[];
|
|
1303
|
-
truncated: boolean;
|
|
1304
|
-
cursor?: string;
|
|
1305
1314
|
delimitedPrefixes: string[];
|
|
1306
|
-
}
|
|
1315
|
+
} & (
|
|
1316
|
+
| {
|
|
1317
|
+
truncated: true;
|
|
1318
|
+
cursor: string;
|
|
1319
|
+
}
|
|
1320
|
+
| {
|
|
1321
|
+
truncated: false;
|
|
1322
|
+
}
|
|
1323
|
+
);
|
|
1307
1324
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1308
1325
|
readonly scheduledTime: number;
|
|
1309
1326
|
readonly cron: string;
|
|
@@ -1514,13 +1531,19 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
1514
1531
|
get writable(): WritableStream<I>;
|
|
1515
1532
|
}
|
|
1516
1533
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
1517
|
-
constructor(
|
|
1534
|
+
constructor(
|
|
1535
|
+
expectedLength: number | bigint,
|
|
1536
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
1537
|
+
);
|
|
1518
1538
|
}
|
|
1519
1539
|
export declare class IdentityTransformStream extends TransformStream<
|
|
1520
1540
|
ArrayBuffer | ArrayBufferView,
|
|
1521
1541
|
Uint8Array
|
|
1522
1542
|
> {
|
|
1523
|
-
constructor();
|
|
1543
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
1544
|
+
}
|
|
1545
|
+
export interface IdentityTransformStreamQueuingStrategy {
|
|
1546
|
+
highWaterMark?: number | bigint;
|
|
1524
1547
|
}
|
|
1525
1548
|
export interface ReadableStreamValuesOptions {
|
|
1526
1549
|
preventCancel?: boolean;
|
|
@@ -2789,7 +2812,7 @@ export declare abstract class D1PreparedStatement {
|
|
|
2789
2812
|
raw<T = unknown>(): Promise<T[]>;
|
|
2790
2813
|
}
|
|
2791
2814
|
/**
|
|
2792
|
-
*
|
|
2815
|
+
* An email message that can be sent from a Worker.
|
|
2793
2816
|
*/
|
|
2794
2817
|
export interface EmailMessage {
|
|
2795
2818
|
/**
|
|
@@ -2800,14 +2823,19 @@ export interface EmailMessage {
|
|
|
2800
2823
|
* Envelope To attribute of the email message.
|
|
2801
2824
|
*/
|
|
2802
2825
|
readonly to: string;
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2826
|
+
}
|
|
2827
|
+
/**
|
|
2828
|
+
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
2829
|
+
*/
|
|
2830
|
+
export interface ForwardableEmailMessage extends EmailMessage {
|
|
2807
2831
|
/**
|
|
2808
2832
|
* Stream of the email message content.
|
|
2809
2833
|
*/
|
|
2810
2834
|
readonly raw: ReadableStream;
|
|
2835
|
+
/**
|
|
2836
|
+
* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
|
|
2837
|
+
*/
|
|
2838
|
+
readonly headers: Headers;
|
|
2811
2839
|
/**
|
|
2812
2840
|
* Size of the email message content.
|
|
2813
2841
|
*/
|
|
@@ -2826,11 +2854,17 @@ export interface EmailMessage {
|
|
|
2826
2854
|
*/
|
|
2827
2855
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
2828
2856
|
}
|
|
2857
|
+
/**
|
|
2858
|
+
* A binding that allows a Worker to send email messages.
|
|
2859
|
+
*/
|
|
2860
|
+
export interface SendEmail {
|
|
2861
|
+
send(message: EmailMessage): Promise<void>;
|
|
2862
|
+
}
|
|
2829
2863
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
2830
|
-
readonly message:
|
|
2864
|
+
readonly message: ForwardableEmailMessage;
|
|
2831
2865
|
}
|
|
2832
2866
|
export type EmailExportedHandler<Env = unknown> = (
|
|
2833
|
-
message:
|
|
2867
|
+
message: ForwardableEmailMessage,
|
|
2834
2868
|
env: Env,
|
|
2835
2869
|
ctx: ExecutionContext
|
|
2836
2870
|
) => void | Promise<void>;
|
package/2022-10-31/index.d.ts
CHANGED
|
@@ -359,13 +359,24 @@ declare interface DurableObjectNamespace {
|
|
|
359
359
|
id: DurableObjectId,
|
|
360
360
|
options?: DurableObjectNamespaceGetDurableObjectOptions
|
|
361
361
|
): DurableObjectStub;
|
|
362
|
-
jurisdiction(jurisdiction:
|
|
362
|
+
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
|
|
363
363
|
}
|
|
364
|
+
declare type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
364
365
|
declare interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
365
|
-
jurisdiction?:
|
|
366
|
-
}
|
|
366
|
+
jurisdiction?: DurableObjectJurisdiction;
|
|
367
|
+
}
|
|
368
|
+
declare type DurableObjectLocationHint =
|
|
369
|
+
| "wnam"
|
|
370
|
+
| "enam"
|
|
371
|
+
| "sam"
|
|
372
|
+
| "weur"
|
|
373
|
+
| "eeur"
|
|
374
|
+
| "apac"
|
|
375
|
+
| "oc"
|
|
376
|
+
| "afr"
|
|
377
|
+
| "me";
|
|
367
378
|
declare interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
368
|
-
locationHint?:
|
|
379
|
+
locationHint?: DurableObjectLocationHint;
|
|
369
380
|
}
|
|
370
381
|
declare interface DurableObjectState {
|
|
371
382
|
waitUntil(promise: Promise<any>): void;
|
|
@@ -1296,12 +1307,18 @@ declare interface R2HTTPMetadata {
|
|
|
1296
1307
|
cacheControl?: string;
|
|
1297
1308
|
cacheExpiry?: Date;
|
|
1298
1309
|
}
|
|
1299
|
-
declare
|
|
1310
|
+
declare type R2Objects = {
|
|
1300
1311
|
objects: R2Object[];
|
|
1301
|
-
truncated: boolean;
|
|
1302
|
-
cursor?: string;
|
|
1303
1312
|
delimitedPrefixes: string[];
|
|
1304
|
-
}
|
|
1313
|
+
} & (
|
|
1314
|
+
| {
|
|
1315
|
+
truncated: true;
|
|
1316
|
+
cursor: string;
|
|
1317
|
+
}
|
|
1318
|
+
| {
|
|
1319
|
+
truncated: false;
|
|
1320
|
+
}
|
|
1321
|
+
);
|
|
1305
1322
|
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1306
1323
|
readonly scheduledTime: number;
|
|
1307
1324
|
readonly cron: string;
|
|
@@ -1512,13 +1529,19 @@ declare class TransformStream<I = any, O = any> {
|
|
|
1512
1529
|
get writable(): WritableStream<I>;
|
|
1513
1530
|
}
|
|
1514
1531
|
declare class FixedLengthStream extends IdentityTransformStream {
|
|
1515
|
-
constructor(
|
|
1532
|
+
constructor(
|
|
1533
|
+
expectedLength: number | bigint,
|
|
1534
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
1535
|
+
);
|
|
1516
1536
|
}
|
|
1517
1537
|
declare class IdentityTransformStream extends TransformStream<
|
|
1518
1538
|
ArrayBuffer | ArrayBufferView,
|
|
1519
1539
|
Uint8Array
|
|
1520
1540
|
> {
|
|
1521
|
-
constructor();
|
|
1541
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
1542
|
+
}
|
|
1543
|
+
declare interface IdentityTransformStreamQueuingStrategy {
|
|
1544
|
+
highWaterMark?: number | bigint;
|
|
1522
1545
|
}
|
|
1523
1546
|
declare interface ReadableStreamValuesOptions {
|
|
1524
1547
|
preventCancel?: boolean;
|
|
@@ -2781,7 +2804,7 @@ declare abstract class D1PreparedStatement {
|
|
|
2781
2804
|
raw<T = unknown>(): Promise<T[]>;
|
|
2782
2805
|
}
|
|
2783
2806
|
/**
|
|
2784
|
-
*
|
|
2807
|
+
* An email message that can be sent from a Worker.
|
|
2785
2808
|
*/
|
|
2786
2809
|
declare interface EmailMessage {
|
|
2787
2810
|
/**
|
|
@@ -2792,14 +2815,19 @@ declare interface EmailMessage {
|
|
|
2792
2815
|
* Envelope To attribute of the email message.
|
|
2793
2816
|
*/
|
|
2794
2817
|
readonly to: string;
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2818
|
+
}
|
|
2819
|
+
/**
|
|
2820
|
+
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
2821
|
+
*/
|
|
2822
|
+
declare interface ForwardableEmailMessage extends EmailMessage {
|
|
2799
2823
|
/**
|
|
2800
2824
|
* Stream of the email message content.
|
|
2801
2825
|
*/
|
|
2802
2826
|
readonly raw: ReadableStream;
|
|
2827
|
+
/**
|
|
2828
|
+
* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
|
|
2829
|
+
*/
|
|
2830
|
+
readonly headers: Headers;
|
|
2803
2831
|
/**
|
|
2804
2832
|
* Size of the email message content.
|
|
2805
2833
|
*/
|
|
@@ -2818,14 +2846,27 @@ declare interface EmailMessage {
|
|
|
2818
2846
|
*/
|
|
2819
2847
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
2820
2848
|
}
|
|
2849
|
+
/**
|
|
2850
|
+
* A binding that allows a Worker to send email messages.
|
|
2851
|
+
*/
|
|
2852
|
+
declare interface SendEmail {
|
|
2853
|
+
send(message: EmailMessage): Promise<void>;
|
|
2854
|
+
}
|
|
2821
2855
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
2822
|
-
readonly message:
|
|
2856
|
+
readonly message: ForwardableEmailMessage;
|
|
2823
2857
|
}
|
|
2824
2858
|
declare type EmailExportedHandler<Env = unknown> = (
|
|
2825
|
-
message:
|
|
2859
|
+
message: ForwardableEmailMessage,
|
|
2826
2860
|
env: Env,
|
|
2827
2861
|
ctx: ExecutionContext
|
|
2828
2862
|
) => void | Promise<void>;
|
|
2863
|
+
declare module "cloudflare:email" {
|
|
2864
|
+
let _EmailMessage: {
|
|
2865
|
+
prototype: EmailMessage;
|
|
2866
|
+
new (from: string, to: string, raw: ReadableStream | string): EmailMessage;
|
|
2867
|
+
};
|
|
2868
|
+
export { _EmailMessage as EmailMessage };
|
|
2869
|
+
}
|
|
2829
2870
|
declare type Params<P extends string = any> = Record<P, string | string[]>;
|
|
2830
2871
|
declare type EventContext<Env, P extends string, Data> = {
|
|
2831
2872
|
request: Request;
|
package/2022-10-31/index.ts
CHANGED
|
@@ -361,13 +361,24 @@ export interface DurableObjectNamespace {
|
|
|
361
361
|
id: DurableObjectId,
|
|
362
362
|
options?: DurableObjectNamespaceGetDurableObjectOptions
|
|
363
363
|
): DurableObjectStub;
|
|
364
|
-
jurisdiction(jurisdiction:
|
|
364
|
+
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
|
|
365
365
|
}
|
|
366
|
+
export type DurableObjectJurisdiction = "eu" | "fedramp";
|
|
366
367
|
export interface DurableObjectNamespaceNewUniqueIdOptions {
|
|
367
|
-
jurisdiction?:
|
|
368
|
-
}
|
|
368
|
+
jurisdiction?: DurableObjectJurisdiction;
|
|
369
|
+
}
|
|
370
|
+
export type DurableObjectLocationHint =
|
|
371
|
+
| "wnam"
|
|
372
|
+
| "enam"
|
|
373
|
+
| "sam"
|
|
374
|
+
| "weur"
|
|
375
|
+
| "eeur"
|
|
376
|
+
| "apac"
|
|
377
|
+
| "oc"
|
|
378
|
+
| "afr"
|
|
379
|
+
| "me";
|
|
369
380
|
export interface DurableObjectNamespaceGetDurableObjectOptions {
|
|
370
|
-
locationHint?:
|
|
381
|
+
locationHint?: DurableObjectLocationHint;
|
|
371
382
|
}
|
|
372
383
|
export interface DurableObjectState {
|
|
373
384
|
waitUntil(promise: Promise<any>): void;
|
|
@@ -1298,12 +1309,18 @@ export interface R2HTTPMetadata {
|
|
|
1298
1309
|
cacheControl?: string;
|
|
1299
1310
|
cacheExpiry?: Date;
|
|
1300
1311
|
}
|
|
1301
|
-
export
|
|
1312
|
+
export type R2Objects = {
|
|
1302
1313
|
objects: R2Object[];
|
|
1303
|
-
truncated: boolean;
|
|
1304
|
-
cursor?: string;
|
|
1305
1314
|
delimitedPrefixes: string[];
|
|
1306
|
-
}
|
|
1315
|
+
} & (
|
|
1316
|
+
| {
|
|
1317
|
+
truncated: true;
|
|
1318
|
+
cursor: string;
|
|
1319
|
+
}
|
|
1320
|
+
| {
|
|
1321
|
+
truncated: false;
|
|
1322
|
+
}
|
|
1323
|
+
);
|
|
1307
1324
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1308
1325
|
readonly scheduledTime: number;
|
|
1309
1326
|
readonly cron: string;
|
|
@@ -1514,13 +1531,19 @@ export declare class TransformStream<I = any, O = any> {
|
|
|
1514
1531
|
get writable(): WritableStream<I>;
|
|
1515
1532
|
}
|
|
1516
1533
|
export declare class FixedLengthStream extends IdentityTransformStream {
|
|
1517
|
-
constructor(
|
|
1534
|
+
constructor(
|
|
1535
|
+
expectedLength: number | bigint,
|
|
1536
|
+
queuingStrategy?: IdentityTransformStreamQueuingStrategy
|
|
1537
|
+
);
|
|
1518
1538
|
}
|
|
1519
1539
|
export declare class IdentityTransformStream extends TransformStream<
|
|
1520
1540
|
ArrayBuffer | ArrayBufferView,
|
|
1521
1541
|
Uint8Array
|
|
1522
1542
|
> {
|
|
1523
|
-
constructor();
|
|
1543
|
+
constructor(queuingStrategy?: IdentityTransformStreamQueuingStrategy);
|
|
1544
|
+
}
|
|
1545
|
+
export interface IdentityTransformStreamQueuingStrategy {
|
|
1546
|
+
highWaterMark?: number | bigint;
|
|
1524
1547
|
}
|
|
1525
1548
|
export interface ReadableStreamValuesOptions {
|
|
1526
1549
|
preventCancel?: boolean;
|
|
@@ -2786,7 +2809,7 @@ export declare abstract class D1PreparedStatement {
|
|
|
2786
2809
|
raw<T = unknown>(): Promise<T[]>;
|
|
2787
2810
|
}
|
|
2788
2811
|
/**
|
|
2789
|
-
*
|
|
2812
|
+
* An email message that can be sent from a Worker.
|
|
2790
2813
|
*/
|
|
2791
2814
|
export interface EmailMessage {
|
|
2792
2815
|
/**
|
|
@@ -2797,14 +2820,19 @@ export interface EmailMessage {
|
|
|
2797
2820
|
* Envelope To attribute of the email message.
|
|
2798
2821
|
*/
|
|
2799
2822
|
readonly to: string;
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2823
|
+
}
|
|
2824
|
+
/**
|
|
2825
|
+
* An email message that is sent to a consumer Worker and can be rejected/forwarded.
|
|
2826
|
+
*/
|
|
2827
|
+
export interface ForwardableEmailMessage extends EmailMessage {
|
|
2804
2828
|
/**
|
|
2805
2829
|
* Stream of the email message content.
|
|
2806
2830
|
*/
|
|
2807
2831
|
readonly raw: ReadableStream;
|
|
2832
|
+
/**
|
|
2833
|
+
* An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
|
|
2834
|
+
*/
|
|
2835
|
+
readonly headers: Headers;
|
|
2808
2836
|
/**
|
|
2809
2837
|
* Size of the email message content.
|
|
2810
2838
|
*/
|
|
@@ -2823,11 +2851,17 @@ export interface EmailMessage {
|
|
|
2823
2851
|
*/
|
|
2824
2852
|
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
2825
2853
|
}
|
|
2854
|
+
/**
|
|
2855
|
+
* A binding that allows a Worker to send email messages.
|
|
2856
|
+
*/
|
|
2857
|
+
export interface SendEmail {
|
|
2858
|
+
send(message: EmailMessage): Promise<void>;
|
|
2859
|
+
}
|
|
2826
2860
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
2827
|
-
readonly message:
|
|
2861
|
+
readonly message: ForwardableEmailMessage;
|
|
2828
2862
|
}
|
|
2829
2863
|
export type EmailExportedHandler<Env = unknown> = (
|
|
2830
|
-
message:
|
|
2864
|
+
message: ForwardableEmailMessage,
|
|
2831
2865
|
env: Env,
|
|
2832
2866
|
ctx: ExecutionContext
|
|
2833
2867
|
) => void | Promise<void>;
|