@cloudflare/workers-types 4.20260616.1 → 4.20260619.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 +307 -179
- package/2021-11-03/index.ts +307 -179
- package/2022-01-31/index.d.ts +307 -179
- package/2022-01-31/index.ts +307 -179
- package/2022-03-21/index.d.ts +307 -179
- package/2022-03-21/index.ts +307 -179
- package/2022-08-04/index.d.ts +307 -179
- package/2022-08-04/index.ts +307 -179
- package/2022-10-31/index.d.ts +307 -179
- package/2022-10-31/index.ts +307 -179
- package/2022-11-30/index.d.ts +307 -179
- package/2022-11-30/index.ts +307 -179
- package/2023-03-01/index.d.ts +307 -179
- package/2023-03-01/index.ts +307 -179
- package/2023-07-01/index.d.ts +307 -179
- package/2023-07-01/index.ts +307 -179
- package/experimental/index.d.ts +286 -179
- package/experimental/index.ts +286 -179
- package/index.d.ts +307 -179
- package/index.ts +307 -179
- package/latest/index.d.ts +307 -179
- package/latest/index.ts +307 -179
- package/oldest/index.d.ts +307 -179
- package/oldest/index.ts +307 -179
- package/package.json +1 -1
package/2022-08-04/index.d.ts
CHANGED
|
@@ -472,7 +472,8 @@ interface ExecutionContext<Props = unknown> {
|
|
|
472
472
|
passThroughOnException(): void;
|
|
473
473
|
readonly props: Props;
|
|
474
474
|
cache?: CacheContext;
|
|
475
|
-
|
|
475
|
+
readonly access?: CloudflareAccessContext;
|
|
476
|
+
tracing: Tracing;
|
|
476
477
|
}
|
|
477
478
|
type ExportedHandlerFetchHandler<
|
|
478
479
|
Env = unknown,
|
|
@@ -571,6 +572,10 @@ interface CachePurgeOptions {
|
|
|
571
572
|
interface CacheContext {
|
|
572
573
|
purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
|
|
573
574
|
}
|
|
575
|
+
interface CloudflareAccessContext {
|
|
576
|
+
readonly aud: string;
|
|
577
|
+
getIdentity(): Promise<CloudflareAccessIdentity | undefined>;
|
|
578
|
+
}
|
|
574
579
|
declare abstract class ColoLocalActorNamespace {
|
|
575
580
|
get(actorId: string): Fetcher;
|
|
576
581
|
}
|
|
@@ -636,6 +641,8 @@ type DurableObjectLocationHint =
|
|
|
636
641
|
| "weur"
|
|
637
642
|
| "eeur"
|
|
638
643
|
| "apac"
|
|
644
|
+
| "apac-ne"
|
|
645
|
+
| "apac-se"
|
|
639
646
|
| "oc"
|
|
640
647
|
| "afr"
|
|
641
648
|
| "me";
|
|
@@ -777,6 +784,7 @@ interface DurableObjectFacets {
|
|
|
777
784
|
): Fetcher<T>;
|
|
778
785
|
abort(name: string, reason: any): void;
|
|
779
786
|
delete(name: string): void;
|
|
787
|
+
clone(src: string, dst: string): void;
|
|
780
788
|
}
|
|
781
789
|
interface FacetStartupOptions<
|
|
782
790
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
@@ -3805,6 +3813,28 @@ interface EventSourceEventSourceInit {
|
|
|
3805
3813
|
withCredentials?: boolean;
|
|
3806
3814
|
fetcher?: Fetcher;
|
|
3807
3815
|
}
|
|
3816
|
+
interface ExecOutput {
|
|
3817
|
+
readonly stdout: ArrayBuffer;
|
|
3818
|
+
readonly stderr: ArrayBuffer;
|
|
3819
|
+
readonly exitCode: number;
|
|
3820
|
+
}
|
|
3821
|
+
interface ContainerExecOptions {
|
|
3822
|
+
cwd?: string;
|
|
3823
|
+
env?: Record<string, string>;
|
|
3824
|
+
user?: string;
|
|
3825
|
+
stdin?: ReadableStream | "pipe";
|
|
3826
|
+
stdout?: "pipe" | "ignore";
|
|
3827
|
+
stderr?: "pipe" | "ignore" | "combined";
|
|
3828
|
+
}
|
|
3829
|
+
interface ExecProcess {
|
|
3830
|
+
readonly stdin: WritableStream | null;
|
|
3831
|
+
readonly stdout: ReadableStream | null;
|
|
3832
|
+
readonly stderr: ReadableStream | null;
|
|
3833
|
+
readonly pid: number;
|
|
3834
|
+
readonly exitCode: Promise<number>;
|
|
3835
|
+
output(): Promise<ExecOutput>;
|
|
3836
|
+
kill(signal?: number): void;
|
|
3837
|
+
}
|
|
3808
3838
|
interface Container {
|
|
3809
3839
|
get running(): boolean;
|
|
3810
3840
|
start(options?: ContainerStartupOptions): void;
|
|
@@ -3822,6 +3852,7 @@ interface Container {
|
|
|
3822
3852
|
options: ContainerSnapshotOptions,
|
|
3823
3853
|
): Promise<ContainerSnapshot>;
|
|
3824
3854
|
interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
|
|
3855
|
+
exec(cmd: string[], options?: ContainerExecOptions): Promise<ExecProcess>;
|
|
3825
3856
|
}
|
|
3826
3857
|
interface ContainerDirectorySnapshot {
|
|
3827
3858
|
id: string;
|
|
@@ -3996,11 +4027,62 @@ interface Tracing {
|
|
|
3996
4027
|
callback: (span: Span, ...args: A) => T,
|
|
3997
4028
|
...args: A
|
|
3998
4029
|
): T;
|
|
4030
|
+
startActiveSpan<T, A extends unknown[]>(
|
|
4031
|
+
name: string,
|
|
4032
|
+
callback: (span: Span, ...args: A) => T,
|
|
4033
|
+
...args: A
|
|
4034
|
+
): T;
|
|
3999
4035
|
Span: typeof Span;
|
|
4000
4036
|
}
|
|
4001
4037
|
declare abstract class Span {
|
|
4002
4038
|
get isTraced(): boolean;
|
|
4003
4039
|
setAttribute(key: string, value?: boolean | number | string): void;
|
|
4040
|
+
end(): void;
|
|
4041
|
+
}
|
|
4042
|
+
/**
|
|
4043
|
+
* Represents the identity of a user authenticated via Cloudflare Access.
|
|
4044
|
+
* This matches the result of calling /cdn-cgi/access/get-identity.
|
|
4045
|
+
*
|
|
4046
|
+
* The exact structure of the returned object depends on the identity provider
|
|
4047
|
+
* configuration for the Access application. The fields below represent commonly
|
|
4048
|
+
* available properties, but additional provider-specific fields may be present.
|
|
4049
|
+
*/
|
|
4050
|
+
interface CloudflareAccessIdentity extends Record<string, unknown> {
|
|
4051
|
+
/** The user's email address, if available from the identity provider. */
|
|
4052
|
+
email?: string;
|
|
4053
|
+
/** The user's display name. */
|
|
4054
|
+
name?: string;
|
|
4055
|
+
/** The user's unique identifier. */
|
|
4056
|
+
user_uuid?: string;
|
|
4057
|
+
/** The Cloudflare account ID. */
|
|
4058
|
+
account_id?: string;
|
|
4059
|
+
/** Login timestamp (Unix epoch seconds). */
|
|
4060
|
+
iat?: number;
|
|
4061
|
+
/** The user's IP address at authentication time. */
|
|
4062
|
+
ip?: string;
|
|
4063
|
+
/** Authentication methods used (e.g., "pwd"). */
|
|
4064
|
+
amr?: string[];
|
|
4065
|
+
/** Identity provider information. */
|
|
4066
|
+
idp?: {
|
|
4067
|
+
id: string;
|
|
4068
|
+
type: string;
|
|
4069
|
+
};
|
|
4070
|
+
/** Geographic information about where the user authenticated. */
|
|
4071
|
+
geo?: {
|
|
4072
|
+
country: string;
|
|
4073
|
+
};
|
|
4074
|
+
/** Group memberships from the identity provider. */
|
|
4075
|
+
groups?: Array<{
|
|
4076
|
+
id: string;
|
|
4077
|
+
name: string;
|
|
4078
|
+
email?: string;
|
|
4079
|
+
}>;
|
|
4080
|
+
/** Device posture check results, keyed by check ID. */
|
|
4081
|
+
devicePosture?: Record<string, unknown>;
|
|
4082
|
+
/** True if the user connected via Cloudflare WARP. */
|
|
4083
|
+
is_warp?: boolean;
|
|
4084
|
+
/** True if the user is authenticated via Cloudflare Gateway. */
|
|
4085
|
+
is_gateway?: boolean;
|
|
4004
4086
|
}
|
|
4005
4087
|
// ============================================================================
|
|
4006
4088
|
// Agent Memory
|
|
@@ -12151,87 +12233,6 @@ declare abstract class BrowserRun {
|
|
|
12151
12233
|
options: BrowserRunMarkdownOptions,
|
|
12152
12234
|
): Promise<Response>;
|
|
12153
12235
|
}
|
|
12154
|
-
interface BasicImageTransformations {
|
|
12155
|
-
/**
|
|
12156
|
-
* Maximum width in image pixels. The value must be an integer.
|
|
12157
|
-
*/
|
|
12158
|
-
width?: number;
|
|
12159
|
-
/**
|
|
12160
|
-
* Maximum height in image pixels. The value must be an integer.
|
|
12161
|
-
*/
|
|
12162
|
-
height?: number;
|
|
12163
|
-
/**
|
|
12164
|
-
* Resizing mode as a string. It affects interpretation of width and height
|
|
12165
|
-
* options:
|
|
12166
|
-
* - scale-down: Similar to contain, but the image is never enlarged. If
|
|
12167
|
-
* the image is larger than given width or height, it will be resized.
|
|
12168
|
-
* Otherwise its original size will be kept.
|
|
12169
|
-
* - contain: Resizes to maximum size that fits within the given width and
|
|
12170
|
-
* height. If only a single dimension is given (e.g. only width), the
|
|
12171
|
-
* image will be shrunk or enlarged to exactly match that dimension.
|
|
12172
|
-
* Aspect ratio is always preserved.
|
|
12173
|
-
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
12174
|
-
* and height. If the image has an aspect ratio different from the ratio
|
|
12175
|
-
* of width and height, it will be cropped to fit.
|
|
12176
|
-
* - crop: The image will be shrunk and cropped to fit within the area
|
|
12177
|
-
* specified by width and height. The image will not be enlarged. For images
|
|
12178
|
-
* smaller than the given dimensions it's the same as scale-down. For
|
|
12179
|
-
* images larger than the given dimensions, it's the same as cover.
|
|
12180
|
-
* See also trim.
|
|
12181
|
-
* - pad: Resizes to the maximum size that fits within the given width and
|
|
12182
|
-
* height, and then fills the remaining area with a background color
|
|
12183
|
-
* (white by default). Use of this mode is not recommended, as the same
|
|
12184
|
-
* effect can be more efficiently achieved with the contain mode and the
|
|
12185
|
-
* CSS object-fit: contain property.
|
|
12186
|
-
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
12187
|
-
* breaks aspect ratio
|
|
12188
|
-
*/
|
|
12189
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
12190
|
-
/**
|
|
12191
|
-
* Image segmentation using artificial intelligence models. Sets pixels not
|
|
12192
|
-
* within selected segment area to transparent e.g "foreground" sets every
|
|
12193
|
-
* background pixel as transparent.
|
|
12194
|
-
*/
|
|
12195
|
-
segment?: "foreground";
|
|
12196
|
-
/**
|
|
12197
|
-
* When cropping with fit: "cover", this defines the side or point that should
|
|
12198
|
-
* be left uncropped. The value is either a string
|
|
12199
|
-
* "left", "right", "top", "bottom", "auto", or "center" (the default),
|
|
12200
|
-
* or an object {x, y} containing focal point coordinates in the original
|
|
12201
|
-
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
12202
|
-
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
12203
|
-
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
12204
|
-
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
12205
|
-
* preserve as much as possible around a point at 20% of the height of the
|
|
12206
|
-
* source image.
|
|
12207
|
-
*/
|
|
12208
|
-
gravity?:
|
|
12209
|
-
| "face"
|
|
12210
|
-
| "left"
|
|
12211
|
-
| "right"
|
|
12212
|
-
| "top"
|
|
12213
|
-
| "bottom"
|
|
12214
|
-
| "center"
|
|
12215
|
-
| "auto"
|
|
12216
|
-
| "entropy"
|
|
12217
|
-
| BasicImageTransformationsGravityCoordinates;
|
|
12218
|
-
/**
|
|
12219
|
-
* Background color to add underneath the image. Applies only to images with
|
|
12220
|
-
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
|
|
12221
|
-
* hsl(…), etc.)
|
|
12222
|
-
*/
|
|
12223
|
-
background?: string;
|
|
12224
|
-
/**
|
|
12225
|
-
* Number of degrees (90, 180, 270) to rotate the image by. width and height
|
|
12226
|
-
* options refer to axes after rotation.
|
|
12227
|
-
*/
|
|
12228
|
-
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
12229
|
-
}
|
|
12230
|
-
interface BasicImageTransformationsGravityCoordinates {
|
|
12231
|
-
x?: number;
|
|
12232
|
-
y?: number;
|
|
12233
|
-
mode?: "remainder" | "box-center";
|
|
12234
|
-
}
|
|
12235
12236
|
/**
|
|
12236
12237
|
* In addition to the properties you can set in the RequestInit dict
|
|
12237
12238
|
* that you pass as an argument to the Request constructor, you can
|
|
@@ -12307,6 +12308,17 @@ interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
12307
12308
|
cacheReserveMinimumFileSize?: number;
|
|
12308
12309
|
scrapeShield?: boolean;
|
|
12309
12310
|
apps?: boolean;
|
|
12311
|
+
/**
|
|
12312
|
+
* Controls whether an outbound gRPC-web subrequest from this Worker is
|
|
12313
|
+
* converted to gRPC at the Cloudflare edge.
|
|
12314
|
+
*
|
|
12315
|
+
* - `"passthrough"`: forward the subrequest unchanged as gRPC-web (default).
|
|
12316
|
+
* - `"convert"`: convert the gRPC-web subrequest to gRPC at the edge.
|
|
12317
|
+
*
|
|
12318
|
+
* Provides per-request control over the same edge conversion behavior
|
|
12319
|
+
* gated by the `auto_grpc_convert` compatibility flag.
|
|
12320
|
+
*/
|
|
12321
|
+
grpcWeb?: "passthrough" | "convert";
|
|
12310
12322
|
image?: RequestInitCfPropertiesImage;
|
|
12311
12323
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
12312
12324
|
mirage?: boolean;
|
|
@@ -12327,6 +12339,209 @@ interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
12327
12339
|
*/
|
|
12328
12340
|
resolveOverride?: string;
|
|
12329
12341
|
}
|
|
12342
|
+
interface BasicImageTransformations {
|
|
12343
|
+
/**
|
|
12344
|
+
* Maximum width in image pixels. The value must be an integer.
|
|
12345
|
+
*/
|
|
12346
|
+
width?: number;
|
|
12347
|
+
/**
|
|
12348
|
+
* Maximum height in image pixels. The value must be an integer.
|
|
12349
|
+
*/
|
|
12350
|
+
height?: number;
|
|
12351
|
+
/**
|
|
12352
|
+
* When cropping with fit: "cover", this defines the side or point that should
|
|
12353
|
+
* be left uncropped. The value is either a string
|
|
12354
|
+
* "left", "right", "top", "bottom", "auto", or "center" (the default),
|
|
12355
|
+
* or an object {x, y} containing focal point coordinates in the original
|
|
12356
|
+
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
12357
|
+
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
12358
|
+
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
12359
|
+
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
12360
|
+
* preserve as much as possible around a point at 20% of the height of the
|
|
12361
|
+
* source image.
|
|
12362
|
+
*/
|
|
12363
|
+
gravity?:
|
|
12364
|
+
| "face"
|
|
12365
|
+
| "left"
|
|
12366
|
+
| "right"
|
|
12367
|
+
| "top"
|
|
12368
|
+
| "bottom"
|
|
12369
|
+
| "center"
|
|
12370
|
+
| "auto"
|
|
12371
|
+
| "entropy"
|
|
12372
|
+
| BasicImageTransformationsGravityCoordinates;
|
|
12373
|
+
/**
|
|
12374
|
+
* Specifies how closely the image is cropped toward detected faces when combined
|
|
12375
|
+
* with the gravity=face option. Accepts a valid range between 0.0 (includes as much
|
|
12376
|
+
* of the background as possible) and 1.0 (crops the image as closely to the face as
|
|
12377
|
+
* possible). The default is 0.
|
|
12378
|
+
*/
|
|
12379
|
+
zoom?: number;
|
|
12380
|
+
/**
|
|
12381
|
+
* Resizing mode as a string. It affects interpretation of width and height
|
|
12382
|
+
* options:
|
|
12383
|
+
* - scale-down: Similar to contain, but the image is never enlarged. If
|
|
12384
|
+
* the image is larger than given width or height, it will be resized.
|
|
12385
|
+
* Otherwise its original size will be kept.
|
|
12386
|
+
* - scale-up: Similar to contain, but the image is never shrunk. If the
|
|
12387
|
+
* image is smaller than the given width or height, it will be resized.
|
|
12388
|
+
* Otherwise its original size will be kept.
|
|
12389
|
+
* - contain: Resizes to maximum size that fits within the given width and
|
|
12390
|
+
* height. If only a single dimension is given (e.g. only width), the
|
|
12391
|
+
* image will be shrunk or enlarged to exactly match that dimension.
|
|
12392
|
+
* Aspect ratio is always preserved.
|
|
12393
|
+
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
12394
|
+
* and height. If the image has an aspect ratio different from the ratio
|
|
12395
|
+
* of width and height, it will be cropped to fit.
|
|
12396
|
+
* - crop: The image will be shrunk and cropped to fit within the area
|
|
12397
|
+
* specified by width and height. The image will not be enlarged. For images
|
|
12398
|
+
* smaller than the given dimensions it's the same as scale-down. For
|
|
12399
|
+
* images larger than the given dimensions, it's the same as cover.
|
|
12400
|
+
* See also trim.
|
|
12401
|
+
* - pad: Resizes to the maximum size that fits within the given width and
|
|
12402
|
+
* height, and then fills the remaining area with a background color
|
|
12403
|
+
* (white by default). Use of this mode is not recommended, as the same
|
|
12404
|
+
* effect can be more efficiently achieved with the contain mode and the
|
|
12405
|
+
* CSS object-fit: contain property.
|
|
12406
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
12407
|
+
* breaks aspect ratio
|
|
12408
|
+
*/
|
|
12409
|
+
fit?:
|
|
12410
|
+
| "scale-down"
|
|
12411
|
+
| "scale-up"
|
|
12412
|
+
| "contain"
|
|
12413
|
+
| "cover"
|
|
12414
|
+
| "crop"
|
|
12415
|
+
| "pad"
|
|
12416
|
+
| "squeeze";
|
|
12417
|
+
/**
|
|
12418
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
12419
|
+
* resizing or rotation.
|
|
12420
|
+
*
|
|
12421
|
+
* It can be used as:
|
|
12422
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
12423
|
+
* off each side
|
|
12424
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
12425
|
+
* in combination with the properties above
|
|
12426
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
12427
|
+
* it's color. It consists of three properties:
|
|
12428
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
12429
|
+
* - tolerance: difference from color to treat as color
|
|
12430
|
+
* - keep: the number of pixels of border to keep
|
|
12431
|
+
*/
|
|
12432
|
+
trim?:
|
|
12433
|
+
| "border"
|
|
12434
|
+
| {
|
|
12435
|
+
top?: number;
|
|
12436
|
+
bottom?: number;
|
|
12437
|
+
left?: number;
|
|
12438
|
+
right?: number;
|
|
12439
|
+
width?: number;
|
|
12440
|
+
height?: number;
|
|
12441
|
+
border?:
|
|
12442
|
+
| boolean
|
|
12443
|
+
| {
|
|
12444
|
+
color?: string;
|
|
12445
|
+
tolerance?: number;
|
|
12446
|
+
keep?: number;
|
|
12447
|
+
};
|
|
12448
|
+
};
|
|
12449
|
+
/**
|
|
12450
|
+
* Background color to add underneath the image. Applies only to images with
|
|
12451
|
+
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
|
|
12452
|
+
* hsl(…), etc.)
|
|
12453
|
+
*/
|
|
12454
|
+
background?: string;
|
|
12455
|
+
/**
|
|
12456
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
12457
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
12458
|
+
* horizontally, then rotated by 90 degrees.
|
|
12459
|
+
*/
|
|
12460
|
+
flip?: "h" | "v" | "hv";
|
|
12461
|
+
/**
|
|
12462
|
+
* Number of degrees (90, 180, 270) to rotate the image by. width and height
|
|
12463
|
+
* options refer to axes after rotation.
|
|
12464
|
+
*/
|
|
12465
|
+
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
12466
|
+
/**
|
|
12467
|
+
* Strength of sharpening filter to apply to the image. Floating-point
|
|
12468
|
+
* number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
|
|
12469
|
+
* recommended value for downscaled images.
|
|
12470
|
+
*/
|
|
12471
|
+
sharpen?: number;
|
|
12472
|
+
/**
|
|
12473
|
+
* Radius of a blur filter (approximate gaussian). Maximum supported radius
|
|
12474
|
+
* is 250.
|
|
12475
|
+
*/
|
|
12476
|
+
blur?: number;
|
|
12477
|
+
/**
|
|
12478
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12479
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12480
|
+
* ignored.
|
|
12481
|
+
*/
|
|
12482
|
+
contrast?: number;
|
|
12483
|
+
/**
|
|
12484
|
+
* Increase brightness by a factor. A value of 1.0 equals no change, a value
|
|
12485
|
+
* of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
|
|
12486
|
+
* 0 is ignored.
|
|
12487
|
+
*/
|
|
12488
|
+
brightness?: number;
|
|
12489
|
+
/**
|
|
12490
|
+
* Increase exposure by a factor. A value of 1.0 equals no change, a value of
|
|
12491
|
+
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
12492
|
+
*/
|
|
12493
|
+
gamma?: number;
|
|
12494
|
+
/**
|
|
12495
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12496
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12497
|
+
* ignored.
|
|
12498
|
+
*/
|
|
12499
|
+
saturation?: number;
|
|
12500
|
+
/**
|
|
12501
|
+
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
12502
|
+
* easier to specify higher-DPI sizes in <img srcset>.
|
|
12503
|
+
*/
|
|
12504
|
+
dpr?: number;
|
|
12505
|
+
/**
|
|
12506
|
+
* Adds a border around the image. The border is added after resizing. Border
|
|
12507
|
+
* width takes dpr into account, and can be specified either using a single
|
|
12508
|
+
* width property, or individually for each side.
|
|
12509
|
+
*/
|
|
12510
|
+
border?:
|
|
12511
|
+
| {
|
|
12512
|
+
color: string;
|
|
12513
|
+
width: number;
|
|
12514
|
+
}
|
|
12515
|
+
| {
|
|
12516
|
+
color: string;
|
|
12517
|
+
top: number;
|
|
12518
|
+
right: number;
|
|
12519
|
+
bottom: number;
|
|
12520
|
+
left: number;
|
|
12521
|
+
};
|
|
12522
|
+
/**
|
|
12523
|
+
* Image segmentation using artificial intelligence models. Sets pixels not
|
|
12524
|
+
* within selected segment area to transparent e.g "foreground" sets every
|
|
12525
|
+
* background pixel as transparent.
|
|
12526
|
+
*/
|
|
12527
|
+
segment?: "foreground";
|
|
12528
|
+
/**
|
|
12529
|
+
* Controls the algorithm used when an image needs to be enlarged. This
|
|
12530
|
+
* parameter works with any fit mode that upscales, such as `contain`,
|
|
12531
|
+
* `cover`, and `scale-up`. It has no effect when `fit=scale-down` or when
|
|
12532
|
+
* the target dimensions are smaller than the source.
|
|
12533
|
+
* - interpolate: Uses bicubic interpolation, which may reduce image quality.
|
|
12534
|
+
* This is the default behavior when `upscale` is not specified.
|
|
12535
|
+
* - generate: Uses AI upscaling to produce sharper, more detailed results
|
|
12536
|
+
* when enlarging images.
|
|
12537
|
+
*/
|
|
12538
|
+
upscale?: "interpolate" | "generate";
|
|
12539
|
+
}
|
|
12540
|
+
interface BasicImageTransformationsGravityCoordinates {
|
|
12541
|
+
x?: number;
|
|
12542
|
+
y?: number;
|
|
12543
|
+
mode?: "remainder" | "box-center";
|
|
12544
|
+
}
|
|
12330
12545
|
interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
12331
12546
|
/**
|
|
12332
12547
|
* Absolute URL of the image file to use for the drawing. It can be any of
|
|
@@ -12380,43 +12595,6 @@ interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
|
12380
12595
|
right?: number;
|
|
12381
12596
|
}
|
|
12382
12597
|
interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
12383
|
-
/**
|
|
12384
|
-
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
12385
|
-
* easier to specify higher-DPI sizes in <img srcset>.
|
|
12386
|
-
*/
|
|
12387
|
-
dpr?: number;
|
|
12388
|
-
/**
|
|
12389
|
-
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
12390
|
-
* resizing or rotation.
|
|
12391
|
-
*
|
|
12392
|
-
* It can be used as:
|
|
12393
|
-
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
12394
|
-
* off each side
|
|
12395
|
-
* - width, height - the width/height you'd like to end up with - can be used
|
|
12396
|
-
* in combination with the properties above
|
|
12397
|
-
* - border - this will automatically trim the surroundings of an image based on
|
|
12398
|
-
* it's color. It consists of three properties:
|
|
12399
|
-
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
12400
|
-
* - tolerance: difference from color to treat as color
|
|
12401
|
-
* - keep: the number of pixels of border to keep
|
|
12402
|
-
*/
|
|
12403
|
-
trim?:
|
|
12404
|
-
| "border"
|
|
12405
|
-
| {
|
|
12406
|
-
top?: number;
|
|
12407
|
-
bottom?: number;
|
|
12408
|
-
left?: number;
|
|
12409
|
-
right?: number;
|
|
12410
|
-
width?: number;
|
|
12411
|
-
height?: number;
|
|
12412
|
-
border?:
|
|
12413
|
-
| boolean
|
|
12414
|
-
| {
|
|
12415
|
-
color?: string;
|
|
12416
|
-
tolerance?: number;
|
|
12417
|
-
keep?: number;
|
|
12418
|
-
};
|
|
12419
|
-
};
|
|
12420
12598
|
/**
|
|
12421
12599
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
12422
12600
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
@@ -12466,17 +12644,6 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
12466
12644
|
* output formats always discard metadata.
|
|
12467
12645
|
*/
|
|
12468
12646
|
metadata?: "keep" | "copyright" | "none";
|
|
12469
|
-
/**
|
|
12470
|
-
* Strength of sharpening filter to apply to the image. Floating-point
|
|
12471
|
-
* number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
|
|
12472
|
-
* recommended value for downscaled images.
|
|
12473
|
-
*/
|
|
12474
|
-
sharpen?: number;
|
|
12475
|
-
/**
|
|
12476
|
-
* Radius of a blur filter (approximate gaussian). Maximum supported radius
|
|
12477
|
-
* is 250.
|
|
12478
|
-
*/
|
|
12479
|
-
blur?: number;
|
|
12480
12647
|
/**
|
|
12481
12648
|
* Overlays are drawn in the order they appear in the array (last array
|
|
12482
12649
|
* entry is the topmost layer).
|
|
@@ -12488,52 +12655,6 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
12488
12655
|
* the origin.
|
|
12489
12656
|
*/
|
|
12490
12657
|
"origin-auth"?: "share-publicly";
|
|
12491
|
-
/**
|
|
12492
|
-
* Adds a border around the image. The border is added after resizing. Border
|
|
12493
|
-
* width takes dpr into account, and can be specified either using a single
|
|
12494
|
-
* width property, or individually for each side.
|
|
12495
|
-
*/
|
|
12496
|
-
border?:
|
|
12497
|
-
| {
|
|
12498
|
-
color: string;
|
|
12499
|
-
width: number;
|
|
12500
|
-
}
|
|
12501
|
-
| {
|
|
12502
|
-
color: string;
|
|
12503
|
-
top: number;
|
|
12504
|
-
right: number;
|
|
12505
|
-
bottom: number;
|
|
12506
|
-
left: number;
|
|
12507
|
-
};
|
|
12508
|
-
/**
|
|
12509
|
-
* Increase brightness by a factor. A value of 1.0 equals no change, a value
|
|
12510
|
-
* of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
|
|
12511
|
-
* 0 is ignored.
|
|
12512
|
-
*/
|
|
12513
|
-
brightness?: number;
|
|
12514
|
-
/**
|
|
12515
|
-
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12516
|
-
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12517
|
-
* ignored.
|
|
12518
|
-
*/
|
|
12519
|
-
contrast?: number;
|
|
12520
|
-
/**
|
|
12521
|
-
* Increase exposure by a factor. A value of 1.0 equals no change, a value of
|
|
12522
|
-
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
12523
|
-
*/
|
|
12524
|
-
gamma?: number;
|
|
12525
|
-
/**
|
|
12526
|
-
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12527
|
-
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12528
|
-
* ignored.
|
|
12529
|
-
*/
|
|
12530
|
-
saturation?: number;
|
|
12531
|
-
/**
|
|
12532
|
-
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
12533
|
-
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
12534
|
-
* horizontally, then rotated by 90 degrees.
|
|
12535
|
-
*/
|
|
12536
|
-
flip?: "h" | "v" | "hv";
|
|
12537
12658
|
/**
|
|
12538
12659
|
* Slightly reduces latency on a cache miss by selecting a
|
|
12539
12660
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -14473,6 +14594,10 @@ declare namespace CloudflareWorkersModule {
|
|
|
14473
14594
|
timeout?: WorkflowTimeoutDuration | number;
|
|
14474
14595
|
sensitive?: WorkflowStepSensitivity;
|
|
14475
14596
|
};
|
|
14597
|
+
export type WorkflowStepRollbackConfig = Pick<
|
|
14598
|
+
WorkflowStepConfig,
|
|
14599
|
+
"retries" | "timeout"
|
|
14600
|
+
>;
|
|
14476
14601
|
export type WorkflowCronSchedule = {
|
|
14477
14602
|
/** Cron expression that triggered this event. */
|
|
14478
14603
|
cron: string;
|
|
@@ -14501,16 +14626,18 @@ declare namespace CloudflareWorkersModule {
|
|
|
14501
14626
|
config: WorkflowStepConfig;
|
|
14502
14627
|
};
|
|
14503
14628
|
export type WorkflowRollbackContext<T = unknown> = {
|
|
14629
|
+
ctx: WorkflowStepContext;
|
|
14504
14630
|
error: Error;
|
|
14505
14631
|
output: T | undefined;
|
|
14632
|
+
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
|
14506
14633
|
stepName: string;
|
|
14507
14634
|
};
|
|
14508
14635
|
export type WorkflowRollbackHandler<T = unknown> = (
|
|
14509
14636
|
ctx: WorkflowRollbackContext<T>,
|
|
14510
14637
|
) => Promise<void>;
|
|
14511
14638
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
|
14512
|
-
rollback
|
|
14513
|
-
rollbackConfig?:
|
|
14639
|
+
rollback: WorkflowRollbackHandler<T>;
|
|
14640
|
+
rollbackConfig?: WorkflowStepRollbackConfig;
|
|
14514
14641
|
};
|
|
14515
14642
|
export abstract class WorkflowStep {
|
|
14516
14643
|
do<T extends Rpc.Serializable<T>>(
|
|
@@ -15479,7 +15606,8 @@ declare namespace TailStream {
|
|
|
15479
15606
|
| "loadShed"
|
|
15480
15607
|
| "responseStreamDisconnected"
|
|
15481
15608
|
| "scriptNotFound"
|
|
15482
|
-
| "internalError"
|
|
15609
|
+
| "internalError"
|
|
15610
|
+
| "exceededWallTime";
|
|
15483
15611
|
interface ScriptVersion {
|
|
15484
15612
|
readonly id: string;
|
|
15485
15613
|
readonly tag?: string;
|