@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.
package/oldest/index.ts CHANGED
@@ -12086,87 +12086,6 @@ export declare abstract class BrowserRun {
12086
12086
  options: BrowserRunMarkdownOptions,
12087
12087
  ): Promise<Response>;
12088
12088
  }
12089
- export interface BasicImageTransformations {
12090
- /**
12091
- * Maximum width in image pixels. The value must be an integer.
12092
- */
12093
- width?: number;
12094
- /**
12095
- * Maximum height in image pixels. The value must be an integer.
12096
- */
12097
- height?: number;
12098
- /**
12099
- * Resizing mode as a string. It affects interpretation of width and height
12100
- * options:
12101
- * - scale-down: Similar to contain, but the image is never enlarged. If
12102
- * the image is larger than given width or height, it will be resized.
12103
- * Otherwise its original size will be kept.
12104
- * - contain: Resizes to maximum size that fits within the given width and
12105
- * height. If only a single dimension is given (e.g. only width), the
12106
- * image will be shrunk or enlarged to exactly match that dimension.
12107
- * Aspect ratio is always preserved.
12108
- * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
12109
- * and height. If the image has an aspect ratio different from the ratio
12110
- * of width and height, it will be cropped to fit.
12111
- * - crop: The image will be shrunk and cropped to fit within the area
12112
- * specified by width and height. The image will not be enlarged. For images
12113
- * smaller than the given dimensions it's the same as scale-down. For
12114
- * images larger than the given dimensions, it's the same as cover.
12115
- * See also trim.
12116
- * - pad: Resizes to the maximum size that fits within the given width and
12117
- * height, and then fills the remaining area with a background color
12118
- * (white by default). Use of this mode is not recommended, as the same
12119
- * effect can be more efficiently achieved with the contain mode and the
12120
- * CSS object-fit: contain property.
12121
- * - squeeze: Stretches and deforms to the width and height given, even if it
12122
- * breaks aspect ratio
12123
- */
12124
- fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
12125
- /**
12126
- * Image segmentation using artificial intelligence models. Sets pixels not
12127
- * within selected segment area to transparent e.g "foreground" sets every
12128
- * background pixel as transparent.
12129
- */
12130
- segment?: "foreground";
12131
- /**
12132
- * When cropping with fit: "cover", this defines the side or point that should
12133
- * be left uncropped. The value is either a string
12134
- * "left", "right", "top", "bottom", "auto", or "center" (the default),
12135
- * or an object {x, y} containing focal point coordinates in the original
12136
- * image expressed as fractions ranging from 0.0 (top or left) to 1.0
12137
- * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
12138
- * crop bottom or left and right sides as necessary, but won’t crop anything
12139
- * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
12140
- * preserve as much as possible around a point at 20% of the height of the
12141
- * source image.
12142
- */
12143
- gravity?:
12144
- | "face"
12145
- | "left"
12146
- | "right"
12147
- | "top"
12148
- | "bottom"
12149
- | "center"
12150
- | "auto"
12151
- | "entropy"
12152
- | BasicImageTransformationsGravityCoordinates;
12153
- /**
12154
- * Background color to add underneath the image. Applies only to images with
12155
- * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
12156
- * hsl(…), etc.)
12157
- */
12158
- background?: string;
12159
- /**
12160
- * Number of degrees (90, 180, 270) to rotate the image by. width and height
12161
- * options refer to axes after rotation.
12162
- */
12163
- rotate?: 0 | 90 | 180 | 270 | 360;
12164
- }
12165
- export interface BasicImageTransformationsGravityCoordinates {
12166
- x?: number;
12167
- y?: number;
12168
- mode?: "remainder" | "box-center";
12169
- }
12170
12089
  /**
12171
12090
  * In addition to the properties you can set in the RequestInit dict
12172
12091
  * that you pass as an argument to the Request constructor, you can
@@ -12262,6 +12181,209 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
12262
12181
  */
12263
12182
  resolveOverride?: string;
12264
12183
  }
12184
+ export interface BasicImageTransformations {
12185
+ /**
12186
+ * Maximum width in image pixels. The value must be an integer.
12187
+ */
12188
+ width?: number;
12189
+ /**
12190
+ * Maximum height in image pixels. The value must be an integer.
12191
+ */
12192
+ height?: number;
12193
+ /**
12194
+ * When cropping with fit: "cover", this defines the side or point that should
12195
+ * be left uncropped. The value is either a string
12196
+ * "left", "right", "top", "bottom", "auto", or "center" (the default),
12197
+ * or an object {x, y} containing focal point coordinates in the original
12198
+ * image expressed as fractions ranging from 0.0 (top or left) to 1.0
12199
+ * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
12200
+ * crop bottom or left and right sides as necessary, but won’t crop anything
12201
+ * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
12202
+ * preserve as much as possible around a point at 20% of the height of the
12203
+ * source image.
12204
+ */
12205
+ gravity?:
12206
+ | "face"
12207
+ | "left"
12208
+ | "right"
12209
+ | "top"
12210
+ | "bottom"
12211
+ | "center"
12212
+ | "auto"
12213
+ | "entropy"
12214
+ | BasicImageTransformationsGravityCoordinates;
12215
+ /**
12216
+ * Specifies how closely the image is cropped toward detected faces when combined
12217
+ * with the gravity=face option. Accepts a valid range between 0.0 (includes as much
12218
+ * of the background as possible) and 1.0 (crops the image as closely to the face as
12219
+ * possible). The default is 0.
12220
+ */
12221
+ zoom?: number;
12222
+ /**
12223
+ * Resizing mode as a string. It affects interpretation of width and height
12224
+ * options:
12225
+ * - scale-down: Similar to contain, but the image is never enlarged. If
12226
+ * the image is larger than given width or height, it will be resized.
12227
+ * Otherwise its original size will be kept.
12228
+ * - scale-up: Similar to contain, but the image is never shrunk. If the
12229
+ * image is smaller than the given width or height, it will be resized.
12230
+ * Otherwise its original size will be kept.
12231
+ * - contain: Resizes to maximum size that fits within the given width and
12232
+ * height. If only a single dimension is given (e.g. only width), the
12233
+ * image will be shrunk or enlarged to exactly match that dimension.
12234
+ * Aspect ratio is always preserved.
12235
+ * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
12236
+ * and height. If the image has an aspect ratio different from the ratio
12237
+ * of width and height, it will be cropped to fit.
12238
+ * - crop: The image will be shrunk and cropped to fit within the area
12239
+ * specified by width and height. The image will not be enlarged. For images
12240
+ * smaller than the given dimensions it's the same as scale-down. For
12241
+ * images larger than the given dimensions, it's the same as cover.
12242
+ * See also trim.
12243
+ * - pad: Resizes to the maximum size that fits within the given width and
12244
+ * height, and then fills the remaining area with a background color
12245
+ * (white by default). Use of this mode is not recommended, as the same
12246
+ * effect can be more efficiently achieved with the contain mode and the
12247
+ * CSS object-fit: contain property.
12248
+ * - squeeze: Stretches and deforms to the width and height given, even if it
12249
+ * breaks aspect ratio
12250
+ */
12251
+ fit?:
12252
+ | "scale-down"
12253
+ | "scale-up"
12254
+ | "contain"
12255
+ | "cover"
12256
+ | "crop"
12257
+ | "pad"
12258
+ | "squeeze";
12259
+ /**
12260
+ * Allows you to trim your image. Takes dpr into account and is performed before
12261
+ * resizing or rotation.
12262
+ *
12263
+ * It can be used as:
12264
+ * - left, top, right, bottom - it will specify the number of pixels to cut
12265
+ * off each side
12266
+ * - width, height - the width/height you'd like to end up with - can be used
12267
+ * in combination with the properties above
12268
+ * - border - this will automatically trim the surroundings of an image based on
12269
+ * it's color. It consists of three properties:
12270
+ * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
12271
+ * - tolerance: difference from color to treat as color
12272
+ * - keep: the number of pixels of border to keep
12273
+ */
12274
+ trim?:
12275
+ | "border"
12276
+ | {
12277
+ top?: number;
12278
+ bottom?: number;
12279
+ left?: number;
12280
+ right?: number;
12281
+ width?: number;
12282
+ height?: number;
12283
+ border?:
12284
+ | boolean
12285
+ | {
12286
+ color?: string;
12287
+ tolerance?: number;
12288
+ keep?: number;
12289
+ };
12290
+ };
12291
+ /**
12292
+ * Background color to add underneath the image. Applies only to images with
12293
+ * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
12294
+ * hsl(…), etc.)
12295
+ */
12296
+ background?: string;
12297
+ /**
12298
+ * Flips the images horizontally, vertically, or both. Flipping is applied before
12299
+ * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
12300
+ * horizontally, then rotated by 90 degrees.
12301
+ */
12302
+ flip?: "h" | "v" | "hv";
12303
+ /**
12304
+ * Number of degrees (90, 180, 270) to rotate the image by. width and height
12305
+ * options refer to axes after rotation.
12306
+ */
12307
+ rotate?: 0 | 90 | 180 | 270 | 360;
12308
+ /**
12309
+ * Strength of sharpening filter to apply to the image. Floating-point
12310
+ * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
12311
+ * recommended value for downscaled images.
12312
+ */
12313
+ sharpen?: number;
12314
+ /**
12315
+ * Radius of a blur filter (approximate gaussian). Maximum supported radius
12316
+ * is 250.
12317
+ */
12318
+ blur?: number;
12319
+ /**
12320
+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
12321
+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
12322
+ * ignored.
12323
+ */
12324
+ contrast?: number;
12325
+ /**
12326
+ * Increase brightness by a factor. A value of 1.0 equals no change, a value
12327
+ * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
12328
+ * 0 is ignored.
12329
+ */
12330
+ brightness?: number;
12331
+ /**
12332
+ * Increase exposure by a factor. A value of 1.0 equals no change, a value of
12333
+ * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
12334
+ */
12335
+ gamma?: number;
12336
+ /**
12337
+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
12338
+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
12339
+ * ignored.
12340
+ */
12341
+ saturation?: number;
12342
+ /**
12343
+ * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
12344
+ * easier to specify higher-DPI sizes in <img srcset>.
12345
+ */
12346
+ dpr?: number;
12347
+ /**
12348
+ * Adds a border around the image. The border is added after resizing. Border
12349
+ * width takes dpr into account, and can be specified either using a single
12350
+ * width property, or individually for each side.
12351
+ */
12352
+ border?:
12353
+ | {
12354
+ color: string;
12355
+ width: number;
12356
+ }
12357
+ | {
12358
+ color: string;
12359
+ top: number;
12360
+ right: number;
12361
+ bottom: number;
12362
+ left: number;
12363
+ };
12364
+ /**
12365
+ * Image segmentation using artificial intelligence models. Sets pixels not
12366
+ * within selected segment area to transparent e.g "foreground" sets every
12367
+ * background pixel as transparent.
12368
+ */
12369
+ segment?: "foreground";
12370
+ /**
12371
+ * Controls the algorithm used when an image needs to be enlarged. This
12372
+ * parameter works with any fit mode that upscales, such as `contain`,
12373
+ * `cover`, and `scale-up`. It has no effect when `fit=scale-down` or when
12374
+ * the target dimensions are smaller than the source.
12375
+ * - interpolate: Uses bicubic interpolation, which may reduce image quality.
12376
+ * This is the default behavior when `upscale` is not specified.
12377
+ * - generate: Uses AI upscaling to produce sharper, more detailed results
12378
+ * when enlarging images.
12379
+ */
12380
+ upscale?: "interpolate" | "generate";
12381
+ }
12382
+ export interface BasicImageTransformationsGravityCoordinates {
12383
+ x?: number;
12384
+ y?: number;
12385
+ mode?: "remainder" | "box-center";
12386
+ }
12265
12387
  export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
12266
12388
  /**
12267
12389
  * Absolute URL of the image file to use for the drawing. It can be any of
@@ -12315,43 +12437,6 @@ export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformati
12315
12437
  right?: number;
12316
12438
  }
12317
12439
  export interface RequestInitCfPropertiesImage extends BasicImageTransformations {
12318
- /**
12319
- * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
12320
- * easier to specify higher-DPI sizes in <img srcset>.
12321
- */
12322
- dpr?: number;
12323
- /**
12324
- * Allows you to trim your image. Takes dpr into account and is performed before
12325
- * resizing or rotation.
12326
- *
12327
- * It can be used as:
12328
- * - left, top, right, bottom - it will specify the number of pixels to cut
12329
- * off each side
12330
- * - width, height - the width/height you'd like to end up with - can be used
12331
- * in combination with the properties above
12332
- * - border - this will automatically trim the surroundings of an image based on
12333
- * it's color. It consists of three properties:
12334
- * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
12335
- * - tolerance: difference from color to treat as color
12336
- * - keep: the number of pixels of border to keep
12337
- */
12338
- trim?:
12339
- | "border"
12340
- | {
12341
- top?: number;
12342
- bottom?: number;
12343
- left?: number;
12344
- right?: number;
12345
- width?: number;
12346
- height?: number;
12347
- border?:
12348
- | boolean
12349
- | {
12350
- color?: string;
12351
- tolerance?: number;
12352
- keep?: number;
12353
- };
12354
- };
12355
12440
  /**
12356
12441
  * Quality setting from 1-100 (useful values are in 60-90 range). Lower values
12357
12442
  * make images look worse, but load faster. The default is 85. It applies only
@@ -12401,17 +12486,6 @@ export interface RequestInitCfPropertiesImage extends BasicImageTransformations
12401
12486
  * output formats always discard metadata.
12402
12487
  */
12403
12488
  metadata?: "keep" | "copyright" | "none";
12404
- /**
12405
- * Strength of sharpening filter to apply to the image. Floating-point
12406
- * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
12407
- * recommended value for downscaled images.
12408
- */
12409
- sharpen?: number;
12410
- /**
12411
- * Radius of a blur filter (approximate gaussian). Maximum supported radius
12412
- * is 250.
12413
- */
12414
- blur?: number;
12415
12489
  /**
12416
12490
  * Overlays are drawn in the order they appear in the array (last array
12417
12491
  * entry is the topmost layer).
@@ -12423,52 +12497,6 @@ export interface RequestInitCfPropertiesImage extends BasicImageTransformations
12423
12497
  * the origin.
12424
12498
  */
12425
12499
  "origin-auth"?: "share-publicly";
12426
- /**
12427
- * Adds a border around the image. The border is added after resizing. Border
12428
- * width takes dpr into account, and can be specified either using a single
12429
- * width property, or individually for each side.
12430
- */
12431
- border?:
12432
- | {
12433
- color: string;
12434
- width: number;
12435
- }
12436
- | {
12437
- color: string;
12438
- top: number;
12439
- right: number;
12440
- bottom: number;
12441
- left: number;
12442
- };
12443
- /**
12444
- * Increase brightness by a factor. A value of 1.0 equals no change, a value
12445
- * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
12446
- * 0 is ignored.
12447
- */
12448
- brightness?: number;
12449
- /**
12450
- * Increase contrast by a factor. A value of 1.0 equals no change, a value of
12451
- * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
12452
- * ignored.
12453
- */
12454
- contrast?: number;
12455
- /**
12456
- * Increase exposure by a factor. A value of 1.0 equals no change, a value of
12457
- * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
12458
- */
12459
- gamma?: number;
12460
- /**
12461
- * Increase contrast by a factor. A value of 1.0 equals no change, a value of
12462
- * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
12463
- * ignored.
12464
- */
12465
- saturation?: number;
12466
- /**
12467
- * Flips the images horizontally, vertically, or both. Flipping is applied before
12468
- * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
12469
- * horizontally, then rotated by 90 degrees.
12470
- */
12471
- flip?: "h" | "v" | "hv";
12472
12500
  /**
12473
12501
  * Slightly reduces latency on a cache miss by selecting a
12474
12502
  * quickest-to-compress file format, at a cost of increased file size and
@@ -14367,6 +14395,10 @@ export declare namespace CloudflareWorkersModule {
14367
14395
  timeout?: WorkflowTimeoutDuration | number;
14368
14396
  sensitive?: WorkflowStepSensitivity;
14369
14397
  };
14398
+ export type WorkflowStepRollbackConfig = Pick<
14399
+ WorkflowStepConfig,
14400
+ "retries" | "timeout"
14401
+ >;
14370
14402
  export type WorkflowCronSchedule = {
14371
14403
  /** Cron expression that triggered this event. */
14372
14404
  cron: string;
@@ -14395,16 +14427,18 @@ export declare namespace CloudflareWorkersModule {
14395
14427
  config: WorkflowStepConfig;
14396
14428
  };
14397
14429
  export type WorkflowRollbackContext<T = unknown> = {
14430
+ ctx: WorkflowStepContext;
14398
14431
  error: Error;
14399
14432
  output: T | undefined;
14433
+ /** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
14400
14434
  stepName: string;
14401
14435
  };
14402
14436
  export type WorkflowRollbackHandler<T = unknown> = (
14403
14437
  ctx: WorkflowRollbackContext<T>,
14404
14438
  ) => Promise<void>;
14405
14439
  export type WorkflowStepRollbackOptions<T = unknown> = {
14406
- rollback?: WorkflowRollbackHandler<T>;
14407
- rollbackConfig?: WorkflowStepConfig;
14440
+ rollback: WorkflowRollbackHandler<T>;
14441
+ rollbackConfig?: WorkflowStepRollbackConfig;
14408
14442
  };
14409
14443
  export abstract class WorkflowStep {
14410
14444
  do<T extends Rpc.Serializable<T>>(
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260615.1"
10
+ "version": "4.20260617.1"
11
11
  }