@cloudflare/workers-types 4.20260306.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/2021-11-03/index.d.ts
CHANGED
|
@@ -469,54 +469,63 @@ interface ExecutionContext<Props = unknown> {
|
|
|
469
469
|
passThroughOnException(): void;
|
|
470
470
|
readonly props: Props;
|
|
471
471
|
}
|
|
472
|
-
type ExportedHandlerFetchHandler<
|
|
472
|
+
type ExportedHandlerFetchHandler<
|
|
473
|
+
Env = unknown,
|
|
474
|
+
CfHostMetadata = unknown,
|
|
475
|
+
Props = unknown,
|
|
476
|
+
> = (
|
|
473
477
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
474
478
|
env: Env,
|
|
475
|
-
ctx: ExecutionContext
|
|
479
|
+
ctx: ExecutionContext<Props>,
|
|
476
480
|
) => Response | Promise<Response>;
|
|
477
|
-
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
481
|
+
type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
478
482
|
events: TraceItem[],
|
|
479
483
|
env: Env,
|
|
480
|
-
ctx: ExecutionContext
|
|
484
|
+
ctx: ExecutionContext<Props>,
|
|
481
485
|
) => void | Promise<void>;
|
|
482
|
-
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
486
|
+
type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
483
487
|
traces: TraceItem[],
|
|
484
488
|
env: Env,
|
|
485
|
-
ctx: ExecutionContext
|
|
489
|
+
ctx: ExecutionContext<Props>,
|
|
486
490
|
) => void | Promise<void>;
|
|
487
|
-
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
491
|
+
type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
488
492
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
489
493
|
env: Env,
|
|
490
|
-
ctx: ExecutionContext
|
|
494
|
+
ctx: ExecutionContext<Props>,
|
|
491
495
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
492
|
-
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
496
|
+
type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
493
497
|
controller: ScheduledController,
|
|
494
498
|
env: Env,
|
|
495
|
-
ctx: ExecutionContext
|
|
499
|
+
ctx: ExecutionContext<Props>,
|
|
496
500
|
) => void | Promise<void>;
|
|
497
|
-
type ExportedHandlerQueueHandler<
|
|
501
|
+
type ExportedHandlerQueueHandler<
|
|
502
|
+
Env = unknown,
|
|
503
|
+
Message = unknown,
|
|
504
|
+
Props = unknown,
|
|
505
|
+
> = (
|
|
498
506
|
batch: MessageBatch<Message>,
|
|
499
507
|
env: Env,
|
|
500
|
-
ctx: ExecutionContext
|
|
508
|
+
ctx: ExecutionContext<Props>,
|
|
501
509
|
) => void | Promise<void>;
|
|
502
|
-
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
510
|
+
type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
503
511
|
controller: TestController,
|
|
504
512
|
env: Env,
|
|
505
|
-
ctx: ExecutionContext
|
|
513
|
+
ctx: ExecutionContext<Props>,
|
|
506
514
|
) => void | Promise<void>;
|
|
507
515
|
interface ExportedHandler<
|
|
508
516
|
Env = unknown,
|
|
509
517
|
QueueHandlerMessage = unknown,
|
|
510
518
|
CfHostMetadata = unknown,
|
|
519
|
+
Props = unknown,
|
|
511
520
|
> {
|
|
512
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
513
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
514
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
515
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
516
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
517
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
518
|
-
email?: EmailExportedHandler<Env>;
|
|
519
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
521
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
522
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
523
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
524
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
525
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
526
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
527
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
528
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
520
529
|
}
|
|
521
530
|
interface StructuredSerializeOptions {
|
|
522
531
|
transfer?: any[];
|
|
@@ -3623,6 +3632,8 @@ interface Container {
|
|
|
3623
3632
|
signal(signo: number): void;
|
|
3624
3633
|
getTcpPort(port: number): Fetcher;
|
|
3625
3634
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3635
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3636
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3626
3637
|
}
|
|
3627
3638
|
interface ContainerStartupOptions {
|
|
3628
3639
|
entrypoint?: string[];
|
|
@@ -10991,10 +11002,10 @@ interface SendEmail {
|
|
|
10991
11002
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
10992
11003
|
readonly message: ForwardableEmailMessage;
|
|
10993
11004
|
}
|
|
10994
|
-
declare type EmailExportedHandler<Env = unknown> = (
|
|
11005
|
+
declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
10995
11006
|
message: ForwardableEmailMessage,
|
|
10996
11007
|
env: Env,
|
|
10997
|
-
ctx: ExecutionContext
|
|
11008
|
+
ctx: ExecutionContext<Props>,
|
|
10998
11009
|
) => void | Promise<void>;
|
|
10999
11010
|
declare module "cloudflare:email" {
|
|
11000
11011
|
let _EmailMessage: {
|
package/2021-11-03/index.ts
CHANGED
|
@@ -474,54 +474,60 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
474
474
|
export type ExportedHandlerFetchHandler<
|
|
475
475
|
Env = unknown,
|
|
476
476
|
CfHostMetadata = unknown,
|
|
477
|
+
Props = unknown,
|
|
477
478
|
> = (
|
|
478
479
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
479
480
|
env: Env,
|
|
480
|
-
ctx: ExecutionContext
|
|
481
|
+
ctx: ExecutionContext<Props>,
|
|
481
482
|
) => Response | Promise<Response>;
|
|
482
|
-
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
483
|
+
export type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
483
484
|
events: TraceItem[],
|
|
484
485
|
env: Env,
|
|
485
|
-
ctx: ExecutionContext
|
|
486
|
+
ctx: ExecutionContext<Props>,
|
|
486
487
|
) => void | Promise<void>;
|
|
487
|
-
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
488
|
+
export type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
488
489
|
traces: TraceItem[],
|
|
489
490
|
env: Env,
|
|
490
|
-
ctx: ExecutionContext
|
|
491
|
+
ctx: ExecutionContext<Props>,
|
|
491
492
|
) => void | Promise<void>;
|
|
492
|
-
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
493
|
+
export type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
493
494
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
494
495
|
env: Env,
|
|
495
|
-
ctx: ExecutionContext
|
|
496
|
+
ctx: ExecutionContext<Props>,
|
|
496
497
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
497
|
-
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
498
|
+
export type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
498
499
|
controller: ScheduledController,
|
|
499
500
|
env: Env,
|
|
500
|
-
ctx: ExecutionContext
|
|
501
|
+
ctx: ExecutionContext<Props>,
|
|
501
502
|
) => void | Promise<void>;
|
|
502
|
-
export type ExportedHandlerQueueHandler<
|
|
503
|
+
export type ExportedHandlerQueueHandler<
|
|
504
|
+
Env = unknown,
|
|
505
|
+
Message = unknown,
|
|
506
|
+
Props = unknown,
|
|
507
|
+
> = (
|
|
503
508
|
batch: MessageBatch<Message>,
|
|
504
509
|
env: Env,
|
|
505
|
-
ctx: ExecutionContext
|
|
510
|
+
ctx: ExecutionContext<Props>,
|
|
506
511
|
) => void | Promise<void>;
|
|
507
|
-
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
512
|
+
export type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
508
513
|
controller: TestController,
|
|
509
514
|
env: Env,
|
|
510
|
-
ctx: ExecutionContext
|
|
515
|
+
ctx: ExecutionContext<Props>,
|
|
511
516
|
) => void | Promise<void>;
|
|
512
517
|
export interface ExportedHandler<
|
|
513
518
|
Env = unknown,
|
|
514
519
|
QueueHandlerMessage = unknown,
|
|
515
520
|
CfHostMetadata = unknown,
|
|
521
|
+
Props = unknown,
|
|
516
522
|
> {
|
|
517
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
518
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
519
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
520
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
521
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
522
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
523
|
-
email?: EmailExportedHandler<Env>;
|
|
524
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
523
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
524
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
525
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
526
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
527
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
528
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
529
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
530
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
525
531
|
}
|
|
526
532
|
export interface StructuredSerializeOptions {
|
|
527
533
|
transfer?: any[];
|
|
@@ -3632,6 +3638,8 @@ export interface Container {
|
|
|
3632
3638
|
signal(signo: number): void;
|
|
3633
3639
|
getTcpPort(port: number): Fetcher;
|
|
3634
3640
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3641
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3642
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3635
3643
|
}
|
|
3636
3644
|
export interface ContainerStartupOptions {
|
|
3637
3645
|
entrypoint?: string[];
|
|
@@ -11015,10 +11023,10 @@ export interface SendEmail {
|
|
|
11015
11023
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
11016
11024
|
readonly message: ForwardableEmailMessage;
|
|
11017
11025
|
}
|
|
11018
|
-
export declare type EmailExportedHandler<Env = unknown> = (
|
|
11026
|
+
export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11019
11027
|
message: ForwardableEmailMessage,
|
|
11020
11028
|
env: Env,
|
|
11021
|
-
ctx: ExecutionContext
|
|
11029
|
+
ctx: ExecutionContext<Props>,
|
|
11022
11030
|
) => void | Promise<void>;
|
|
11023
11031
|
/**
|
|
11024
11032
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|
package/2022-01-31/index.d.ts
CHANGED
|
@@ -469,54 +469,63 @@ interface ExecutionContext<Props = unknown> {
|
|
|
469
469
|
passThroughOnException(): void;
|
|
470
470
|
readonly props: Props;
|
|
471
471
|
}
|
|
472
|
-
type ExportedHandlerFetchHandler<
|
|
472
|
+
type ExportedHandlerFetchHandler<
|
|
473
|
+
Env = unknown,
|
|
474
|
+
CfHostMetadata = unknown,
|
|
475
|
+
Props = unknown,
|
|
476
|
+
> = (
|
|
473
477
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
474
478
|
env: Env,
|
|
475
|
-
ctx: ExecutionContext
|
|
479
|
+
ctx: ExecutionContext<Props>,
|
|
476
480
|
) => Response | Promise<Response>;
|
|
477
|
-
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
481
|
+
type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
478
482
|
events: TraceItem[],
|
|
479
483
|
env: Env,
|
|
480
|
-
ctx: ExecutionContext
|
|
484
|
+
ctx: ExecutionContext<Props>,
|
|
481
485
|
) => void | Promise<void>;
|
|
482
|
-
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
486
|
+
type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
483
487
|
traces: TraceItem[],
|
|
484
488
|
env: Env,
|
|
485
|
-
ctx: ExecutionContext
|
|
489
|
+
ctx: ExecutionContext<Props>,
|
|
486
490
|
) => void | Promise<void>;
|
|
487
|
-
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
491
|
+
type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
488
492
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
489
493
|
env: Env,
|
|
490
|
-
ctx: ExecutionContext
|
|
494
|
+
ctx: ExecutionContext<Props>,
|
|
491
495
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
492
|
-
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
496
|
+
type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
493
497
|
controller: ScheduledController,
|
|
494
498
|
env: Env,
|
|
495
|
-
ctx: ExecutionContext
|
|
499
|
+
ctx: ExecutionContext<Props>,
|
|
496
500
|
) => void | Promise<void>;
|
|
497
|
-
type ExportedHandlerQueueHandler<
|
|
501
|
+
type ExportedHandlerQueueHandler<
|
|
502
|
+
Env = unknown,
|
|
503
|
+
Message = unknown,
|
|
504
|
+
Props = unknown,
|
|
505
|
+
> = (
|
|
498
506
|
batch: MessageBatch<Message>,
|
|
499
507
|
env: Env,
|
|
500
|
-
ctx: ExecutionContext
|
|
508
|
+
ctx: ExecutionContext<Props>,
|
|
501
509
|
) => void | Promise<void>;
|
|
502
|
-
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
510
|
+
type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
503
511
|
controller: TestController,
|
|
504
512
|
env: Env,
|
|
505
|
-
ctx: ExecutionContext
|
|
513
|
+
ctx: ExecutionContext<Props>,
|
|
506
514
|
) => void | Promise<void>;
|
|
507
515
|
interface ExportedHandler<
|
|
508
516
|
Env = unknown,
|
|
509
517
|
QueueHandlerMessage = unknown,
|
|
510
518
|
CfHostMetadata = unknown,
|
|
519
|
+
Props = unknown,
|
|
511
520
|
> {
|
|
512
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
513
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
514
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
515
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
516
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
517
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
518
|
-
email?: EmailExportedHandler<Env>;
|
|
519
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
521
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
522
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
523
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
524
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
525
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
526
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
527
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
528
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
520
529
|
}
|
|
521
530
|
interface StructuredSerializeOptions {
|
|
522
531
|
transfer?: any[];
|
|
@@ -3690,6 +3699,8 @@ interface Container {
|
|
|
3690
3699
|
signal(signo: number): void;
|
|
3691
3700
|
getTcpPort(port: number): Fetcher;
|
|
3692
3701
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3702
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3703
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3693
3704
|
}
|
|
3694
3705
|
interface ContainerStartupOptions {
|
|
3695
3706
|
entrypoint?: string[];
|
|
@@ -11058,10 +11069,10 @@ interface SendEmail {
|
|
|
11058
11069
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
11059
11070
|
readonly message: ForwardableEmailMessage;
|
|
11060
11071
|
}
|
|
11061
|
-
declare type EmailExportedHandler<Env = unknown> = (
|
|
11072
|
+
declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11062
11073
|
message: ForwardableEmailMessage,
|
|
11063
11074
|
env: Env,
|
|
11064
|
-
ctx: ExecutionContext
|
|
11075
|
+
ctx: ExecutionContext<Props>,
|
|
11065
11076
|
) => void | Promise<void>;
|
|
11066
11077
|
declare module "cloudflare:email" {
|
|
11067
11078
|
let _EmailMessage: {
|
package/2022-01-31/index.ts
CHANGED
|
@@ -474,54 +474,60 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
474
474
|
export type ExportedHandlerFetchHandler<
|
|
475
475
|
Env = unknown,
|
|
476
476
|
CfHostMetadata = unknown,
|
|
477
|
+
Props = unknown,
|
|
477
478
|
> = (
|
|
478
479
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
479
480
|
env: Env,
|
|
480
|
-
ctx: ExecutionContext
|
|
481
|
+
ctx: ExecutionContext<Props>,
|
|
481
482
|
) => Response | Promise<Response>;
|
|
482
|
-
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
483
|
+
export type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
483
484
|
events: TraceItem[],
|
|
484
485
|
env: Env,
|
|
485
|
-
ctx: ExecutionContext
|
|
486
|
+
ctx: ExecutionContext<Props>,
|
|
486
487
|
) => void | Promise<void>;
|
|
487
|
-
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
488
|
+
export type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
488
489
|
traces: TraceItem[],
|
|
489
490
|
env: Env,
|
|
490
|
-
ctx: ExecutionContext
|
|
491
|
+
ctx: ExecutionContext<Props>,
|
|
491
492
|
) => void | Promise<void>;
|
|
492
|
-
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
493
|
+
export type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
493
494
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
494
495
|
env: Env,
|
|
495
|
-
ctx: ExecutionContext
|
|
496
|
+
ctx: ExecutionContext<Props>,
|
|
496
497
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
497
|
-
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
498
|
+
export type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
498
499
|
controller: ScheduledController,
|
|
499
500
|
env: Env,
|
|
500
|
-
ctx: ExecutionContext
|
|
501
|
+
ctx: ExecutionContext<Props>,
|
|
501
502
|
) => void | Promise<void>;
|
|
502
|
-
export type ExportedHandlerQueueHandler<
|
|
503
|
+
export type ExportedHandlerQueueHandler<
|
|
504
|
+
Env = unknown,
|
|
505
|
+
Message = unknown,
|
|
506
|
+
Props = unknown,
|
|
507
|
+
> = (
|
|
503
508
|
batch: MessageBatch<Message>,
|
|
504
509
|
env: Env,
|
|
505
|
-
ctx: ExecutionContext
|
|
510
|
+
ctx: ExecutionContext<Props>,
|
|
506
511
|
) => void | Promise<void>;
|
|
507
|
-
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
512
|
+
export type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
508
513
|
controller: TestController,
|
|
509
514
|
env: Env,
|
|
510
|
-
ctx: ExecutionContext
|
|
515
|
+
ctx: ExecutionContext<Props>,
|
|
511
516
|
) => void | Promise<void>;
|
|
512
517
|
export interface ExportedHandler<
|
|
513
518
|
Env = unknown,
|
|
514
519
|
QueueHandlerMessage = unknown,
|
|
515
520
|
CfHostMetadata = unknown,
|
|
521
|
+
Props = unknown,
|
|
516
522
|
> {
|
|
517
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
518
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
519
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
520
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
521
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
522
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
523
|
-
email?: EmailExportedHandler<Env>;
|
|
524
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
523
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
524
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
525
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
526
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
527
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
528
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
529
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
530
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
525
531
|
}
|
|
526
532
|
export interface StructuredSerializeOptions {
|
|
527
533
|
transfer?: any[];
|
|
@@ -3699,6 +3705,8 @@ export interface Container {
|
|
|
3699
3705
|
signal(signo: number): void;
|
|
3700
3706
|
getTcpPort(port: number): Fetcher;
|
|
3701
3707
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3708
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3709
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3702
3710
|
}
|
|
3703
3711
|
export interface ContainerStartupOptions {
|
|
3704
3712
|
entrypoint?: string[];
|
|
@@ -11082,10 +11090,10 @@ export interface SendEmail {
|
|
|
11082
11090
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
11083
11091
|
readonly message: ForwardableEmailMessage;
|
|
11084
11092
|
}
|
|
11085
|
-
export declare type EmailExportedHandler<Env = unknown> = (
|
|
11093
|
+
export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11086
11094
|
message: ForwardableEmailMessage,
|
|
11087
11095
|
env: Env,
|
|
11088
|
-
ctx: ExecutionContext
|
|
11096
|
+
ctx: ExecutionContext<Props>,
|
|
11089
11097
|
) => void | Promise<void>;
|
|
11090
11098
|
/**
|
|
11091
11099
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|
package/2022-03-21/index.d.ts
CHANGED
|
@@ -472,54 +472,63 @@ interface ExecutionContext<Props = unknown> {
|
|
|
472
472
|
passThroughOnException(): void;
|
|
473
473
|
readonly props: Props;
|
|
474
474
|
}
|
|
475
|
-
type ExportedHandlerFetchHandler<
|
|
475
|
+
type ExportedHandlerFetchHandler<
|
|
476
|
+
Env = unknown,
|
|
477
|
+
CfHostMetadata = unknown,
|
|
478
|
+
Props = unknown,
|
|
479
|
+
> = (
|
|
476
480
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
477
481
|
env: Env,
|
|
478
|
-
ctx: ExecutionContext
|
|
482
|
+
ctx: ExecutionContext<Props>,
|
|
479
483
|
) => Response | Promise<Response>;
|
|
480
|
-
type ExportedHandlerTailHandler<Env = unknown> = (
|
|
484
|
+
type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
481
485
|
events: TraceItem[],
|
|
482
486
|
env: Env,
|
|
483
|
-
ctx: ExecutionContext
|
|
487
|
+
ctx: ExecutionContext<Props>,
|
|
484
488
|
) => void | Promise<void>;
|
|
485
|
-
type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
489
|
+
type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
486
490
|
traces: TraceItem[],
|
|
487
491
|
env: Env,
|
|
488
|
-
ctx: ExecutionContext
|
|
492
|
+
ctx: ExecutionContext<Props>,
|
|
489
493
|
) => void | Promise<void>;
|
|
490
|
-
type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
494
|
+
type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
491
495
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
492
496
|
env: Env,
|
|
493
|
-
ctx: ExecutionContext
|
|
497
|
+
ctx: ExecutionContext<Props>,
|
|
494
498
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
495
|
-
type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
499
|
+
type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
496
500
|
controller: ScheduledController,
|
|
497
501
|
env: Env,
|
|
498
|
-
ctx: ExecutionContext
|
|
502
|
+
ctx: ExecutionContext<Props>,
|
|
499
503
|
) => void | Promise<void>;
|
|
500
|
-
type ExportedHandlerQueueHandler<
|
|
504
|
+
type ExportedHandlerQueueHandler<
|
|
505
|
+
Env = unknown,
|
|
506
|
+
Message = unknown,
|
|
507
|
+
Props = unknown,
|
|
508
|
+
> = (
|
|
501
509
|
batch: MessageBatch<Message>,
|
|
502
510
|
env: Env,
|
|
503
|
-
ctx: ExecutionContext
|
|
511
|
+
ctx: ExecutionContext<Props>,
|
|
504
512
|
) => void | Promise<void>;
|
|
505
|
-
type ExportedHandlerTestHandler<Env = unknown> = (
|
|
513
|
+
type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
506
514
|
controller: TestController,
|
|
507
515
|
env: Env,
|
|
508
|
-
ctx: ExecutionContext
|
|
516
|
+
ctx: ExecutionContext<Props>,
|
|
509
517
|
) => void | Promise<void>;
|
|
510
518
|
interface ExportedHandler<
|
|
511
519
|
Env = unknown,
|
|
512
520
|
QueueHandlerMessage = unknown,
|
|
513
521
|
CfHostMetadata = unknown,
|
|
522
|
+
Props = unknown,
|
|
514
523
|
> {
|
|
515
|
-
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
516
|
-
tail?: ExportedHandlerTailHandler<Env>;
|
|
517
|
-
trace?: ExportedHandlerTraceHandler<Env>;
|
|
518
|
-
tailStream?: ExportedHandlerTailStreamHandler<Env>;
|
|
519
|
-
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
520
|
-
test?: ExportedHandlerTestHandler<Env>;
|
|
521
|
-
email?: EmailExportedHandler<Env>;
|
|
522
|
-
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage>;
|
|
524
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
525
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
526
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
527
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
528
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
529
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
530
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
531
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
523
532
|
}
|
|
524
533
|
interface StructuredSerializeOptions {
|
|
525
534
|
transfer?: any[];
|
|
@@ -3698,6 +3707,8 @@ interface Container {
|
|
|
3698
3707
|
signal(signo: number): void;
|
|
3699
3708
|
getTcpPort(port: number): Fetcher;
|
|
3700
3709
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3710
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3711
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3701
3712
|
}
|
|
3702
3713
|
interface ContainerStartupOptions {
|
|
3703
3714
|
entrypoint?: string[];
|
|
@@ -11066,10 +11077,10 @@ interface SendEmail {
|
|
|
11066
11077
|
declare abstract class EmailEvent extends ExtendableEvent {
|
|
11067
11078
|
readonly message: ForwardableEmailMessage;
|
|
11068
11079
|
}
|
|
11069
|
-
declare type EmailExportedHandler<Env = unknown> = (
|
|
11080
|
+
declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11070
11081
|
message: ForwardableEmailMessage,
|
|
11071
11082
|
env: Env,
|
|
11072
|
-
ctx: ExecutionContext
|
|
11083
|
+
ctx: ExecutionContext<Props>,
|
|
11073
11084
|
) => void | Promise<void>;
|
|
11074
11085
|
declare module "cloudflare:email" {
|
|
11075
11086
|
let _EmailMessage: {
|
package/2022-03-21/index.ts
CHANGED
|
@@ -477,54 +477,60 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
477
477
|
export type ExportedHandlerFetchHandler<
|
|
478
478
|
Env = unknown,
|
|
479
479
|
CfHostMetadata = unknown,
|
|
480
|
+
Props = unknown,
|
|
480
481
|
> = (
|
|
481
482
|
request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>,
|
|
482
483
|
env: Env,
|
|
483
|
-
ctx: ExecutionContext
|
|
484
|
+
ctx: ExecutionContext<Props>,
|
|
484
485
|
) => Response | Promise<Response>;
|
|
485
|
-
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
486
|
+
export type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
|
|
486
487
|
events: TraceItem[],
|
|
487
488
|
env: Env,
|
|
488
|
-
ctx: ExecutionContext
|
|
489
|
+
ctx: ExecutionContext<Props>,
|
|
489
490
|
) => void | Promise<void>;
|
|
490
|
-
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
491
|
+
export type ExportedHandlerTraceHandler<Env = unknown, Props = unknown> = (
|
|
491
492
|
traces: TraceItem[],
|
|
492
493
|
env: Env,
|
|
493
|
-
ctx: ExecutionContext
|
|
494
|
+
ctx: ExecutionContext<Props>,
|
|
494
495
|
) => void | Promise<void>;
|
|
495
|
-
export type ExportedHandlerTailStreamHandler<Env = unknown> = (
|
|
496
|
+
export type ExportedHandlerTailStreamHandler<Env = unknown, Props = unknown> = (
|
|
496
497
|
event: TailStream.TailEvent<TailStream.Onset>,
|
|
497
498
|
env: Env,
|
|
498
|
-
ctx: ExecutionContext
|
|
499
|
+
ctx: ExecutionContext<Props>,
|
|
499
500
|
) => TailStream.TailEventHandlerType | Promise<TailStream.TailEventHandlerType>;
|
|
500
|
-
export type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
501
|
+
export type ExportedHandlerScheduledHandler<Env = unknown, Props = unknown> = (
|
|
501
502
|
controller: ScheduledController,
|
|
502
503
|
env: Env,
|
|
503
|
-
ctx: ExecutionContext
|
|
504
|
+
ctx: ExecutionContext<Props>,
|
|
504
505
|
) => void | Promise<void>;
|
|
505
|
-
export type ExportedHandlerQueueHandler<
|
|
506
|
+
export type ExportedHandlerQueueHandler<
|
|
507
|
+
Env = unknown,
|
|
508
|
+
Message = unknown,
|
|
509
|
+
Props = unknown,
|
|
510
|
+
> = (
|
|
506
511
|
batch: MessageBatch<Message>,
|
|
507
512
|
env: Env,
|
|
508
|
-
ctx: ExecutionContext
|
|
513
|
+
ctx: ExecutionContext<Props>,
|
|
509
514
|
) => void | Promise<void>;
|
|
510
|
-
export type ExportedHandlerTestHandler<Env = unknown> = (
|
|
515
|
+
export type ExportedHandlerTestHandler<Env = unknown, Props = unknown> = (
|
|
511
516
|
controller: TestController,
|
|
512
517
|
env: Env,
|
|
513
|
-
ctx: ExecutionContext
|
|
518
|
+
ctx: ExecutionContext<Props>,
|
|
514
519
|
) => void | Promise<void>;
|
|
515
520
|
export interface ExportedHandler<
|
|
516
521
|
Env = unknown,
|
|
517
522
|
QueueHandlerMessage = unknown,
|
|
518
523
|
CfHostMetadata = unknown,
|
|
524
|
+
Props = unknown,
|
|
519
525
|
> {
|
|
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>;
|
|
526
|
+
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
|
|
527
|
+
tail?: ExportedHandlerTailHandler<Env, Props>;
|
|
528
|
+
trace?: ExportedHandlerTraceHandler<Env, Props>;
|
|
529
|
+
tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
|
|
530
|
+
scheduled?: ExportedHandlerScheduledHandler<Env, Props>;
|
|
531
|
+
test?: ExportedHandlerTestHandler<Env, Props>;
|
|
532
|
+
email?: EmailExportedHandler<Env, Props>;
|
|
533
|
+
queue?: ExportedHandlerQueueHandler<Env, QueueHandlerMessage, Props>;
|
|
528
534
|
}
|
|
529
535
|
export interface StructuredSerializeOptions {
|
|
530
536
|
transfer?: any[];
|
|
@@ -3707,6 +3713,8 @@ export interface Container {
|
|
|
3707
3713
|
signal(signo: number): void;
|
|
3708
3714
|
getTcpPort(port: number): Fetcher;
|
|
3709
3715
|
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3716
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3717
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3710
3718
|
}
|
|
3711
3719
|
export interface ContainerStartupOptions {
|
|
3712
3720
|
entrypoint?: string[];
|
|
@@ -11090,10 +11098,10 @@ export interface SendEmail {
|
|
|
11090
11098
|
export declare abstract class EmailEvent extends ExtendableEvent {
|
|
11091
11099
|
readonly message: ForwardableEmailMessage;
|
|
11092
11100
|
}
|
|
11093
|
-
export declare type EmailExportedHandler<Env = unknown> = (
|
|
11101
|
+
export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
|
|
11094
11102
|
message: ForwardableEmailMessage,
|
|
11095
11103
|
env: Env,
|
|
11096
|
-
ctx: ExecutionContext
|
|
11104
|
+
ctx: ExecutionContext<Props>,
|
|
11097
11105
|
) => void | Promise<void>;
|
|
11098
11106
|
/**
|
|
11099
11107
|
* Hello World binding to serve as an explanatory example. DO NOT USE
|