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