@cloudflare/workers-types 4.20250321.0 → 4.20250401.0
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 +98 -49
- package/2021-11-03/index.ts +98 -49
- package/2022-01-31/index.d.ts +98 -49
- package/2022-01-31/index.ts +98 -49
- package/2022-03-21/index.d.ts +98 -49
- package/2022-03-21/index.ts +98 -49
- package/2022-08-04/index.d.ts +98 -49
- package/2022-08-04/index.ts +98 -49
- package/2022-10-31/index.d.ts +98 -49
- package/2022-10-31/index.ts +98 -49
- package/2022-11-30/index.d.ts +98 -49
- package/2022-11-30/index.ts +98 -49
- package/2023-03-01/index.d.ts +98 -49
- package/2023-03-01/index.ts +98 -49
- package/2023-07-01/index.d.ts +98 -49
- package/2023-07-01/index.ts +98 -49
- package/experimental/index.d.ts +98 -49
- package/experimental/index.ts +98 -49
- package/index.d.ts +98 -49
- package/index.ts +98 -49
- package/oldest/index.d.ts +98 -49
- package/oldest/index.ts +98 -49
- package/package.json +1 -1
package/2021-11-03/index.d.ts
CHANGED
|
@@ -4518,8 +4518,10 @@ interface BasicImageTransformations {
|
|
|
4518
4518
|
* (white by default). Use of this mode is not recommended, as the same
|
|
4519
4519
|
* effect can be more efficiently achieved with the contain mode and the
|
|
4520
4520
|
* CSS object-fit: contain property.
|
|
4521
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
4522
|
+
* breaks aspect ratio
|
|
4521
4523
|
*/
|
|
4522
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
|
|
4524
|
+
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
4523
4525
|
/**
|
|
4524
4526
|
* When cropping with fit: "cover", this defines the side or point that should
|
|
4525
4527
|
* be left uncropped. The value is either a string
|
|
@@ -4539,6 +4541,7 @@ interface BasicImageTransformations {
|
|
|
4539
4541
|
| "bottom"
|
|
4540
4542
|
| "center"
|
|
4541
4543
|
| "auto"
|
|
4544
|
+
| "entropy"
|
|
4542
4545
|
| BasicImageTransformationsGravityCoordinates;
|
|
4543
4546
|
/**
|
|
4544
4547
|
* Background color to add underneath the image. Applies only to images with
|
|
@@ -4553,8 +4556,9 @@ interface BasicImageTransformations {
|
|
|
4553
4556
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
4554
4557
|
}
|
|
4555
4558
|
interface BasicImageTransformationsGravityCoordinates {
|
|
4556
|
-
x
|
|
4557
|
-
y
|
|
4559
|
+
x?: number;
|
|
4560
|
+
y?: number;
|
|
4561
|
+
mode?: "remainder" | "box-center";
|
|
4558
4562
|
}
|
|
4559
4563
|
/**
|
|
4560
4564
|
* In addition to the properties you can set in the RequestInit dict
|
|
@@ -4660,23 +4664,43 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4660
4664
|
*/
|
|
4661
4665
|
dpr?: number;
|
|
4662
4666
|
/**
|
|
4663
|
-
*
|
|
4664
|
-
*
|
|
4665
|
-
*
|
|
4666
|
-
*
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4667
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
4668
|
+
* resizing or rotation.
|
|
4669
|
+
*
|
|
4670
|
+
* It can be used as:
|
|
4671
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
4672
|
+
* off each side
|
|
4673
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
4674
|
+
* in combination with the properties above
|
|
4675
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
4676
|
+
* it's color. It consists of three properties:
|
|
4677
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
4678
|
+
* - tolerance: difference from color to treat as color
|
|
4679
|
+
* - keep: the number of pixels of border to keep
|
|
4680
|
+
*/
|
|
4681
|
+
trim?:
|
|
4682
|
+
| "border"
|
|
4683
|
+
| {
|
|
4684
|
+
top?: number;
|
|
4685
|
+
bottom?: number;
|
|
4686
|
+
left?: number;
|
|
4687
|
+
right?: number;
|
|
4688
|
+
width?: number;
|
|
4689
|
+
height?: number;
|
|
4690
|
+
border?:
|
|
4691
|
+
| boolean
|
|
4692
|
+
| {
|
|
4693
|
+
color?: string;
|
|
4694
|
+
tolerance?: number;
|
|
4695
|
+
keep?: number;
|
|
4696
|
+
};
|
|
4697
|
+
};
|
|
4674
4698
|
/**
|
|
4675
4699
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
4676
4700
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
4677
4701
|
* to JPEG and WebP images. It doesn’t have any effect on PNG.
|
|
4678
4702
|
*/
|
|
4679
|
-
quality?: number;
|
|
4703
|
+
quality?: number | "low" | "medium-low" | "medium-high" | "high";
|
|
4680
4704
|
/**
|
|
4681
4705
|
* Output format to generate. It can be:
|
|
4682
4706
|
* - avif: generate images in AVIF format.
|
|
@@ -4688,7 +4712,15 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4688
4712
|
* - jpeg: generate images in JPEG format.
|
|
4689
4713
|
* - png: generate images in PNG format.
|
|
4690
4714
|
*/
|
|
4691
|
-
format?:
|
|
4715
|
+
format?:
|
|
4716
|
+
| "avif"
|
|
4717
|
+
| "webp"
|
|
4718
|
+
| "json"
|
|
4719
|
+
| "jpeg"
|
|
4720
|
+
| "png"
|
|
4721
|
+
| "baseline-jpeg"
|
|
4722
|
+
| "png-force"
|
|
4723
|
+
| "svg";
|
|
4692
4724
|
/**
|
|
4693
4725
|
* Whether to preserve animation frames from input files. Default is true.
|
|
4694
4726
|
* Setting it to false reduces animations to still images. This setting is
|
|
@@ -4768,6 +4800,18 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4768
4800
|
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
4769
4801
|
*/
|
|
4770
4802
|
gamma?: number;
|
|
4803
|
+
/**
|
|
4804
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
4805
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
4806
|
+
* ignored.
|
|
4807
|
+
*/
|
|
4808
|
+
saturation?: number;
|
|
4809
|
+
/**
|
|
4810
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
4811
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
4812
|
+
* horizontally, then rotated by 90 degrees.
|
|
4813
|
+
*/
|
|
4814
|
+
flip?: "h" | "v" | "hv";
|
|
4771
4815
|
/**
|
|
4772
4816
|
* Slightly reduces latency on a cache miss by selecting a
|
|
4773
4817
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -5681,7 +5725,26 @@ type ImageInfoResponse =
|
|
|
5681
5725
|
height: number;
|
|
5682
5726
|
};
|
|
5683
5727
|
type ImageTransform = {
|
|
5728
|
+
width?: number;
|
|
5729
|
+
height?: number;
|
|
5730
|
+
background?: string;
|
|
5731
|
+
blur?: number;
|
|
5732
|
+
border?:
|
|
5733
|
+
| {
|
|
5734
|
+
color?: string;
|
|
5735
|
+
width?: number;
|
|
5736
|
+
}
|
|
5737
|
+
| {
|
|
5738
|
+
top?: number;
|
|
5739
|
+
bottom?: number;
|
|
5740
|
+
left?: number;
|
|
5741
|
+
right?: number;
|
|
5742
|
+
};
|
|
5743
|
+
brightness?: number;
|
|
5744
|
+
contrast?: number;
|
|
5684
5745
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5746
|
+
flip?: "h" | "v" | "hv";
|
|
5747
|
+
gamma?: number;
|
|
5685
5748
|
gravity?:
|
|
5686
5749
|
| "left"
|
|
5687
5750
|
| "right"
|
|
@@ -5690,45 +5753,31 @@ type ImageTransform = {
|
|
|
5690
5753
|
| "center"
|
|
5691
5754
|
| "auto"
|
|
5692
5755
|
| "entropy"
|
|
5693
|
-
| "face"
|
|
5694
5756
|
| {
|
|
5695
5757
|
x?: number;
|
|
5696
5758
|
y?: number;
|
|
5697
5759
|
mode: "remainder" | "box-center";
|
|
5698
5760
|
};
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
bottom?: number;
|
|
5702
|
-
left?: number;
|
|
5703
|
-
right?: number;
|
|
5704
|
-
width?: number;
|
|
5705
|
-
height?: number;
|
|
5706
|
-
border?:
|
|
5707
|
-
| boolean
|
|
5708
|
-
| {
|
|
5709
|
-
color?: string;
|
|
5710
|
-
tolerance?: number;
|
|
5711
|
-
keep?: number;
|
|
5712
|
-
};
|
|
5713
|
-
};
|
|
5714
|
-
width?: number;
|
|
5715
|
-
height?: number;
|
|
5716
|
-
background?: string;
|
|
5717
|
-
rotate?: number;
|
|
5761
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
5762
|
+
saturation?: number;
|
|
5718
5763
|
sharpen?: number;
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5764
|
+
trim?:
|
|
5765
|
+
| "border"
|
|
5766
|
+
| {
|
|
5767
|
+
top?: number;
|
|
5768
|
+
bottom?: number;
|
|
5769
|
+
left?: number;
|
|
5770
|
+
right?: number;
|
|
5771
|
+
width?: number;
|
|
5772
|
+
height?: number;
|
|
5773
|
+
border?:
|
|
5774
|
+
| boolean
|
|
5775
|
+
| {
|
|
5776
|
+
color?: string;
|
|
5777
|
+
tolerance?: number;
|
|
5778
|
+
keep?: number;
|
|
5779
|
+
};
|
|
5780
|
+
};
|
|
5732
5781
|
};
|
|
5733
5782
|
type ImageDrawOptions = {
|
|
5734
5783
|
opacity?: number;
|
package/2021-11-03/index.ts
CHANGED
|
@@ -4532,8 +4532,10 @@ export interface BasicImageTransformations {
|
|
|
4532
4532
|
* (white by default). Use of this mode is not recommended, as the same
|
|
4533
4533
|
* effect can be more efficiently achieved with the contain mode and the
|
|
4534
4534
|
* CSS object-fit: contain property.
|
|
4535
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
4536
|
+
* breaks aspect ratio
|
|
4535
4537
|
*/
|
|
4536
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
|
|
4538
|
+
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
4537
4539
|
/**
|
|
4538
4540
|
* When cropping with fit: "cover", this defines the side or point that should
|
|
4539
4541
|
* be left uncropped. The value is either a string
|
|
@@ -4553,6 +4555,7 @@ export interface BasicImageTransformations {
|
|
|
4553
4555
|
| "bottom"
|
|
4554
4556
|
| "center"
|
|
4555
4557
|
| "auto"
|
|
4558
|
+
| "entropy"
|
|
4556
4559
|
| BasicImageTransformationsGravityCoordinates;
|
|
4557
4560
|
/**
|
|
4558
4561
|
* Background color to add underneath the image. Applies only to images with
|
|
@@ -4567,8 +4570,9 @@ export interface BasicImageTransformations {
|
|
|
4567
4570
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
4568
4571
|
}
|
|
4569
4572
|
export interface BasicImageTransformationsGravityCoordinates {
|
|
4570
|
-
x
|
|
4571
|
-
y
|
|
4573
|
+
x?: number;
|
|
4574
|
+
y?: number;
|
|
4575
|
+
mode?: "remainder" | "box-center";
|
|
4572
4576
|
}
|
|
4573
4577
|
/**
|
|
4574
4578
|
* In addition to the properties you can set in the RequestInit dict
|
|
@@ -4676,23 +4680,43 @@ export interface RequestInitCfPropertiesImage
|
|
|
4676
4680
|
*/
|
|
4677
4681
|
dpr?: number;
|
|
4678
4682
|
/**
|
|
4679
|
-
*
|
|
4680
|
-
*
|
|
4681
|
-
*
|
|
4682
|
-
*
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4683
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
4684
|
+
* resizing or rotation.
|
|
4685
|
+
*
|
|
4686
|
+
* It can be used as:
|
|
4687
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
4688
|
+
* off each side
|
|
4689
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
4690
|
+
* in combination with the properties above
|
|
4691
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
4692
|
+
* it's color. It consists of three properties:
|
|
4693
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
4694
|
+
* - tolerance: difference from color to treat as color
|
|
4695
|
+
* - keep: the number of pixels of border to keep
|
|
4696
|
+
*/
|
|
4697
|
+
trim?:
|
|
4698
|
+
| "border"
|
|
4699
|
+
| {
|
|
4700
|
+
top?: number;
|
|
4701
|
+
bottom?: number;
|
|
4702
|
+
left?: number;
|
|
4703
|
+
right?: number;
|
|
4704
|
+
width?: number;
|
|
4705
|
+
height?: number;
|
|
4706
|
+
border?:
|
|
4707
|
+
| boolean
|
|
4708
|
+
| {
|
|
4709
|
+
color?: string;
|
|
4710
|
+
tolerance?: number;
|
|
4711
|
+
keep?: number;
|
|
4712
|
+
};
|
|
4713
|
+
};
|
|
4690
4714
|
/**
|
|
4691
4715
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
4692
4716
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
4693
4717
|
* to JPEG and WebP images. It doesn’t have any effect on PNG.
|
|
4694
4718
|
*/
|
|
4695
|
-
quality?: number;
|
|
4719
|
+
quality?: number | "low" | "medium-low" | "medium-high" | "high";
|
|
4696
4720
|
/**
|
|
4697
4721
|
* Output format to generate. It can be:
|
|
4698
4722
|
* - avif: generate images in AVIF format.
|
|
@@ -4704,7 +4728,15 @@ export interface RequestInitCfPropertiesImage
|
|
|
4704
4728
|
* - jpeg: generate images in JPEG format.
|
|
4705
4729
|
* - png: generate images in PNG format.
|
|
4706
4730
|
*/
|
|
4707
|
-
format?:
|
|
4731
|
+
format?:
|
|
4732
|
+
| "avif"
|
|
4733
|
+
| "webp"
|
|
4734
|
+
| "json"
|
|
4735
|
+
| "jpeg"
|
|
4736
|
+
| "png"
|
|
4737
|
+
| "baseline-jpeg"
|
|
4738
|
+
| "png-force"
|
|
4739
|
+
| "svg";
|
|
4708
4740
|
/**
|
|
4709
4741
|
* Whether to preserve animation frames from input files. Default is true.
|
|
4710
4742
|
* Setting it to false reduces animations to still images. This setting is
|
|
@@ -4784,6 +4816,18 @@ export interface RequestInitCfPropertiesImage
|
|
|
4784
4816
|
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
4785
4817
|
*/
|
|
4786
4818
|
gamma?: number;
|
|
4819
|
+
/**
|
|
4820
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
4821
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
4822
|
+
* ignored.
|
|
4823
|
+
*/
|
|
4824
|
+
saturation?: number;
|
|
4825
|
+
/**
|
|
4826
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
4827
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
4828
|
+
* horizontally, then rotated by 90 degrees.
|
|
4829
|
+
*/
|
|
4830
|
+
flip?: "h" | "v" | "hv";
|
|
4787
4831
|
/**
|
|
4788
4832
|
* Slightly reduces latency on a cache miss by selecting a
|
|
4789
4833
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -5700,7 +5744,26 @@ export type ImageInfoResponse =
|
|
|
5700
5744
|
height: number;
|
|
5701
5745
|
};
|
|
5702
5746
|
export type ImageTransform = {
|
|
5747
|
+
width?: number;
|
|
5748
|
+
height?: number;
|
|
5749
|
+
background?: string;
|
|
5750
|
+
blur?: number;
|
|
5751
|
+
border?:
|
|
5752
|
+
| {
|
|
5753
|
+
color?: string;
|
|
5754
|
+
width?: number;
|
|
5755
|
+
}
|
|
5756
|
+
| {
|
|
5757
|
+
top?: number;
|
|
5758
|
+
bottom?: number;
|
|
5759
|
+
left?: number;
|
|
5760
|
+
right?: number;
|
|
5761
|
+
};
|
|
5762
|
+
brightness?: number;
|
|
5763
|
+
contrast?: number;
|
|
5703
5764
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5765
|
+
flip?: "h" | "v" | "hv";
|
|
5766
|
+
gamma?: number;
|
|
5704
5767
|
gravity?:
|
|
5705
5768
|
| "left"
|
|
5706
5769
|
| "right"
|
|
@@ -5709,45 +5772,31 @@ export type ImageTransform = {
|
|
|
5709
5772
|
| "center"
|
|
5710
5773
|
| "auto"
|
|
5711
5774
|
| "entropy"
|
|
5712
|
-
| "face"
|
|
5713
5775
|
| {
|
|
5714
5776
|
x?: number;
|
|
5715
5777
|
y?: number;
|
|
5716
5778
|
mode: "remainder" | "box-center";
|
|
5717
5779
|
};
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
bottom?: number;
|
|
5721
|
-
left?: number;
|
|
5722
|
-
right?: number;
|
|
5723
|
-
width?: number;
|
|
5724
|
-
height?: number;
|
|
5725
|
-
border?:
|
|
5726
|
-
| boolean
|
|
5727
|
-
| {
|
|
5728
|
-
color?: string;
|
|
5729
|
-
tolerance?: number;
|
|
5730
|
-
keep?: number;
|
|
5731
|
-
};
|
|
5732
|
-
};
|
|
5733
|
-
width?: number;
|
|
5734
|
-
height?: number;
|
|
5735
|
-
background?: string;
|
|
5736
|
-
rotate?: number;
|
|
5780
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
5781
|
+
saturation?: number;
|
|
5737
5782
|
sharpen?: number;
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5783
|
+
trim?:
|
|
5784
|
+
| "border"
|
|
5785
|
+
| {
|
|
5786
|
+
top?: number;
|
|
5787
|
+
bottom?: number;
|
|
5788
|
+
left?: number;
|
|
5789
|
+
right?: number;
|
|
5790
|
+
width?: number;
|
|
5791
|
+
height?: number;
|
|
5792
|
+
border?:
|
|
5793
|
+
| boolean
|
|
5794
|
+
| {
|
|
5795
|
+
color?: string;
|
|
5796
|
+
tolerance?: number;
|
|
5797
|
+
keep?: number;
|
|
5798
|
+
};
|
|
5799
|
+
};
|
|
5751
5800
|
};
|
|
5752
5801
|
export type ImageDrawOptions = {
|
|
5753
5802
|
opacity?: number;
|
package/2022-01-31/index.d.ts
CHANGED
|
@@ -4544,8 +4544,10 @@ interface BasicImageTransformations {
|
|
|
4544
4544
|
* (white by default). Use of this mode is not recommended, as the same
|
|
4545
4545
|
* effect can be more efficiently achieved with the contain mode and the
|
|
4546
4546
|
* CSS object-fit: contain property.
|
|
4547
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
4548
|
+
* breaks aspect ratio
|
|
4547
4549
|
*/
|
|
4548
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
|
|
4550
|
+
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
4549
4551
|
/**
|
|
4550
4552
|
* When cropping with fit: "cover", this defines the side or point that should
|
|
4551
4553
|
* be left uncropped. The value is either a string
|
|
@@ -4565,6 +4567,7 @@ interface BasicImageTransformations {
|
|
|
4565
4567
|
| "bottom"
|
|
4566
4568
|
| "center"
|
|
4567
4569
|
| "auto"
|
|
4570
|
+
| "entropy"
|
|
4568
4571
|
| BasicImageTransformationsGravityCoordinates;
|
|
4569
4572
|
/**
|
|
4570
4573
|
* Background color to add underneath the image. Applies only to images with
|
|
@@ -4579,8 +4582,9 @@ interface BasicImageTransformations {
|
|
|
4579
4582
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
4580
4583
|
}
|
|
4581
4584
|
interface BasicImageTransformationsGravityCoordinates {
|
|
4582
|
-
x
|
|
4583
|
-
y
|
|
4585
|
+
x?: number;
|
|
4586
|
+
y?: number;
|
|
4587
|
+
mode?: "remainder" | "box-center";
|
|
4584
4588
|
}
|
|
4585
4589
|
/**
|
|
4586
4590
|
* In addition to the properties you can set in the RequestInit dict
|
|
@@ -4686,23 +4690,43 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4686
4690
|
*/
|
|
4687
4691
|
dpr?: number;
|
|
4688
4692
|
/**
|
|
4689
|
-
*
|
|
4690
|
-
*
|
|
4691
|
-
*
|
|
4692
|
-
*
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4693
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
4694
|
+
* resizing or rotation.
|
|
4695
|
+
*
|
|
4696
|
+
* It can be used as:
|
|
4697
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
4698
|
+
* off each side
|
|
4699
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
4700
|
+
* in combination with the properties above
|
|
4701
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
4702
|
+
* it's color. It consists of three properties:
|
|
4703
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
4704
|
+
* - tolerance: difference from color to treat as color
|
|
4705
|
+
* - keep: the number of pixels of border to keep
|
|
4706
|
+
*/
|
|
4707
|
+
trim?:
|
|
4708
|
+
| "border"
|
|
4709
|
+
| {
|
|
4710
|
+
top?: number;
|
|
4711
|
+
bottom?: number;
|
|
4712
|
+
left?: number;
|
|
4713
|
+
right?: number;
|
|
4714
|
+
width?: number;
|
|
4715
|
+
height?: number;
|
|
4716
|
+
border?:
|
|
4717
|
+
| boolean
|
|
4718
|
+
| {
|
|
4719
|
+
color?: string;
|
|
4720
|
+
tolerance?: number;
|
|
4721
|
+
keep?: number;
|
|
4722
|
+
};
|
|
4723
|
+
};
|
|
4700
4724
|
/**
|
|
4701
4725
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
4702
4726
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
4703
4727
|
* to JPEG and WebP images. It doesn’t have any effect on PNG.
|
|
4704
4728
|
*/
|
|
4705
|
-
quality?: number;
|
|
4729
|
+
quality?: number | "low" | "medium-low" | "medium-high" | "high";
|
|
4706
4730
|
/**
|
|
4707
4731
|
* Output format to generate. It can be:
|
|
4708
4732
|
* - avif: generate images in AVIF format.
|
|
@@ -4714,7 +4738,15 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4714
4738
|
* - jpeg: generate images in JPEG format.
|
|
4715
4739
|
* - png: generate images in PNG format.
|
|
4716
4740
|
*/
|
|
4717
|
-
format?:
|
|
4741
|
+
format?:
|
|
4742
|
+
| "avif"
|
|
4743
|
+
| "webp"
|
|
4744
|
+
| "json"
|
|
4745
|
+
| "jpeg"
|
|
4746
|
+
| "png"
|
|
4747
|
+
| "baseline-jpeg"
|
|
4748
|
+
| "png-force"
|
|
4749
|
+
| "svg";
|
|
4718
4750
|
/**
|
|
4719
4751
|
* Whether to preserve animation frames from input files. Default is true.
|
|
4720
4752
|
* Setting it to false reduces animations to still images. This setting is
|
|
@@ -4794,6 +4826,18 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4794
4826
|
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
4795
4827
|
*/
|
|
4796
4828
|
gamma?: number;
|
|
4829
|
+
/**
|
|
4830
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
4831
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
4832
|
+
* ignored.
|
|
4833
|
+
*/
|
|
4834
|
+
saturation?: number;
|
|
4835
|
+
/**
|
|
4836
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
4837
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
4838
|
+
* horizontally, then rotated by 90 degrees.
|
|
4839
|
+
*/
|
|
4840
|
+
flip?: "h" | "v" | "hv";
|
|
4797
4841
|
/**
|
|
4798
4842
|
* Slightly reduces latency on a cache miss by selecting a
|
|
4799
4843
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -5707,7 +5751,26 @@ type ImageInfoResponse =
|
|
|
5707
5751
|
height: number;
|
|
5708
5752
|
};
|
|
5709
5753
|
type ImageTransform = {
|
|
5754
|
+
width?: number;
|
|
5755
|
+
height?: number;
|
|
5756
|
+
background?: string;
|
|
5757
|
+
blur?: number;
|
|
5758
|
+
border?:
|
|
5759
|
+
| {
|
|
5760
|
+
color?: string;
|
|
5761
|
+
width?: number;
|
|
5762
|
+
}
|
|
5763
|
+
| {
|
|
5764
|
+
top?: number;
|
|
5765
|
+
bottom?: number;
|
|
5766
|
+
left?: number;
|
|
5767
|
+
right?: number;
|
|
5768
|
+
};
|
|
5769
|
+
brightness?: number;
|
|
5770
|
+
contrast?: number;
|
|
5710
5771
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5772
|
+
flip?: "h" | "v" | "hv";
|
|
5773
|
+
gamma?: number;
|
|
5711
5774
|
gravity?:
|
|
5712
5775
|
| "left"
|
|
5713
5776
|
| "right"
|
|
@@ -5716,45 +5779,31 @@ type ImageTransform = {
|
|
|
5716
5779
|
| "center"
|
|
5717
5780
|
| "auto"
|
|
5718
5781
|
| "entropy"
|
|
5719
|
-
| "face"
|
|
5720
5782
|
| {
|
|
5721
5783
|
x?: number;
|
|
5722
5784
|
y?: number;
|
|
5723
5785
|
mode: "remainder" | "box-center";
|
|
5724
5786
|
};
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
bottom?: number;
|
|
5728
|
-
left?: number;
|
|
5729
|
-
right?: number;
|
|
5730
|
-
width?: number;
|
|
5731
|
-
height?: number;
|
|
5732
|
-
border?:
|
|
5733
|
-
| boolean
|
|
5734
|
-
| {
|
|
5735
|
-
color?: string;
|
|
5736
|
-
tolerance?: number;
|
|
5737
|
-
keep?: number;
|
|
5738
|
-
};
|
|
5739
|
-
};
|
|
5740
|
-
width?: number;
|
|
5741
|
-
height?: number;
|
|
5742
|
-
background?: string;
|
|
5743
|
-
rotate?: number;
|
|
5787
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
5788
|
+
saturation?: number;
|
|
5744
5789
|
sharpen?: number;
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5790
|
+
trim?:
|
|
5791
|
+
| "border"
|
|
5792
|
+
| {
|
|
5793
|
+
top?: number;
|
|
5794
|
+
bottom?: number;
|
|
5795
|
+
left?: number;
|
|
5796
|
+
right?: number;
|
|
5797
|
+
width?: number;
|
|
5798
|
+
height?: number;
|
|
5799
|
+
border?:
|
|
5800
|
+
| boolean
|
|
5801
|
+
| {
|
|
5802
|
+
color?: string;
|
|
5803
|
+
tolerance?: number;
|
|
5804
|
+
keep?: number;
|
|
5805
|
+
};
|
|
5806
|
+
};
|
|
5758
5807
|
};
|
|
5759
5808
|
type ImageDrawOptions = {
|
|
5760
5809
|
opacity?: number;
|