@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/2023-03-01/index.d.ts
CHANGED
|
@@ -4581,8 +4581,10 @@ interface BasicImageTransformations {
|
|
|
4581
4581
|
* (white by default). Use of this mode is not recommended, as the same
|
|
4582
4582
|
* effect can be more efficiently achieved with the contain mode and the
|
|
4583
4583
|
* CSS object-fit: contain property.
|
|
4584
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
4585
|
+
* breaks aspect ratio
|
|
4584
4586
|
*/
|
|
4585
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
|
|
4587
|
+
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
4586
4588
|
/**
|
|
4587
4589
|
* When cropping with fit: "cover", this defines the side or point that should
|
|
4588
4590
|
* be left uncropped. The value is either a string
|
|
@@ -4602,6 +4604,7 @@ interface BasicImageTransformations {
|
|
|
4602
4604
|
| "bottom"
|
|
4603
4605
|
| "center"
|
|
4604
4606
|
| "auto"
|
|
4607
|
+
| "entropy"
|
|
4605
4608
|
| BasicImageTransformationsGravityCoordinates;
|
|
4606
4609
|
/**
|
|
4607
4610
|
* Background color to add underneath the image. Applies only to images with
|
|
@@ -4616,8 +4619,9 @@ interface BasicImageTransformations {
|
|
|
4616
4619
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
4617
4620
|
}
|
|
4618
4621
|
interface BasicImageTransformationsGravityCoordinates {
|
|
4619
|
-
x
|
|
4620
|
-
y
|
|
4622
|
+
x?: number;
|
|
4623
|
+
y?: number;
|
|
4624
|
+
mode?: "remainder" | "box-center";
|
|
4621
4625
|
}
|
|
4622
4626
|
/**
|
|
4623
4627
|
* In addition to the properties you can set in the RequestInit dict
|
|
@@ -4723,23 +4727,43 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4723
4727
|
*/
|
|
4724
4728
|
dpr?: number;
|
|
4725
4729
|
/**
|
|
4726
|
-
*
|
|
4727
|
-
*
|
|
4728
|
-
*
|
|
4729
|
-
*
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4730
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
4731
|
+
* resizing or rotation.
|
|
4732
|
+
*
|
|
4733
|
+
* It can be used as:
|
|
4734
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
4735
|
+
* off each side
|
|
4736
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
4737
|
+
* in combination with the properties above
|
|
4738
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
4739
|
+
* it's color. It consists of three properties:
|
|
4740
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
4741
|
+
* - tolerance: difference from color to treat as color
|
|
4742
|
+
* - keep: the number of pixels of border to keep
|
|
4743
|
+
*/
|
|
4744
|
+
trim?:
|
|
4745
|
+
| "border"
|
|
4746
|
+
| {
|
|
4747
|
+
top?: number;
|
|
4748
|
+
bottom?: number;
|
|
4749
|
+
left?: number;
|
|
4750
|
+
right?: number;
|
|
4751
|
+
width?: number;
|
|
4752
|
+
height?: number;
|
|
4753
|
+
border?:
|
|
4754
|
+
| boolean
|
|
4755
|
+
| {
|
|
4756
|
+
color?: string;
|
|
4757
|
+
tolerance?: number;
|
|
4758
|
+
keep?: number;
|
|
4759
|
+
};
|
|
4760
|
+
};
|
|
4737
4761
|
/**
|
|
4738
4762
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
4739
4763
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
4740
4764
|
* to JPEG and WebP images. It doesn’t have any effect on PNG.
|
|
4741
4765
|
*/
|
|
4742
|
-
quality?: number;
|
|
4766
|
+
quality?: number | "low" | "medium-low" | "medium-high" | "high";
|
|
4743
4767
|
/**
|
|
4744
4768
|
* Output format to generate. It can be:
|
|
4745
4769
|
* - avif: generate images in AVIF format.
|
|
@@ -4751,7 +4775,15 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4751
4775
|
* - jpeg: generate images in JPEG format.
|
|
4752
4776
|
* - png: generate images in PNG format.
|
|
4753
4777
|
*/
|
|
4754
|
-
format?:
|
|
4778
|
+
format?:
|
|
4779
|
+
| "avif"
|
|
4780
|
+
| "webp"
|
|
4781
|
+
| "json"
|
|
4782
|
+
| "jpeg"
|
|
4783
|
+
| "png"
|
|
4784
|
+
| "baseline-jpeg"
|
|
4785
|
+
| "png-force"
|
|
4786
|
+
| "svg";
|
|
4755
4787
|
/**
|
|
4756
4788
|
* Whether to preserve animation frames from input files. Default is true.
|
|
4757
4789
|
* Setting it to false reduces animations to still images. This setting is
|
|
@@ -4831,6 +4863,18 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4831
4863
|
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
4832
4864
|
*/
|
|
4833
4865
|
gamma?: number;
|
|
4866
|
+
/**
|
|
4867
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
4868
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
4869
|
+
* ignored.
|
|
4870
|
+
*/
|
|
4871
|
+
saturation?: number;
|
|
4872
|
+
/**
|
|
4873
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
4874
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
4875
|
+
* horizontally, then rotated by 90 degrees.
|
|
4876
|
+
*/
|
|
4877
|
+
flip?: "h" | "v" | "hv";
|
|
4834
4878
|
/**
|
|
4835
4879
|
* Slightly reduces latency on a cache miss by selecting a
|
|
4836
4880
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -5744,7 +5788,26 @@ type ImageInfoResponse =
|
|
|
5744
5788
|
height: number;
|
|
5745
5789
|
};
|
|
5746
5790
|
type ImageTransform = {
|
|
5791
|
+
width?: number;
|
|
5792
|
+
height?: number;
|
|
5793
|
+
background?: string;
|
|
5794
|
+
blur?: number;
|
|
5795
|
+
border?:
|
|
5796
|
+
| {
|
|
5797
|
+
color?: string;
|
|
5798
|
+
width?: number;
|
|
5799
|
+
}
|
|
5800
|
+
| {
|
|
5801
|
+
top?: number;
|
|
5802
|
+
bottom?: number;
|
|
5803
|
+
left?: number;
|
|
5804
|
+
right?: number;
|
|
5805
|
+
};
|
|
5806
|
+
brightness?: number;
|
|
5807
|
+
contrast?: number;
|
|
5747
5808
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5809
|
+
flip?: "h" | "v" | "hv";
|
|
5810
|
+
gamma?: number;
|
|
5748
5811
|
gravity?:
|
|
5749
5812
|
| "left"
|
|
5750
5813
|
| "right"
|
|
@@ -5753,45 +5816,31 @@ type ImageTransform = {
|
|
|
5753
5816
|
| "center"
|
|
5754
5817
|
| "auto"
|
|
5755
5818
|
| "entropy"
|
|
5756
|
-
| "face"
|
|
5757
5819
|
| {
|
|
5758
5820
|
x?: number;
|
|
5759
5821
|
y?: number;
|
|
5760
5822
|
mode: "remainder" | "box-center";
|
|
5761
5823
|
};
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
bottom?: number;
|
|
5765
|
-
left?: number;
|
|
5766
|
-
right?: number;
|
|
5767
|
-
width?: number;
|
|
5768
|
-
height?: number;
|
|
5769
|
-
border?:
|
|
5770
|
-
| boolean
|
|
5771
|
-
| {
|
|
5772
|
-
color?: string;
|
|
5773
|
-
tolerance?: number;
|
|
5774
|
-
keep?: number;
|
|
5775
|
-
};
|
|
5776
|
-
};
|
|
5777
|
-
width?: number;
|
|
5778
|
-
height?: number;
|
|
5779
|
-
background?: string;
|
|
5780
|
-
rotate?: number;
|
|
5824
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
5825
|
+
saturation?: number;
|
|
5781
5826
|
sharpen?: number;
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5827
|
+
trim?:
|
|
5828
|
+
| "border"
|
|
5829
|
+
| {
|
|
5830
|
+
top?: number;
|
|
5831
|
+
bottom?: number;
|
|
5832
|
+
left?: number;
|
|
5833
|
+
right?: number;
|
|
5834
|
+
width?: number;
|
|
5835
|
+
height?: number;
|
|
5836
|
+
border?:
|
|
5837
|
+
| boolean
|
|
5838
|
+
| {
|
|
5839
|
+
color?: string;
|
|
5840
|
+
tolerance?: number;
|
|
5841
|
+
keep?: number;
|
|
5842
|
+
};
|
|
5843
|
+
};
|
|
5795
5844
|
};
|
|
5796
5845
|
type ImageDrawOptions = {
|
|
5797
5846
|
opacity?: number;
|
package/2023-03-01/index.ts
CHANGED
|
@@ -4595,8 +4595,10 @@ export interface BasicImageTransformations {
|
|
|
4595
4595
|
* (white by default). Use of this mode is not recommended, as the same
|
|
4596
4596
|
* effect can be more efficiently achieved with the contain mode and the
|
|
4597
4597
|
* CSS object-fit: contain property.
|
|
4598
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
4599
|
+
* breaks aspect ratio
|
|
4598
4600
|
*/
|
|
4599
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
|
|
4601
|
+
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
4600
4602
|
/**
|
|
4601
4603
|
* When cropping with fit: "cover", this defines the side or point that should
|
|
4602
4604
|
* be left uncropped. The value is either a string
|
|
@@ -4616,6 +4618,7 @@ export interface BasicImageTransformations {
|
|
|
4616
4618
|
| "bottom"
|
|
4617
4619
|
| "center"
|
|
4618
4620
|
| "auto"
|
|
4621
|
+
| "entropy"
|
|
4619
4622
|
| BasicImageTransformationsGravityCoordinates;
|
|
4620
4623
|
/**
|
|
4621
4624
|
* Background color to add underneath the image. Applies only to images with
|
|
@@ -4630,8 +4633,9 @@ export interface BasicImageTransformations {
|
|
|
4630
4633
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
4631
4634
|
}
|
|
4632
4635
|
export interface BasicImageTransformationsGravityCoordinates {
|
|
4633
|
-
x
|
|
4634
|
-
y
|
|
4636
|
+
x?: number;
|
|
4637
|
+
y?: number;
|
|
4638
|
+
mode?: "remainder" | "box-center";
|
|
4635
4639
|
}
|
|
4636
4640
|
/**
|
|
4637
4641
|
* In addition to the properties you can set in the RequestInit dict
|
|
@@ -4739,23 +4743,43 @@ export interface RequestInitCfPropertiesImage
|
|
|
4739
4743
|
*/
|
|
4740
4744
|
dpr?: number;
|
|
4741
4745
|
/**
|
|
4742
|
-
*
|
|
4743
|
-
*
|
|
4744
|
-
*
|
|
4745
|
-
*
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4746
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
4747
|
+
* resizing or rotation.
|
|
4748
|
+
*
|
|
4749
|
+
* It can be used as:
|
|
4750
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
4751
|
+
* off each side
|
|
4752
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
4753
|
+
* in combination with the properties above
|
|
4754
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
4755
|
+
* it's color. It consists of three properties:
|
|
4756
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
4757
|
+
* - tolerance: difference from color to treat as color
|
|
4758
|
+
* - keep: the number of pixels of border to keep
|
|
4759
|
+
*/
|
|
4760
|
+
trim?:
|
|
4761
|
+
| "border"
|
|
4762
|
+
| {
|
|
4763
|
+
top?: number;
|
|
4764
|
+
bottom?: number;
|
|
4765
|
+
left?: number;
|
|
4766
|
+
right?: number;
|
|
4767
|
+
width?: number;
|
|
4768
|
+
height?: number;
|
|
4769
|
+
border?:
|
|
4770
|
+
| boolean
|
|
4771
|
+
| {
|
|
4772
|
+
color?: string;
|
|
4773
|
+
tolerance?: number;
|
|
4774
|
+
keep?: number;
|
|
4775
|
+
};
|
|
4776
|
+
};
|
|
4753
4777
|
/**
|
|
4754
4778
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
4755
4779
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
4756
4780
|
* to JPEG and WebP images. It doesn’t have any effect on PNG.
|
|
4757
4781
|
*/
|
|
4758
|
-
quality?: number;
|
|
4782
|
+
quality?: number | "low" | "medium-low" | "medium-high" | "high";
|
|
4759
4783
|
/**
|
|
4760
4784
|
* Output format to generate. It can be:
|
|
4761
4785
|
* - avif: generate images in AVIF format.
|
|
@@ -4767,7 +4791,15 @@ export interface RequestInitCfPropertiesImage
|
|
|
4767
4791
|
* - jpeg: generate images in JPEG format.
|
|
4768
4792
|
* - png: generate images in PNG format.
|
|
4769
4793
|
*/
|
|
4770
|
-
format?:
|
|
4794
|
+
format?:
|
|
4795
|
+
| "avif"
|
|
4796
|
+
| "webp"
|
|
4797
|
+
| "json"
|
|
4798
|
+
| "jpeg"
|
|
4799
|
+
| "png"
|
|
4800
|
+
| "baseline-jpeg"
|
|
4801
|
+
| "png-force"
|
|
4802
|
+
| "svg";
|
|
4771
4803
|
/**
|
|
4772
4804
|
* Whether to preserve animation frames from input files. Default is true.
|
|
4773
4805
|
* Setting it to false reduces animations to still images. This setting is
|
|
@@ -4847,6 +4879,18 @@ export interface RequestInitCfPropertiesImage
|
|
|
4847
4879
|
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
4848
4880
|
*/
|
|
4849
4881
|
gamma?: number;
|
|
4882
|
+
/**
|
|
4883
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
4884
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
4885
|
+
* ignored.
|
|
4886
|
+
*/
|
|
4887
|
+
saturation?: number;
|
|
4888
|
+
/**
|
|
4889
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
4890
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
4891
|
+
* horizontally, then rotated by 90 degrees.
|
|
4892
|
+
*/
|
|
4893
|
+
flip?: "h" | "v" | "hv";
|
|
4850
4894
|
/**
|
|
4851
4895
|
* Slightly reduces latency on a cache miss by selecting a
|
|
4852
4896
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -5763,7 +5807,26 @@ export type ImageInfoResponse =
|
|
|
5763
5807
|
height: number;
|
|
5764
5808
|
};
|
|
5765
5809
|
export type ImageTransform = {
|
|
5810
|
+
width?: number;
|
|
5811
|
+
height?: number;
|
|
5812
|
+
background?: string;
|
|
5813
|
+
blur?: number;
|
|
5814
|
+
border?:
|
|
5815
|
+
| {
|
|
5816
|
+
color?: string;
|
|
5817
|
+
width?: number;
|
|
5818
|
+
}
|
|
5819
|
+
| {
|
|
5820
|
+
top?: number;
|
|
5821
|
+
bottom?: number;
|
|
5822
|
+
left?: number;
|
|
5823
|
+
right?: number;
|
|
5824
|
+
};
|
|
5825
|
+
brightness?: number;
|
|
5826
|
+
contrast?: number;
|
|
5766
5827
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5828
|
+
flip?: "h" | "v" | "hv";
|
|
5829
|
+
gamma?: number;
|
|
5767
5830
|
gravity?:
|
|
5768
5831
|
| "left"
|
|
5769
5832
|
| "right"
|
|
@@ -5772,45 +5835,31 @@ export type ImageTransform = {
|
|
|
5772
5835
|
| "center"
|
|
5773
5836
|
| "auto"
|
|
5774
5837
|
| "entropy"
|
|
5775
|
-
| "face"
|
|
5776
5838
|
| {
|
|
5777
5839
|
x?: number;
|
|
5778
5840
|
y?: number;
|
|
5779
5841
|
mode: "remainder" | "box-center";
|
|
5780
5842
|
};
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
bottom?: number;
|
|
5784
|
-
left?: number;
|
|
5785
|
-
right?: number;
|
|
5786
|
-
width?: number;
|
|
5787
|
-
height?: number;
|
|
5788
|
-
border?:
|
|
5789
|
-
| boolean
|
|
5790
|
-
| {
|
|
5791
|
-
color?: string;
|
|
5792
|
-
tolerance?: number;
|
|
5793
|
-
keep?: number;
|
|
5794
|
-
};
|
|
5795
|
-
};
|
|
5796
|
-
width?: number;
|
|
5797
|
-
height?: number;
|
|
5798
|
-
background?: string;
|
|
5799
|
-
rotate?: number;
|
|
5843
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
5844
|
+
saturation?: number;
|
|
5800
5845
|
sharpen?: number;
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5846
|
+
trim?:
|
|
5847
|
+
| "border"
|
|
5848
|
+
| {
|
|
5849
|
+
top?: number;
|
|
5850
|
+
bottom?: number;
|
|
5851
|
+
left?: number;
|
|
5852
|
+
right?: number;
|
|
5853
|
+
width?: number;
|
|
5854
|
+
height?: number;
|
|
5855
|
+
border?:
|
|
5856
|
+
| boolean
|
|
5857
|
+
| {
|
|
5858
|
+
color?: string;
|
|
5859
|
+
tolerance?: number;
|
|
5860
|
+
keep?: number;
|
|
5861
|
+
};
|
|
5862
|
+
};
|
|
5814
5863
|
};
|
|
5815
5864
|
export type ImageDrawOptions = {
|
|
5816
5865
|
opacity?: number;
|
package/2023-07-01/index.d.ts
CHANGED
|
@@ -4581,8 +4581,10 @@ interface BasicImageTransformations {
|
|
|
4581
4581
|
* (white by default). Use of this mode is not recommended, as the same
|
|
4582
4582
|
* effect can be more efficiently achieved with the contain mode and the
|
|
4583
4583
|
* CSS object-fit: contain property.
|
|
4584
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
4585
|
+
* breaks aspect ratio
|
|
4584
4586
|
*/
|
|
4585
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad";
|
|
4587
|
+
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
4586
4588
|
/**
|
|
4587
4589
|
* When cropping with fit: "cover", this defines the side or point that should
|
|
4588
4590
|
* be left uncropped. The value is either a string
|
|
@@ -4602,6 +4604,7 @@ interface BasicImageTransformations {
|
|
|
4602
4604
|
| "bottom"
|
|
4603
4605
|
| "center"
|
|
4604
4606
|
| "auto"
|
|
4607
|
+
| "entropy"
|
|
4605
4608
|
| BasicImageTransformationsGravityCoordinates;
|
|
4606
4609
|
/**
|
|
4607
4610
|
* Background color to add underneath the image. Applies only to images with
|
|
@@ -4616,8 +4619,9 @@ interface BasicImageTransformations {
|
|
|
4616
4619
|
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
4617
4620
|
}
|
|
4618
4621
|
interface BasicImageTransformationsGravityCoordinates {
|
|
4619
|
-
x
|
|
4620
|
-
y
|
|
4622
|
+
x?: number;
|
|
4623
|
+
y?: number;
|
|
4624
|
+
mode?: "remainder" | "box-center";
|
|
4621
4625
|
}
|
|
4622
4626
|
/**
|
|
4623
4627
|
* In addition to the properties you can set in the RequestInit dict
|
|
@@ -4723,23 +4727,43 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4723
4727
|
*/
|
|
4724
4728
|
dpr?: number;
|
|
4725
4729
|
/**
|
|
4726
|
-
*
|
|
4727
|
-
*
|
|
4728
|
-
*
|
|
4729
|
-
*
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4730
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
4731
|
+
* resizing or rotation.
|
|
4732
|
+
*
|
|
4733
|
+
* It can be used as:
|
|
4734
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
4735
|
+
* off each side
|
|
4736
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
4737
|
+
* in combination with the properties above
|
|
4738
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
4739
|
+
* it's color. It consists of three properties:
|
|
4740
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
4741
|
+
* - tolerance: difference from color to treat as color
|
|
4742
|
+
* - keep: the number of pixels of border to keep
|
|
4743
|
+
*/
|
|
4744
|
+
trim?:
|
|
4745
|
+
| "border"
|
|
4746
|
+
| {
|
|
4747
|
+
top?: number;
|
|
4748
|
+
bottom?: number;
|
|
4749
|
+
left?: number;
|
|
4750
|
+
right?: number;
|
|
4751
|
+
width?: number;
|
|
4752
|
+
height?: number;
|
|
4753
|
+
border?:
|
|
4754
|
+
| boolean
|
|
4755
|
+
| {
|
|
4756
|
+
color?: string;
|
|
4757
|
+
tolerance?: number;
|
|
4758
|
+
keep?: number;
|
|
4759
|
+
};
|
|
4760
|
+
};
|
|
4737
4761
|
/**
|
|
4738
4762
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
4739
4763
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
4740
4764
|
* to JPEG and WebP images. It doesn’t have any effect on PNG.
|
|
4741
4765
|
*/
|
|
4742
|
-
quality?: number;
|
|
4766
|
+
quality?: number | "low" | "medium-low" | "medium-high" | "high";
|
|
4743
4767
|
/**
|
|
4744
4768
|
* Output format to generate. It can be:
|
|
4745
4769
|
* - avif: generate images in AVIF format.
|
|
@@ -4751,7 +4775,15 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4751
4775
|
* - jpeg: generate images in JPEG format.
|
|
4752
4776
|
* - png: generate images in PNG format.
|
|
4753
4777
|
*/
|
|
4754
|
-
format?:
|
|
4778
|
+
format?:
|
|
4779
|
+
| "avif"
|
|
4780
|
+
| "webp"
|
|
4781
|
+
| "json"
|
|
4782
|
+
| "jpeg"
|
|
4783
|
+
| "png"
|
|
4784
|
+
| "baseline-jpeg"
|
|
4785
|
+
| "png-force"
|
|
4786
|
+
| "svg";
|
|
4755
4787
|
/**
|
|
4756
4788
|
* Whether to preserve animation frames from input files. Default is true.
|
|
4757
4789
|
* Setting it to false reduces animations to still images. This setting is
|
|
@@ -4831,6 +4863,18 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
4831
4863
|
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
4832
4864
|
*/
|
|
4833
4865
|
gamma?: number;
|
|
4866
|
+
/**
|
|
4867
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
4868
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
4869
|
+
* ignored.
|
|
4870
|
+
*/
|
|
4871
|
+
saturation?: number;
|
|
4872
|
+
/**
|
|
4873
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
4874
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
4875
|
+
* horizontally, then rotated by 90 degrees.
|
|
4876
|
+
*/
|
|
4877
|
+
flip?: "h" | "v" | "hv";
|
|
4834
4878
|
/**
|
|
4835
4879
|
* Slightly reduces latency on a cache miss by selecting a
|
|
4836
4880
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -5744,7 +5788,26 @@ type ImageInfoResponse =
|
|
|
5744
5788
|
height: number;
|
|
5745
5789
|
};
|
|
5746
5790
|
type ImageTransform = {
|
|
5791
|
+
width?: number;
|
|
5792
|
+
height?: number;
|
|
5793
|
+
background?: string;
|
|
5794
|
+
blur?: number;
|
|
5795
|
+
border?:
|
|
5796
|
+
| {
|
|
5797
|
+
color?: string;
|
|
5798
|
+
width?: number;
|
|
5799
|
+
}
|
|
5800
|
+
| {
|
|
5801
|
+
top?: number;
|
|
5802
|
+
bottom?: number;
|
|
5803
|
+
left?: number;
|
|
5804
|
+
right?: number;
|
|
5805
|
+
};
|
|
5806
|
+
brightness?: number;
|
|
5807
|
+
contrast?: number;
|
|
5747
5808
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
5809
|
+
flip?: "h" | "v" | "hv";
|
|
5810
|
+
gamma?: number;
|
|
5748
5811
|
gravity?:
|
|
5749
5812
|
| "left"
|
|
5750
5813
|
| "right"
|
|
@@ -5753,45 +5816,31 @@ type ImageTransform = {
|
|
|
5753
5816
|
| "center"
|
|
5754
5817
|
| "auto"
|
|
5755
5818
|
| "entropy"
|
|
5756
|
-
| "face"
|
|
5757
5819
|
| {
|
|
5758
5820
|
x?: number;
|
|
5759
5821
|
y?: number;
|
|
5760
5822
|
mode: "remainder" | "box-center";
|
|
5761
5823
|
};
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
bottom?: number;
|
|
5765
|
-
left?: number;
|
|
5766
|
-
right?: number;
|
|
5767
|
-
width?: number;
|
|
5768
|
-
height?: number;
|
|
5769
|
-
border?:
|
|
5770
|
-
| boolean
|
|
5771
|
-
| {
|
|
5772
|
-
color?: string;
|
|
5773
|
-
tolerance?: number;
|
|
5774
|
-
keep?: number;
|
|
5775
|
-
};
|
|
5776
|
-
};
|
|
5777
|
-
width?: number;
|
|
5778
|
-
height?: number;
|
|
5779
|
-
background?: string;
|
|
5780
|
-
rotate?: number;
|
|
5824
|
+
rotate?: 0 | 90 | 180 | 270;
|
|
5825
|
+
saturation?: number;
|
|
5781
5826
|
sharpen?: number;
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5827
|
+
trim?:
|
|
5828
|
+
| "border"
|
|
5829
|
+
| {
|
|
5830
|
+
top?: number;
|
|
5831
|
+
bottom?: number;
|
|
5832
|
+
left?: number;
|
|
5833
|
+
right?: number;
|
|
5834
|
+
width?: number;
|
|
5835
|
+
height?: number;
|
|
5836
|
+
border?:
|
|
5837
|
+
| boolean
|
|
5838
|
+
| {
|
|
5839
|
+
color?: string;
|
|
5840
|
+
tolerance?: number;
|
|
5841
|
+
keep?: number;
|
|
5842
|
+
};
|
|
5843
|
+
};
|
|
5795
5844
|
};
|
|
5796
5845
|
type ImageDrawOptions = {
|
|
5797
5846
|
opacity?: number;
|