@cloudflare/workers-types 4.20260615.1 → 4.20260617.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.
@@ -12162,87 +12162,6 @@ export declare abstract class BrowserRun {
12162
12162
  options: BrowserRunMarkdownOptions,
12163
12163
  ): Promise<Response>;
12164
12164
  }
12165
- export interface BasicImageTransformations {
12166
- /**
12167
- * Maximum width in image pixels. The value must be an integer.
12168
- */
12169
- width?: number;
12170
- /**
12171
- * Maximum height in image pixels. The value must be an integer.
12172
- */
12173
- height?: number;
12174
- /**
12175
- * Resizing mode as a string. It affects interpretation of width and height
12176
- * options:
12177
- * - scale-down: Similar to contain, but the image is never enlarged. If
12178
- * the image is larger than given width or height, it will be resized.
12179
- * Otherwise its original size will be kept.
12180
- * - contain: Resizes to maximum size that fits within the given width and
12181
- * height. If only a single dimension is given (e.g. only width), the
12182
- * image will be shrunk or enlarged to exactly match that dimension.
12183
- * Aspect ratio is always preserved.
12184
- * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
12185
- * and height. If the image has an aspect ratio different from the ratio
12186
- * of width and height, it will be cropped to fit.
12187
- * - crop: The image will be shrunk and cropped to fit within the area
12188
- * specified by width and height. The image will not be enlarged. For images
12189
- * smaller than the given dimensions it's the same as scale-down. For
12190
- * images larger than the given dimensions, it's the same as cover.
12191
- * See also trim.
12192
- * - pad: Resizes to the maximum size that fits within the given width and
12193
- * height, and then fills the remaining area with a background color
12194
- * (white by default). Use of this mode is not recommended, as the same
12195
- * effect can be more efficiently achieved with the contain mode and the
12196
- * CSS object-fit: contain property.
12197
- * - squeeze: Stretches and deforms to the width and height given, even if it
12198
- * breaks aspect ratio
12199
- */
12200
- fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
12201
- /**
12202
- * Image segmentation using artificial intelligence models. Sets pixels not
12203
- * within selected segment area to transparent e.g "foreground" sets every
12204
- * background pixel as transparent.
12205
- */
12206
- segment?: "foreground";
12207
- /**
12208
- * When cropping with fit: "cover", this defines the side or point that should
12209
- * be left uncropped. The value is either a string
12210
- * "left", "right", "top", "bottom", "auto", or "center" (the default),
12211
- * or an object {x, y} containing focal point coordinates in the original
12212
- * image expressed as fractions ranging from 0.0 (top or left) to 1.0
12213
- * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
12214
- * crop bottom or left and right sides as necessary, but won’t crop anything
12215
- * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
12216
- * preserve as much as possible around a point at 20% of the height of the
12217
- * source image.
12218
- */
12219
- gravity?:
12220
- | "face"
12221
- | "left"
12222
- | "right"
12223
- | "top"
12224
- | "bottom"
12225
- | "center"
12226
- | "auto"
12227
- | "entropy"
12228
- | BasicImageTransformationsGravityCoordinates;
12229
- /**
12230
- * Background color to add underneath the image. Applies only to images with
12231
- * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
12232
- * hsl(…), etc.)
12233
- */
12234
- background?: string;
12235
- /**
12236
- * Number of degrees (90, 180, 270) to rotate the image by. width and height
12237
- * options refer to axes after rotation.
12238
- */
12239
- rotate?: 0 | 90 | 180 | 270 | 360;
12240
- }
12241
- export interface BasicImageTransformationsGravityCoordinates {
12242
- x?: number;
12243
- y?: number;
12244
- mode?: "remainder" | "box-center";
12245
- }
12246
12165
  /**
12247
12166
  * In addition to the properties you can set in the RequestInit dict
12248
12167
  * that you pass as an argument to the Request constructor, you can
@@ -12338,6 +12257,209 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12338
12257
  */
12339
12258
  resolveOverride?: string;
12340
12259
  }
12260
+ export interface BasicImageTransformations {
12261
+ /**
12262
+ * Maximum width in image pixels. The value must be an integer.
12263
+ */
12264
+ width?: number;
12265
+ /**
12266
+ * Maximum height in image pixels. The value must be an integer.
12267
+ */
12268
+ height?: number;
12269
+ /**
12270
+ * When cropping with fit: "cover", this defines the side or point that should
12271
+ * be left uncropped. The value is either a string
12272
+ * "left", "right", "top", "bottom", "auto", or "center" (the default),
12273
+ * or an object {x, y} containing focal point coordinates in the original
12274
+ * image expressed as fractions ranging from 0.0 (top or left) to 1.0
12275
+ * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
12276
+ * crop bottom or left and right sides as necessary, but won’t crop anything
12277
+ * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
12278
+ * preserve as much as possible around a point at 20% of the height of the
12279
+ * source image.
12280
+ */
12281
+ gravity?:
12282
+ | "face"
12283
+ | "left"
12284
+ | "right"
12285
+ | "top"
12286
+ | "bottom"
12287
+ | "center"
12288
+ | "auto"
12289
+ | "entropy"
12290
+ | BasicImageTransformationsGravityCoordinates;
12291
+ /**
12292
+ * Specifies how closely the image is cropped toward detected faces when combined
12293
+ * with the gravity=face option. Accepts a valid range between 0.0 (includes as much
12294
+ * of the background as possible) and 1.0 (crops the image as closely to the face as
12295
+ * possible). The default is 0.
12296
+ */
12297
+ zoom?: number;
12298
+ /**
12299
+ * Resizing mode as a string. It affects interpretation of width and height
12300
+ * options:
12301
+ * - scale-down: Similar to contain, but the image is never enlarged. If
12302
+ * the image is larger than given width or height, it will be resized.
12303
+ * Otherwise its original size will be kept.
12304
+ * - scale-up: Similar to contain, but the image is never shrunk. If the
12305
+ * image is smaller than the given width or height, it will be resized.
12306
+ * Otherwise its original size will be kept.
12307
+ * - contain: Resizes to maximum size that fits within the given width and
12308
+ * height. If only a single dimension is given (e.g. only width), the
12309
+ * image will be shrunk or enlarged to exactly match that dimension.
12310
+ * Aspect ratio is always preserved.
12311
+ * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
12312
+ * and height. If the image has an aspect ratio different from the ratio
12313
+ * of width and height, it will be cropped to fit.
12314
+ * - crop: The image will be shrunk and cropped to fit within the area
12315
+ * specified by width and height. The image will not be enlarged. For images
12316
+ * smaller than the given dimensions it's the same as scale-down. For
12317
+ * images larger than the given dimensions, it's the same as cover.
12318
+ * See also trim.
12319
+ * - pad: Resizes to the maximum size that fits within the given width and
12320
+ * height, and then fills the remaining area with a background color
12321
+ * (white by default). Use of this mode is not recommended, as the same
12322
+ * effect can be more efficiently achieved with the contain mode and the
12323
+ * CSS object-fit: contain property.
12324
+ * - squeeze: Stretches and deforms to the width and height given, even if it
12325
+ * breaks aspect ratio
12326
+ */
12327
+ fit?:
12328
+ | "scale-down"
12329
+ | "scale-up"
12330
+ | "contain"
12331
+ | "cover"
12332
+ | "crop"
12333
+ | "pad"
12334
+ | "squeeze";
12335
+ /**
12336
+ * Allows you to trim your image. Takes dpr into account and is performed before
12337
+ * resizing or rotation.
12338
+ *
12339
+ * It can be used as:
12340
+ * - left, top, right, bottom - it will specify the number of pixels to cut
12341
+ * off each side
12342
+ * - width, height - the width/height you'd like to end up with - can be used
12343
+ * in combination with the properties above
12344
+ * - border - this will automatically trim the surroundings of an image based on
12345
+ * it's color. It consists of three properties:
12346
+ * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
12347
+ * - tolerance: difference from color to treat as color
12348
+ * - keep: the number of pixels of border to keep
12349
+ */
12350
+ trim?:
12351
+ | "border"
12352
+ | {
12353
+ top?: number;
12354
+ bottom?: number;
12355
+ left?: number;
12356
+ right?: number;
12357
+ width?: number;
12358
+ height?: number;
12359
+ border?:
12360
+ | boolean
12361
+ | {
12362
+ color?: string;
12363
+ tolerance?: number;
12364
+ keep?: number;
12365
+ };
12366
+ };
12367
+ /**
12368
+ * Background color to add underneath the image. Applies only to images with
12369
+ * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
12370
+ * hsl(…), etc.)
12371
+ */
12372
+ background?: string;
12373
+ /**
12374
+ * Flips the images horizontally, vertically, or both. Flipping is applied before
12375
+ * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
12376
+ * horizontally, then rotated by 90 degrees.
12377
+ */
12378
+ flip?: "h" | "v" | "hv";
12379
+ /**
12380
+ * Number of degrees (90, 180, 270) to rotate the image by. width and height
12381
+ * options refer to axes after rotation.
12382
+ */
12383
+ rotate?: 0 | 90 | 180 | 270 | 360;
12384
+ /**
12385
+ * Strength of sharpening filter to apply to the image. Floating-point
12386
+ * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
12387
+ * recommended value for downscaled images.
12388
+ */
12389
+ sharpen?: number;
12390
+ /**
12391
+ * Radius of a blur filter (approximate gaussian). Maximum supported radius
12392
+ * is 250.
12393
+ */
12394
+ blur?: number;
12395
+ /**
12396
+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
12397
+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
12398
+ * ignored.
12399
+ */
12400
+ contrast?: number;
12401
+ /**
12402
+ * Increase brightness by a factor. A value of 1.0 equals no change, a value
12403
+ * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
12404
+ * 0 is ignored.
12405
+ */
12406
+ brightness?: number;
12407
+ /**
12408
+ * Increase exposure by a factor. A value of 1.0 equals no change, a value of
12409
+ * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
12410
+ */
12411
+ gamma?: number;
12412
+ /**
12413
+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
12414
+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
12415
+ * ignored.
12416
+ */
12417
+ saturation?: number;
12418
+ /**
12419
+ * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
12420
+ * easier to specify higher-DPI sizes in <img srcset>.
12421
+ */
12422
+ dpr?: number;
12423
+ /**
12424
+ * Adds a border around the image. The border is added after resizing. Border
12425
+ * width takes dpr into account, and can be specified either using a single
12426
+ * width property, or individually for each side.
12427
+ */
12428
+ border?:
12429
+ | {
12430
+ color: string;
12431
+ width: number;
12432
+ }
12433
+ | {
12434
+ color: string;
12435
+ top: number;
12436
+ right: number;
12437
+ bottom: number;
12438
+ left: number;
12439
+ };
12440
+ /**
12441
+ * Image segmentation using artificial intelligence models. Sets pixels not
12442
+ * within selected segment area to transparent e.g "foreground" sets every
12443
+ * background pixel as transparent.
12444
+ */
12445
+ segment?: "foreground";
12446
+ /**
12447
+ * Controls the algorithm used when an image needs to be enlarged. This
12448
+ * parameter works with any fit mode that upscales, such as `contain`,
12449
+ * `cover`, and `scale-up`. It has no effect when `fit=scale-down` or when
12450
+ * the target dimensions are smaller than the source.
12451
+ * - interpolate: Uses bicubic interpolation, which may reduce image quality.
12452
+ * This is the default behavior when `upscale` is not specified.
12453
+ * - generate: Uses AI upscaling to produce sharper, more detailed results
12454
+ * when enlarging images.
12455
+ */
12456
+ upscale?: "interpolate" | "generate";
12457
+ }
12458
+ export interface BasicImageTransformationsGravityCoordinates {
12459
+ x?: number;
12460
+ y?: number;
12461
+ mode?: "remainder" | "box-center";
12462
+ }
12341
12463
  export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
12342
12464
  /**
12343
12465
  * Absolute URL of the image file to use for the drawing. It can be any of
@@ -12391,43 +12513,6 @@ export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformati
12391
12513
  right?: number;
12392
12514
  }
12393
12515
  export interface RequestInitCfPropertiesImage extends BasicImageTransformations {
12394
- /**
12395
- * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
12396
- * easier to specify higher-DPI sizes in <img srcset>.
12397
- */
12398
- dpr?: number;
12399
- /**
12400
- * Allows you to trim your image. Takes dpr into account and is performed before
12401
- * resizing or rotation.
12402
- *
12403
- * It can be used as:
12404
- * - left, top, right, bottom - it will specify the number of pixels to cut
12405
- * off each side
12406
- * - width, height - the width/height you'd like to end up with - can be used
12407
- * in combination with the properties above
12408
- * - border - this will automatically trim the surroundings of an image based on
12409
- * it's color. It consists of three properties:
12410
- * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
12411
- * - tolerance: difference from color to treat as color
12412
- * - keep: the number of pixels of border to keep
12413
- */
12414
- trim?:
12415
- | "border"
12416
- | {
12417
- top?: number;
12418
- bottom?: number;
12419
- left?: number;
12420
- right?: number;
12421
- width?: number;
12422
- height?: number;
12423
- border?:
12424
- | boolean
12425
- | {
12426
- color?: string;
12427
- tolerance?: number;
12428
- keep?: number;
12429
- };
12430
- };
12431
12516
  /**
12432
12517
  * Quality setting from 1-100 (useful values are in 60-90 range). Lower values
12433
12518
  * make images look worse, but load faster. The default is 85. It applies only
@@ -12477,17 +12562,6 @@ export interface RequestInitCfPropertiesImage extends BasicImageTransformations
12477
12562
  * output formats always discard metadata.
12478
12563
  */
12479
12564
  metadata?: "keep" | "copyright" | "none";
12480
- /**
12481
- * Strength of sharpening filter to apply to the image. Floating-point
12482
- * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
12483
- * recommended value for downscaled images.
12484
- */
12485
- sharpen?: number;
12486
- /**
12487
- * Radius of a blur filter (approximate gaussian). Maximum supported radius
12488
- * is 250.
12489
- */
12490
- blur?: number;
12491
12565
  /**
12492
12566
  * Overlays are drawn in the order they appear in the array (last array
12493
12567
  * entry is the topmost layer).
@@ -12499,52 +12573,6 @@ export interface RequestInitCfPropertiesImage extends BasicImageTransformations
12499
12573
  * the origin.
12500
12574
  */
12501
12575
  "origin-auth"?: "share-publicly";
12502
- /**
12503
- * Adds a border around the image. The border is added after resizing. Border
12504
- * width takes dpr into account, and can be specified either using a single
12505
- * width property, or individually for each side.
12506
- */
12507
- border?:
12508
- | {
12509
- color: string;
12510
- width: number;
12511
- }
12512
- | {
12513
- color: string;
12514
- top: number;
12515
- right: number;
12516
- bottom: number;
12517
- left: number;
12518
- };
12519
- /**
12520
- * Increase brightness by a factor. A value of 1.0 equals no change, a value
12521
- * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
12522
- * 0 is ignored.
12523
- */
12524
- brightness?: 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
- contrast?: number;
12531
- /**
12532
- * Increase exposure by a factor. A value of 1.0 equals no change, a value of
12533
- * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
12534
- */
12535
- gamma?: number;
12536
- /**
12537
- * Increase contrast by a factor. A value of 1.0 equals no change, a value of
12538
- * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
12539
- * ignored.
12540
- */
12541
- saturation?: number;
12542
- /**
12543
- * Flips the images horizontally, vertically, or both. Flipping is applied before
12544
- * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
12545
- * horizontally, then rotated by 90 degrees.
12546
- */
12547
- flip?: "h" | "v" | "hv";
12548
12576
  /**
12549
12577
  * Slightly reduces latency on a cache miss by selecting a
12550
12578
  * quickest-to-compress file format, at a cost of increased file size and
@@ -14443,6 +14471,10 @@ export declare namespace CloudflareWorkersModule {
14443
14471
  timeout?: WorkflowTimeoutDuration | number;
14444
14472
  sensitive?: WorkflowStepSensitivity;
14445
14473
  };
14474
+ export type WorkflowStepRollbackConfig = Pick<
14475
+ WorkflowStepConfig,
14476
+ "retries" | "timeout"
14477
+ >;
14446
14478
  export type WorkflowCronSchedule = {
14447
14479
  /** Cron expression that triggered this event. */
14448
14480
  cron: string;
@@ -14471,16 +14503,18 @@ export declare namespace CloudflareWorkersModule {
14471
14503
  config: WorkflowStepConfig;
14472
14504
  };
14473
14505
  export type WorkflowRollbackContext<T = unknown> = {
14506
+ ctx: WorkflowStepContext;
14474
14507
  error: Error;
14475
14508
  output: T | undefined;
14509
+ /** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
14476
14510
  stepName: string;
14477
14511
  };
14478
14512
  export type WorkflowRollbackHandler<T = unknown> = (
14479
14513
  ctx: WorkflowRollbackContext<T>,
14480
14514
  ) => Promise<void>;
14481
14515
  export type WorkflowStepRollbackOptions<T = unknown> = {
14482
- rollback?: WorkflowRollbackHandler<T>;
14483
- rollbackConfig?: WorkflowStepConfig;
14516
+ rollback: WorkflowRollbackHandler<T>;
14517
+ rollbackConfig?: WorkflowStepRollbackConfig;
14484
14518
  };
14485
14519
  export abstract class WorkflowStep {
14486
14520
  do<T extends Rpc.Serializable<T>>(