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