@cloudflare/workers-types 4.20260307.1 → 4.20260310.1
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 +35 -24
- package/2021-11-03/index.ts +31 -23
- package/2022-01-31/index.d.ts +35 -24
- package/2022-01-31/index.ts +31 -23
- package/2022-03-21/index.d.ts +35 -24
- package/2022-03-21/index.ts +31 -23
- package/2022-08-04/index.d.ts +35 -24
- package/2022-08-04/index.ts +31 -23
- package/2022-10-31/index.d.ts +35 -24
- package/2022-10-31/index.ts +31 -23
- package/2022-11-30/index.d.ts +35 -24
- package/2022-11-30/index.ts +31 -23
- package/2023-03-01/index.d.ts +35 -24
- package/2023-03-01/index.ts +31 -23
- package/2023-07-01/index.d.ts +35 -24
- package/2023-07-01/index.ts +31 -23
- package/experimental/index.d.ts +33 -24
- package/experimental/index.ts +29 -23
- package/index.d.ts +35 -24
- package/index.ts +31 -23
- package/latest/index.d.ts +35 -24
- package/latest/index.ts +31 -23
- package/oldest/index.d.ts +35 -24
- package/oldest/index.ts +31 -23
- package/package.json +1 -1
package/2023-03-01/index.d.ts
CHANGED
|
@@ -477,54 +477,63 @@ interface ExecutionContext<Props = unknown> {
|
|
|
477
477
|
passThroughOnException(): void;
|
|
478
478
|
readonly props: Props;
|
|
479
479
|
}
|
|
480
|
-
type ExportedHandlerFetchHandler<
|
|
480
|
+
type ExportedHandlerFetchHandler<
|
|
481
|
+
Env = unknown,
|
|
482
|
+
CfHostMetadata = unknown,
|
|
483
|
+
Props = unknown,
|
|
484
|
+
> = (
|
|
481
485
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
482
486
|
env: Env,
|
|
483
|
-
ctx: ExecutionContext
|
|
487
|
+
ctx: ExecutionContext<Props>,
|
|
484
488
|
) => Response | Promise<Response>;
|
|
485
|
-
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
489
|
+
type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
486
490
|
events: TraceItem[],
|
|
487
491
|
env: Env,
|
|
488
|
-
ctx: ExecutionContext
|
|
492
|
+
ctx: ExecutionContext<Props>,
|
|
489
493
|
) => void | Promise<void>;
|
|
490
|
-
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
494
|
+
type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
491
495
|
traces: TraceItem[],
|
|
492
496
|
env: Env,
|
|
493
|
-
ctx: ExecutionContext
|
|
497
|
+
ctx: ExecutionContext<Props>,
|
|
494
498
|
) => void | Promise<void>;
|
|
495
|
-
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
499
|
+
type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
496
500
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
497
501
|
env: Env,
|
|
498
|
-
ctx: ExecutionContext
|
|
502
|
+
ctx: ExecutionContext<Props>,
|
|
499
503
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
500
|
-
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
504
|
+
type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
501
505
|
controller: ScheduledController,
|
|
502
506
|
env: Env,
|
|
503
|
-
ctx: ExecutionContext
|
|
507
|
+
ctx: ExecutionContext<Props>,
|
|
504
508
|
) => void | Promise<void>;
|
|
505
|
-
type ExportedHandlerQueueHandler<
|
|
509
|
+
type ExportedHandlerQueueHandler<
|
|
510
|
+
Env = unknown,
|
|
511
|
+
Message = unknown,
|
|
512
|
+
Props = unknown,
|
|
513
|
+
> = (
|
|
506
514
|
batch: MessageBatch<Message>,
|
|
507
515
|
env: Env,
|
|
508
|
-
ctx: ExecutionContext
|
|
516
|
+
ctx: ExecutionContext<Props>,
|
|
509
517
|
) => void | Promise<void>;
|
|
510
|
-
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
518
|
+
type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
511
519
|
controller: TestController,
|
|
512
520
|
env: Env,
|
|
513
|
-
ctx: ExecutionContext
|
|
521
|
+
ctx: ExecutionContext<Props>,
|
|
514
522
|
) => void | Promise<void>;
|
|
515
523
|
interface ExportedHandler<
|
|
516
524
|
Env = unknown,
|
|
517
525
|
QueueHandlerMessage = unknown,
|
|
518
526
|
CfHostMetadata = unknown,
|
|
527
|
+
Props = unknown,
|
|
519
528
|
> {
|
|
520
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
521
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
522
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
523
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
524
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
525
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
526
|
-
email?: EmailExportedHandler<Env>;
|
|
527
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
529
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
530
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
531
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
532
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
533
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
534
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
535
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
536
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
528
537
|
}
|
|
529
538
|
interface StructuredSerializeOptions {
|
|
530
539
|
transfer?: any[];
|
|
@@ -3730,6 +3739,8 @@ interface Container {
|
|
|
3730
3739
|
signal(signo: number): void;
|
|
3731
3740
|
getTcpPort(port: number): Fetcher;
|
|
3732
3741
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3742
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3743
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3733
3744
|
}
|
|
3734
3745
|
interface ContainerStartupOptions {
|
|
3735
3746
|
entrypoint?: string[];
|
|
@@ -11098,10 +11109,10 @@ interface SendEmail {
|
|
|
11098
11109
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
11099
11110
|
readonly message: ForwardableEmailMessage;
|
|
11100
11111
|
}
|
|
11101
|
-
declare type EmailExportedHandler<Env = unknown> = (
|
|
11112
|
+
declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11102
11113
|
message: ForwardableEmailMessage,
|
|
11103
11114
|
env: Env,
|
|
11104
|
-
ctx: ExecutionContext
|
|
11115
|
+
ctx: ExecutionContext<Props>,
|
|
11105
11116
|
) => void | Promise<void>;
|
|
11106
11117
|
declare module "cloudflare:email" {
|
|
11107
11118
|
let _EmailMessage: {
|
package/2023-03-01/index.ts
CHANGED
|
@@ -482,54 +482,60 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
482
482
|
export type ExportedHandlerFetchHandler<
|
|
483
483
|
Env = unknown,
|
|
484
484
|
CfHostMetadata = unknown,
|
|
485
|
+
Props = unknown,
|
|
485
486
|
> = (
|
|
486
487
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
487
488
|
env: Env,
|
|
488
|
-
ctx: ExecutionContext
|
|
489
|
+
ctx: ExecutionContext<Props>,
|
|
489
490
|
) => Response | Promise<Response>;
|
|
490
|
-
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
491
|
+
export type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
491
492
|
events: TraceItem[],
|
|
492
493
|
env: Env,
|
|
493
|
-
ctx: ExecutionContext
|
|
494
|
+
ctx: ExecutionContext<Props>,
|
|
494
495
|
) => void | Promise<void>;
|
|
495
|
-
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
496
|
+
export type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
496
497
|
traces: TraceItem[],
|
|
497
498
|
env: Env,
|
|
498
|
-
ctx: ExecutionContext
|
|
499
|
+
ctx: ExecutionContext<Props>,
|
|
499
500
|
) => void | Promise<void>;
|
|
500
|
-
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
501
|
+
export type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
501
502
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
502
503
|
env: Env,
|
|
503
|
-
ctx: ExecutionContext
|
|
504
|
+
ctx: ExecutionContext<Props>,
|
|
504
505
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
505
|
-
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
506
|
+
export type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
506
507
|
controller: ScheduledController,
|
|
507
508
|
env: Env,
|
|
508
|
-
ctx: ExecutionContext
|
|
509
|
+
ctx: ExecutionContext<Props>,
|
|
509
510
|
) => void | Promise<void>;
|
|
510
|
-
export type ExportedHandlerQueueHandler<
|
|
511
|
+
export type ExportedHandlerQueueHandler<
|
|
512
|
+
Env = unknown,
|
|
513
|
+
Message = unknown,
|
|
514
|
+
Props = unknown,
|
|
515
|
+
> = (
|
|
511
516
|
batch: MessageBatch<Message>,
|
|
512
517
|
env: Env,
|
|
513
|
-
ctx: ExecutionContext
|
|
518
|
+
ctx: ExecutionContext<Props>,
|
|
514
519
|
) => void | Promise<void>;
|
|
515
|
-
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
520
|
+
export type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
516
521
|
controller: TestController,
|
|
517
522
|
env: Env,
|
|
518
|
-
ctx: ExecutionContext
|
|
523
|
+
ctx: ExecutionContext<Props>,
|
|
519
524
|
) => void | Promise<void>;
|
|
520
525
|
export interface ExportedHandler<
|
|
521
526
|
Env = unknown,
|
|
522
527
|
QueueHandlerMessage = unknown,
|
|
523
528
|
CfHostMetadata = unknown,
|
|
529
|
+
Props = unknown,
|
|
524
530
|
> {
|
|
525
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
526
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
527
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
528
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
529
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
530
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
531
|
-
email?: EmailExportedHandler<Env>;
|
|
532
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
531
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
532
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
533
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
534
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
535
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
536
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
537
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
538
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
533
539
|
}
|
|
534
540
|
export interface StructuredSerializeOptions {
|
|
535
541
|
transfer?: any[];
|
|
@@ -3739,6 +3745,8 @@ export interface Container {
|
|
|
3739
3745
|
signal(signo: number): void;
|
|
3740
3746
|
getTcpPort(port: number): Fetcher;
|
|
3741
3747
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3748
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3749
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3742
3750
|
}
|
|
3743
3751
|
export interface ContainerStartupOptions {
|
|
3744
3752
|
entrypoint?: string[];
|
|
@@ -11122,10 +11130,10 @@ export interface SendEmail {
|
|
|
11122
11130
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
11123
11131
|
readonly message: ForwardableEmailMessage;
|
|
11124
11132
|
}
|
|
11125
|
-
export declare type EmailExportedHandler<Env = unknown> = (
|
|
11133
|
+
export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11126
11134
|
message: ForwardableEmailMessage,
|
|
11127
11135
|
env: Env,
|
|
11128
|
-
ctx: ExecutionContext
|
|
11136
|
+
ctx: ExecutionContext<Props>,
|
|
11129
11137
|
) => void | Promise<void>;
|
|
11130
11138
|
/**
|
|
11131
11139
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|
package/2023-07-01/index.d.ts
CHANGED
|
@@ -477,54 +477,63 @@ interface ExecutionContext<Props = unknown> {
|
|
|
477
477
|
passThroughOnException(): void;
|
|
478
478
|
readonly props: Props;
|
|
479
479
|
}
|
|
480
|
-
type ExportedHandlerFetchHandler<
|
|
480
|
+
type ExportedHandlerFetchHandler<
|
|
481
|
+
Env = unknown,
|
|
482
|
+
CfHostMetadata = unknown,
|
|
483
|
+
Props = unknown,
|
|
484
|
+
> = (
|
|
481
485
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
482
486
|
env: Env,
|
|
483
|
-
ctx: ExecutionContext
|
|
487
|
+
ctx: ExecutionContext<Props>,
|
|
484
488
|
) => Response | Promise<Response>;
|
|
485
|
-
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
489
|
+
type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
486
490
|
events: TraceItem[],
|
|
487
491
|
env: Env,
|
|
488
|
-
ctx: ExecutionContext
|
|
492
|
+
ctx: ExecutionContext<Props>,
|
|
489
493
|
) => void | Promise<void>;
|
|
490
|
-
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
494
|
+
type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
491
495
|
traces: TraceItem[],
|
|
492
496
|
env: Env,
|
|
493
|
-
ctx: ExecutionContext
|
|
497
|
+
ctx: ExecutionContext<Props>,
|
|
494
498
|
) => void | Promise<void>;
|
|
495
|
-
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
499
|
+
type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
496
500
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
497
501
|
env: Env,
|
|
498
|
-
ctx: ExecutionContext
|
|
502
|
+
ctx: ExecutionContext<Props>,
|
|
499
503
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
500
|
-
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
504
|
+
type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
501
505
|
controller: ScheduledController,
|
|
502
506
|
env: Env,
|
|
503
|
-
ctx: ExecutionContext
|
|
507
|
+
ctx: ExecutionContext<Props>,
|
|
504
508
|
) => void | Promise<void>;
|
|
505
|
-
type ExportedHandlerQueueHandler<
|
|
509
|
+
type ExportedHandlerQueueHandler<
|
|
510
|
+
Env = unknown,
|
|
511
|
+
Message = unknown,
|
|
512
|
+
Props = unknown,
|
|
513
|
+
> = (
|
|
506
514
|
batch: MessageBatch<Message>,
|
|
507
515
|
env: Env,
|
|
508
|
-
ctx: ExecutionContext
|
|
516
|
+
ctx: ExecutionContext<Props>,
|
|
509
517
|
) => void | Promise<void>;
|
|
510
|
-
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
518
|
+
type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
511
519
|
controller: TestController,
|
|
512
520
|
env: Env,
|
|
513
|
-
ctx: ExecutionContext
|
|
521
|
+
ctx: ExecutionContext<Props>,
|
|
514
522
|
) => void | Promise<void>;
|
|
515
523
|
interface ExportedHandler<
|
|
516
524
|
Env = unknown,
|
|
517
525
|
QueueHandlerMessage = unknown,
|
|
518
526
|
CfHostMetadata = unknown,
|
|
527
|
+
Props = unknown,
|
|
519
528
|
> {
|
|
520
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
521
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
522
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
523
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
524
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
525
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
526
|
-
email?: EmailExportedHandler<Env>;
|
|
527
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
529
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
530
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
531
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
532
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
533
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
534
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
535
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
536
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
528
537
|
}
|
|
529
538
|
interface StructuredSerializeOptions {
|
|
530
539
|
transfer?: any[];
|
|
@@ -3730,6 +3739,8 @@ interface Container {
|
|
|
3730
3739
|
signal(signo: number): void;
|
|
3731
3740
|
getTcpPort(port: number): Fetcher;
|
|
3732
3741
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3742
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3743
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3733
3744
|
}
|
|
3734
3745
|
interface ContainerStartupOptions {
|
|
3735
3746
|
entrypoint?: string[];
|
|
@@ -11098,10 +11109,10 @@ interface SendEmail {
|
|
|
11098
11109
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
11099
11110
|
readonly message: ForwardableEmailMessage;
|
|
11100
11111
|
}
|
|
11101
|
-
declare type EmailExportedHandler<Env = unknown> = (
|
|
11112
|
+
declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11102
11113
|
message: ForwardableEmailMessage,
|
|
11103
11114
|
env: Env,
|
|
11104
|
-
ctx: ExecutionContext
|
|
11115
|
+
ctx: ExecutionContext<Props>,
|
|
11105
11116
|
) => void | Promise<void>;
|
|
11106
11117
|
declare module "cloudflare:email" {
|
|
11107
11118
|
let _EmailMessage: {
|
package/2023-07-01/index.ts
CHANGED
|
@@ -482,54 +482,60 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
482
482
|
export type ExportedHandlerFetchHandler<
|
|
483
483
|
Env = unknown,
|
|
484
484
|
CfHostMetadata = unknown,
|
|
485
|
+
Props = unknown,
|
|
485
486
|
> = (
|
|
486
487
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
487
488
|
env: Env,
|
|
488
|
-
ctx: ExecutionContext
|
|
489
|
+
ctx: ExecutionContext<Props>,
|
|
489
490
|
) => Response | Promise<Response>;
|
|
490
|
-
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
491
|
+
export type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
491
492
|
events: TraceItem[],
|
|
492
493
|
env: Env,
|
|
493
|
-
ctx: ExecutionContext
|
|
494
|
+
ctx: ExecutionContext<Props>,
|
|
494
495
|
) => void | Promise<void>;
|
|
495
|
-
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
496
|
+
export type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
496
497
|
traces: TraceItem[],
|
|
497
498
|
env: Env,
|
|
498
|
-
ctx: ExecutionContext
|
|
499
|
+
ctx: ExecutionContext<Props>,
|
|
499
500
|
) => void | Promise<void>;
|
|
500
|
-
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
501
|
+
export type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
501
502
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
502
503
|
env: Env,
|
|
503
|
-
ctx: ExecutionContext
|
|
504
|
+
ctx: ExecutionContext<Props>,
|
|
504
505
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
505
|
-
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
506
|
+
export type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
506
507
|
controller: ScheduledController,
|
|
507
508
|
env: Env,
|
|
508
|
-
ctx: ExecutionContext
|
|
509
|
+
ctx: ExecutionContext<Props>,
|
|
509
510
|
) => void | Promise<void>;
|
|
510
|
-
export type ExportedHandlerQueueHandler<
|
|
511
|
+
export type ExportedHandlerQueueHandler<
|
|
512
|
+
Env = unknown,
|
|
513
|
+
Message = unknown,
|
|
514
|
+
Props = unknown,
|
|
515
|
+
> = (
|
|
511
516
|
batch: MessageBatch<Message>,
|
|
512
517
|
env: Env,
|
|
513
|
-
ctx: ExecutionContext
|
|
518
|
+
ctx: ExecutionContext<Props>,
|
|
514
519
|
) => void | Promise<void>;
|
|
515
|
-
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
520
|
+
export type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
516
521
|
controller: TestController,
|
|
517
522
|
env: Env,
|
|
518
|
-
ctx: ExecutionContext
|
|
523
|
+
ctx: ExecutionContext<Props>,
|
|
519
524
|
) => void | Promise<void>;
|
|
520
525
|
export interface ExportedHandler<
|
|
521
526
|
Env = unknown,
|
|
522
527
|
QueueHandlerMessage = unknown,
|
|
523
528
|
CfHostMetadata = unknown,
|
|
529
|
+
Props = unknown,
|
|
524
530
|
> {
|
|
525
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
526
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
527
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
528
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
529
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
530
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
531
|
-
email?: EmailExportedHandler<Env>;
|
|
532
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
531
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
532
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
533
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
534
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
535
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
536
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
537
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
538
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
533
539
|
}
|
|
534
540
|
export interface StructuredSerializeOptions {
|
|
535
541
|
transfer?: any[];
|
|
@@ -3739,6 +3745,8 @@ export interface Container {
|
|
|
3739
3745
|
signal(signo: number): void;
|
|
3740
3746
|
getTcpPort(port: number): Fetcher;
|
|
3741
3747
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3748
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3749
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3742
3750
|
}
|
|
3743
3751
|
export interface ContainerStartupOptions {
|
|
3744
3752
|
entrypoint?: string[];
|
|
@@ -11122,10 +11130,10 @@ export interface SendEmail {
|
|
|
11122
11130
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
11123
11131
|
readonly message: ForwardableEmailMessage;
|
|
11124
11132
|
}
|
|
11125
|
-
export declare type EmailExportedHandler<Env = unknown> = (
|
|
11133
|
+
export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11126
11134
|
message: ForwardableEmailMessage,
|
|
11127
11135
|
env: Env,
|
|
11128
|
-
ctx: ExecutionContext
|
|
11136
|
+
ctx: ExecutionContext<Props>,
|
|
11129
11137
|
) => void | Promise<void>;
|
|
11130
11138
|
/**
|
|
11131
11139
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|
package/experimental/index.d.ts
CHANGED
|
@@ -494,54 +494,63 @@ interface ExecutionContext<Props = unknown> {
|
|
|
494
494
|
readonly props: Props;
|
|
495
495
|
abort(reason?: any): void;
|
|
496
496
|
}
|
|
497
|
-
type ExportedHandlerFetchHandler<
|
|
497
|
+
type ExportedHandlerFetchHandler<
|
|
498
|
+
Env = unknown,
|
|
499
|
+
CfHostMetadata = unknown,
|
|
500
|
+
Props = unknown,
|
|
501
|
+
> = (
|
|
498
502
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
499
503
|
env: Env,
|
|
500
|
-
ctx: ExecutionContext
|
|
504
|
+
ctx: ExecutionContext<Props>,
|
|
501
505
|
) => Response | Promise<Response>;
|
|
502
|
-
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
506
|
+
type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
503
507
|
events: TraceItem[],
|
|
504
508
|
env: Env,
|
|
505
|
-
ctx: ExecutionContext
|
|
509
|
+
ctx: ExecutionContext<Props>,
|
|
506
510
|
) => void | Promise<void>;
|
|
507
|
-
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
511
|
+
type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
508
512
|
traces: TraceItem[],
|
|
509
513
|
env: Env,
|
|
510
|
-
ctx: ExecutionContext
|
|
514
|
+
ctx: ExecutionContext<Props>,
|
|
511
515
|
) => void | Promise<void>;
|
|
512
|
-
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
516
|
+
type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
513
517
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
514
518
|
env: Env,
|
|
515
|
-
ctx: ExecutionContext
|
|
519
|
+
ctx: ExecutionContext<Props>,
|
|
516
520
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
517
|
-
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
521
|
+
type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
518
522
|
controller: ScheduledController,
|
|
519
523
|
env: Env,
|
|
520
|
-
ctx: ExecutionContext
|
|
524
|
+
ctx: ExecutionContext<Props>,
|
|
521
525
|
) => void | Promise<void>;
|
|
522
|
-
type ExportedHandlerQueueHandler<
|
|
526
|
+
type ExportedHandlerQueueHandler<
|
|
527
|
+
Env = unknown,
|
|
528
|
+
Message = unknown,
|
|
529
|
+
Props = unknown,
|
|
530
|
+
> = (
|
|
523
531
|
batch: MessageBatch<Message>,
|
|
524
532
|
env: Env,
|
|
525
|
-
ctx: ExecutionContext
|
|
533
|
+
ctx: ExecutionContext<Props>,
|
|
526
534
|
) => void | Promise<void>;
|
|
527
|
-
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
535
|
+
type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
528
536
|
controller: TestController,
|
|
529
537
|
env: Env,
|
|
530
|
-
ctx: ExecutionContext
|
|
538
|
+
ctx: ExecutionContext<Props>,
|
|
531
539
|
) => void | Promise<void>;
|
|
532
540
|
interface ExportedHandler<
|
|
533
541
|
Env = unknown,
|
|
534
542
|
QueueHandlerMessage = unknown,
|
|
535
543
|
CfHostMetadata = unknown,
|
|
544
|
+
Props = unknown,
|
|
536
545
|
> {
|
|
537
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
538
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
539
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
540
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
541
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
542
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
543
|
-
email?: EmailExportedHandler<Env>;
|
|
544
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
546
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
547
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
548
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
549
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
550
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
551
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
552
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
553
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
545
554
|
}
|
|
546
555
|
interface StructuredSerializeOptions {
|
|
547
556
|
transfer?: any[];
|
|
@@ -11780,10 +11789,10 @@ interface SendEmail {
|
|
|
11780
11789
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
11781
11790
|
readonly message: ForwardableEmailMessage;
|
|
11782
11791
|
}
|
|
11783
|
-
declare type EmailExportedHandler<Env = unknown> = (
|
|
11792
|
+
declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11784
11793
|
message: ForwardableEmailMessage,
|
|
11785
11794
|
env: Env,
|
|
11786
|
-
ctx: ExecutionContext
|
|
11795
|
+
ctx: ExecutionContext<Props>,
|
|
11787
11796
|
) => void | Promise<void>;
|
|
11788
11797
|
declare module "cloudflare:email" {
|
|
11789
11798
|
let _EmailMessage: {
|
package/experimental/index.ts
CHANGED
|
@@ -499,54 +499,60 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
499
499
|
export type ExportedHandlerFetchHandler<
|
|
500
500
|
Env = unknown,
|
|
501
501
|
CfHostMetadata = unknown,
|
|
502
|
+
Props = unknown,
|
|
502
503
|
> = (
|
|
503
504
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
504
505
|
env: Env,
|
|
505
|
-
ctx: ExecutionContext
|
|
506
|
+
ctx: ExecutionContext<Props>,
|
|
506
507
|
) => Response | Promise<Response>;
|
|
507
|
-
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
508
|
+
export type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
508
509
|
events: TraceItem[],
|
|
509
510
|
env: Env,
|
|
510
|
-
ctx: ExecutionContext
|
|
511
|
+
ctx: ExecutionContext<Props>,
|
|
511
512
|
) => void | Promise<void>;
|
|
512
|
-
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
513
|
+
export type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
513
514
|
traces: TraceItem[],
|
|
514
515
|
env: Env,
|
|
515
|
-
ctx: ExecutionContext
|
|
516
|
+
ctx: ExecutionContext<Props>,
|
|
516
517
|
) => void | Promise<void>;
|
|
517
|
-
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
518
|
+
export type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
518
519
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
519
520
|
env: Env,
|
|
520
|
-
ctx: ExecutionContext
|
|
521
|
+
ctx: ExecutionContext<Props>,
|
|
521
522
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
522
|
-
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
523
|
+
export type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
523
524
|
controller: ScheduledController,
|
|
524
525
|
env: Env,
|
|
525
|
-
ctx: ExecutionContext
|
|
526
|
+
ctx: ExecutionContext<Props>,
|
|
526
527
|
) => void | Promise<void>;
|
|
527
|
-
export type ExportedHandlerQueueHandler<
|
|
528
|
+
export type ExportedHandlerQueueHandler<
|
|
529
|
+
Env = unknown,
|
|
530
|
+
Message = unknown,
|
|
531
|
+
Props = unknown,
|
|
532
|
+
> = (
|
|
528
533
|
batch: MessageBatch<Message>,
|
|
529
534
|
env: Env,
|
|
530
|
-
ctx: ExecutionContext
|
|
535
|
+
ctx: ExecutionContext<Props>,
|
|
531
536
|
) => void | Promise<void>;
|
|
532
|
-
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
537
|
+
export type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
533
538
|
controller: TestController,
|
|
534
539
|
env: Env,
|
|
535
|
-
ctx: ExecutionContext
|
|
540
|
+
ctx: ExecutionContext<Props>,
|
|
536
541
|
) => void | Promise<void>;
|
|
537
542
|
export interface ExportedHandler<
|
|
538
543
|
Env = unknown,
|
|
539
544
|
QueueHandlerMessage = unknown,
|
|
540
545
|
CfHostMetadata = unknown,
|
|
546
|
+
Props = unknown,
|
|
541
547
|
> {
|
|
542
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
543
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
544
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
545
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
546
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
547
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
548
|
-
email?: EmailExportedHandler<Env>;
|
|
549
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
548
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
549
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
550
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
551
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
552
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
553
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
554
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
555
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
550
556
|
}
|
|
551
557
|
export interface StructuredSerializeOptions {
|
|
552
558
|
transfer?: any[];
|
|
@@ -11804,10 +11810,10 @@ export interface SendEmail {
|
|
|
11804
11810
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
11805
11811
|
readonly message: ForwardableEmailMessage;
|
|
11806
11812
|
}
|
|
11807
|
-
export declare type EmailExportedHandler<Env = unknown> = (
|
|
11813
|
+
export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11808
11814
|
message: ForwardableEmailMessage,
|
|
11809
11815
|
env: Env,
|
|
11810
|
-
ctx: ExecutionContext
|
|
11816
|
+
ctx: ExecutionContext<Props>,
|
|
11811
11817
|
) => void | Promise<void>;
|
|
11812
11818
|
/**
|
|
11813
11819
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|