@cloudflare/workers-types 4.20260616.1 → 4.20260619.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/2021-11-03/index.d.ts +307 -179
- package/2021-11-03/index.ts +307 -179
- package/2022-01-31/index.d.ts +307 -179
- package/2022-01-31/index.ts +307 -179
- package/2022-03-21/index.d.ts +307 -179
- package/2022-03-21/index.ts +307 -179
- package/2022-08-04/index.d.ts +307 -179
- package/2022-08-04/index.ts +307 -179
- package/2022-10-31/index.d.ts +307 -179
- package/2022-10-31/index.ts +307 -179
- package/2022-11-30/index.d.ts +307 -179
- package/2022-11-30/index.ts +307 -179
- package/2023-03-01/index.d.ts +307 -179
- package/2023-03-01/index.ts +307 -179
- package/2023-07-01/index.d.ts +307 -179
- package/2023-07-01/index.ts +307 -179
- package/experimental/index.d.ts +286 -179
- package/experimental/index.ts +286 -179
- package/index.d.ts +307 -179
- package/index.ts +307 -179
- package/latest/index.d.ts +307 -179
- package/latest/index.ts +307 -179
- package/oldest/index.d.ts +307 -179
- package/oldest/index.ts +307 -179
- package/package.json +1 -1
package/2021-11-03/index.d.ts
CHANGED
|
@@ -469,7 +469,8 @@ interface ExecutionContext<Props = unknown> {
|
|
|
469
469
|
passThroughOnException(): void;
|
|
470
470
|
readonly props: Props;
|
|
471
471
|
cache?: CacheContext;
|
|
472
|
-
|
|
472
|
+
readonly access?: CloudflareAccessContext;
|
|
473
|
+
tracing: Tracing;
|
|
473
474
|
}
|
|
474
475
|
type ExportedHandlerFetchHandler<
|
|
475
476
|
Env = unknown,
|
|
@@ -562,6 +563,10 @@ interface CachePurgeOptions {
|
|
|
562
563
|
interface CacheContext {
|
|
563
564
|
purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
|
|
564
565
|
}
|
|
566
|
+
interface CloudflareAccessContext {
|
|
567
|
+
readonly aud: string;
|
|
568
|
+
getIdentity(): Promise<CloudflareAccessIdentity | undefined>;
|
|
569
|
+
}
|
|
565
570
|
declare abstract class ColoLocalActorNamespace {
|
|
566
571
|
get(actorId: string): Fetcher;
|
|
567
572
|
}
|
|
@@ -627,6 +632,8 @@ type DurableObjectLocationHint =
|
|
|
627
632
|
| "weur"
|
|
628
633
|
| "eeur"
|
|
629
634
|
| "apac"
|
|
635
|
+
| "apac-ne"
|
|
636
|
+
| "apac-se"
|
|
630
637
|
| "oc"
|
|
631
638
|
| "afr"
|
|
632
639
|
| "me";
|
|
@@ -768,6 +775,7 @@ interface DurableObjectFacets {
|
|
|
768
775
|
): Fetcher<T>;
|
|
769
776
|
abort(name: string, reason: any): void;
|
|
770
777
|
delete(name: string): void;
|
|
778
|
+
clone(src: string, dst: string): void;
|
|
771
779
|
}
|
|
772
780
|
interface FacetStartupOptions<
|
|
773
781
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
@@ -3728,6 +3736,28 @@ interface EventSourceEventSourceInit {
|
|
|
3728
3736
|
withCredentials?: boolean;
|
|
3729
3737
|
fetcher?: Fetcher;
|
|
3730
3738
|
}
|
|
3739
|
+
interface ExecOutput {
|
|
3740
|
+
readonly stdout: ArrayBuffer;
|
|
3741
|
+
readonly stderr: ArrayBuffer;
|
|
3742
|
+
readonly exitCode: number;
|
|
3743
|
+
}
|
|
3744
|
+
interface ContainerExecOptions {
|
|
3745
|
+
cwd?: string;
|
|
3746
|
+
env?: Record<string, string>;
|
|
3747
|
+
user?: string;
|
|
3748
|
+
stdin?: ReadableStream | "pipe";
|
|
3749
|
+
stdout?: "pipe" | "ignore";
|
|
3750
|
+
stderr?: "pipe" | "ignore" | "combined";
|
|
3751
|
+
}
|
|
3752
|
+
interface ExecProcess {
|
|
3753
|
+
readonly stdin: WritableStream | null;
|
|
3754
|
+
readonly stdout: ReadableStream | null;
|
|
3755
|
+
readonly stderr: ReadableStream | null;
|
|
3756
|
+
readonly pid: number;
|
|
3757
|
+
readonly exitCode: Promise<number>;
|
|
3758
|
+
output(): Promise<ExecOutput>;
|
|
3759
|
+
kill(signal?: number): void;
|
|
3760
|
+
}
|
|
3731
3761
|
interface Container {
|
|
3732
3762
|
get running(): boolean;
|
|
3733
3763
|
start(options?: ContainerStartupOptions): void;
|
|
@@ -3745,6 +3775,7 @@ interface Container {
|
|
|
3745
3775
|
options: ContainerSnapshotOptions,
|
|
3746
3776
|
): Promise<ContainerSnapshot>;
|
|
3747
3777
|
interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
|
|
3778
|
+
exec(cmd: string[], options?: ContainerExecOptions): Promise<ExecProcess>;
|
|
3748
3779
|
}
|
|
3749
3780
|
interface ContainerDirectorySnapshot {
|
|
3750
3781
|
id: string;
|
|
@@ -3919,11 +3950,62 @@ interface Tracing {
|
|
|
3919
3950
|
callback: (span: Span, ...args: A) => T,
|
|
3920
3951
|
...args: A
|
|
3921
3952
|
): T;
|
|
3953
|
+
startActiveSpan<T, A extends unknown[]>(
|
|
3954
|
+
name: string,
|
|
3955
|
+
callback: (span: Span, ...args: A) => T,
|
|
3956
|
+
...args: A
|
|
3957
|
+
): T;
|
|
3922
3958
|
Span: typeof Span;
|
|
3923
3959
|
}
|
|
3924
3960
|
declare abstract class Span {
|
|
3925
3961
|
get isTraced(): boolean;
|
|
3926
3962
|
setAttribute(key: string, value?: boolean | number | string): void;
|
|
3963
|
+
end(): void;
|
|
3964
|
+
}
|
|
3965
|
+
/**
|
|
3966
|
+
* Represents the identity of a user authenticated via Cloudflare Access.
|
|
3967
|
+
* This matches the result of calling /cdn-cgi/access/get-identity.
|
|
3968
|
+
*
|
|
3969
|
+
* The exact structure of the returned object depends on the identity provider
|
|
3970
|
+
* configuration for the Access application. The fields below represent commonly
|
|
3971
|
+
* available properties, but additional provider-specific fields may be present.
|
|
3972
|
+
*/
|
|
3973
|
+
interface CloudflareAccessIdentity extends Record<string, unknown> {
|
|
3974
|
+
/** The user's email address, if available from the identity provider. */
|
|
3975
|
+
email?: string;
|
|
3976
|
+
/** The user's display name. */
|
|
3977
|
+
name?: string;
|
|
3978
|
+
/** The user's unique identifier. */
|
|
3979
|
+
user_uuid?: string;
|
|
3980
|
+
/** The Cloudflare account ID. */
|
|
3981
|
+
account_id?: string;
|
|
3982
|
+
/** Login timestamp (Unix epoch seconds). */
|
|
3983
|
+
iat?: number;
|
|
3984
|
+
/** The user's IP address at authentication time. */
|
|
3985
|
+
ip?: string;
|
|
3986
|
+
/** Authentication methods used (e.g., "pwd"). */
|
|
3987
|
+
amr?: string[];
|
|
3988
|
+
/** Identity provider information. */
|
|
3989
|
+
idp?: {
|
|
3990
|
+
id: string;
|
|
3991
|
+
type: string;
|
|
3992
|
+
};
|
|
3993
|
+
/** Geographic information about where the user authenticated. */
|
|
3994
|
+
geo?: {
|
|
3995
|
+
country: string;
|
|
3996
|
+
};
|
|
3997
|
+
/** Group memberships from the identity provider. */
|
|
3998
|
+
groups?: Array<{
|
|
3999
|
+
id: string;
|
|
4000
|
+
name: string;
|
|
4001
|
+
email?: string;
|
|
4002
|
+
}>;
|
|
4003
|
+
/** Device posture check results, keyed by check ID. */
|
|
4004
|
+
devicePosture?: Record<string, unknown>;
|
|
4005
|
+
/** True if the user connected via Cloudflare WARP. */
|
|
4006
|
+
is_warp?: boolean;
|
|
4007
|
+
/** True if the user is authenticated via Cloudflare Gateway. */
|
|
4008
|
+
is_gateway?: boolean;
|
|
3927
4009
|
}
|
|
3928
4010
|
// ============================================================================
|
|
3929
4011
|
// Agent Memory
|
|
@@ -12074,87 +12156,6 @@ declare abstract class BrowserRun {
|
|
|
12074
12156
|
options: BrowserRunMarkdownOptions,
|
|
12075
12157
|
): Promise<Response>;
|
|
12076
12158
|
}
|
|
12077
|
-
interface BasicImageTransformations {
|
|
12078
|
-
/**
|
|
12079
|
-
* Maximum width in image pixels. The value must be an integer.
|
|
12080
|
-
*/
|
|
12081
|
-
width?: number;
|
|
12082
|
-
/**
|
|
12083
|
-
* Maximum height in image pixels. The value must be an integer.
|
|
12084
|
-
*/
|
|
12085
|
-
height?: number;
|
|
12086
|
-
/**
|
|
12087
|
-
* Resizing mode as a string. It affects interpretation of width and height
|
|
12088
|
-
* options:
|
|
12089
|
-
* - scale-down: Similar to contain, but the image is never enlarged. If
|
|
12090
|
-
* the image is larger than given width or height, it will be resized.
|
|
12091
|
-
* Otherwise its original size will be kept.
|
|
12092
|
-
* - contain: Resizes to maximum size that fits within the given width and
|
|
12093
|
-
* height. If only a single dimension is given (e.g. only width), the
|
|
12094
|
-
* image will be shrunk or enlarged to exactly match that dimension.
|
|
12095
|
-
* Aspect ratio is always preserved.
|
|
12096
|
-
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
12097
|
-
* and height. If the image has an aspect ratio different from the ratio
|
|
12098
|
-
* of width and height, it will be cropped to fit.
|
|
12099
|
-
* - crop: The image will be shrunk and cropped to fit within the area
|
|
12100
|
-
* specified by width and height. The image will not be enlarged. For images
|
|
12101
|
-
* smaller than the given dimensions it's the same as scale-down. For
|
|
12102
|
-
* images larger than the given dimensions, it's the same as cover.
|
|
12103
|
-
* See also trim.
|
|
12104
|
-
* - pad: Resizes to the maximum size that fits within the given width and
|
|
12105
|
-
* height, and then fills the remaining area with a background color
|
|
12106
|
-
* (white by default). Use of this mode is not recommended, as the same
|
|
12107
|
-
* effect can be more efficiently achieved with the contain mode and the
|
|
12108
|
-
* CSS object-fit: contain property.
|
|
12109
|
-
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
12110
|
-
* breaks aspect ratio
|
|
12111
|
-
*/
|
|
12112
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
12113
|
-
/**
|
|
12114
|
-
* Image segmentation using artificial intelligence models. Sets pixels not
|
|
12115
|
-
* within selected segment area to transparent e.g "foreground" sets every
|
|
12116
|
-
* background pixel as transparent.
|
|
12117
|
-
*/
|
|
12118
|
-
segment?: "foreground";
|
|
12119
|
-
/**
|
|
12120
|
-
* When cropping with fit: "cover", this defines the side or point that should
|
|
12121
|
-
* be left uncropped. The value is either a string
|
|
12122
|
-
* "left", "right", "top", "bottom", "auto", or "center" (the default),
|
|
12123
|
-
* or an object {x, y} containing focal point coordinates in the original
|
|
12124
|
-
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
12125
|
-
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
12126
|
-
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
12127
|
-
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
12128
|
-
* preserve as much as possible around a point at 20% of the height of the
|
|
12129
|
-
* source image.
|
|
12130
|
-
*/
|
|
12131
|
-
gravity?:
|
|
12132
|
-
| "face"
|
|
12133
|
-
| "left"
|
|
12134
|
-
| "right"
|
|
12135
|
-
| "top"
|
|
12136
|
-
| "bottom"
|
|
12137
|
-
| "center"
|
|
12138
|
-
| "auto"
|
|
12139
|
-
| "entropy"
|
|
12140
|
-
| BasicImageTransformationsGravityCoordinates;
|
|
12141
|
-
/**
|
|
12142
|
-
* Background color to add underneath the image. Applies only to images with
|
|
12143
|
-
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
|
|
12144
|
-
* hsl(…), etc.)
|
|
12145
|
-
*/
|
|
12146
|
-
background?: string;
|
|
12147
|
-
/**
|
|
12148
|
-
* Number of degrees (90, 180, 270) to rotate the image by. width and height
|
|
12149
|
-
* options refer to axes after rotation.
|
|
12150
|
-
*/
|
|
12151
|
-
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
12152
|
-
}
|
|
12153
|
-
interface BasicImageTransformationsGravityCoordinates {
|
|
12154
|
-
x?: number;
|
|
12155
|
-
y?: number;
|
|
12156
|
-
mode?: "remainder" | "box-center";
|
|
12157
|
-
}
|
|
12158
12159
|
/**
|
|
12159
12160
|
* In addition to the properties you can set in the RequestInit dict
|
|
12160
12161
|
* that you pass as an argument to the Request constructor, you can
|
|
@@ -12230,6 +12231,17 @@ interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
12230
12231
|
cacheReserveMinimumFileSize?: number;
|
|
12231
12232
|
scrapeShield?: boolean;
|
|
12232
12233
|
apps?: boolean;
|
|
12234
|
+
/**
|
|
12235
|
+
* Controls whether an outbound gRPC-web subrequest from this Worker is
|
|
12236
|
+
* converted to gRPC at the Cloudflare edge.
|
|
12237
|
+
*
|
|
12238
|
+
* - `"passthrough"`: forward the subrequest unchanged as gRPC-web (default).
|
|
12239
|
+
* - `"convert"`: convert the gRPC-web subrequest to gRPC at the edge.
|
|
12240
|
+
*
|
|
12241
|
+
* Provides per-request control over the same edge conversion behavior
|
|
12242
|
+
* gated by the `auto_grpc_convert` compatibility flag.
|
|
12243
|
+
*/
|
|
12244
|
+
grpcWeb?: "passthrough" | "convert";
|
|
12233
12245
|
image?: RequestInitCfPropertiesImage;
|
|
12234
12246
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
12235
12247
|
mirage?: boolean;
|
|
@@ -12250,6 +12262,209 @@ interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
12250
12262
|
*/
|
|
12251
12263
|
resolveOverride?: string;
|
|
12252
12264
|
}
|
|
12265
|
+
interface BasicImageTransformations {
|
|
12266
|
+
/**
|
|
12267
|
+
* Maximum width in image pixels. The value must be an integer.
|
|
12268
|
+
*/
|
|
12269
|
+
width?: number;
|
|
12270
|
+
/**
|
|
12271
|
+
* Maximum height in image pixels. The value must be an integer.
|
|
12272
|
+
*/
|
|
12273
|
+
height?: number;
|
|
12274
|
+
/**
|
|
12275
|
+
* When cropping with fit: "cover", this defines the side or point that should
|
|
12276
|
+
* be left uncropped. The value is either a string
|
|
12277
|
+
* "left", "right", "top", "bottom", "auto", or "center" (the default),
|
|
12278
|
+
* or an object {x, y} containing focal point coordinates in the original
|
|
12279
|
+
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
12280
|
+
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
12281
|
+
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
12282
|
+
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
12283
|
+
* preserve as much as possible around a point at 20% of the height of the
|
|
12284
|
+
* source image.
|
|
12285
|
+
*/
|
|
12286
|
+
gravity?:
|
|
12287
|
+
| "face"
|
|
12288
|
+
| "left"
|
|
12289
|
+
| "right"
|
|
12290
|
+
| "top"
|
|
12291
|
+
| "bottom"
|
|
12292
|
+
| "center"
|
|
12293
|
+
| "auto"
|
|
12294
|
+
| "entropy"
|
|
12295
|
+
| BasicImageTransformationsGravityCoordinates;
|
|
12296
|
+
/**
|
|
12297
|
+
* Specifies how closely the image is cropped toward detected faces when combined
|
|
12298
|
+
* with the gravity=face option. Accepts a valid range between 0.0 (includes as much
|
|
12299
|
+
* of the background as possible) and 1.0 (crops the image as closely to the face as
|
|
12300
|
+
* possible). The default is 0.
|
|
12301
|
+
*/
|
|
12302
|
+
zoom?: number;
|
|
12303
|
+
/**
|
|
12304
|
+
* Resizing mode as a string. It affects interpretation of width and height
|
|
12305
|
+
* options:
|
|
12306
|
+
* - scale-down: Similar to contain, but the image is never enlarged. If
|
|
12307
|
+
* the image is larger than given width or height, it will be resized.
|
|
12308
|
+
* Otherwise its original size will be kept.
|
|
12309
|
+
* - scale-up: Similar to contain, but the image is never shrunk. If the
|
|
12310
|
+
* image is smaller than the given width or height, it will be resized.
|
|
12311
|
+
* Otherwise its original size will be kept.
|
|
12312
|
+
* - contain: Resizes to maximum size that fits within the given width and
|
|
12313
|
+
* height. If only a single dimension is given (e.g. only width), the
|
|
12314
|
+
* image will be shrunk or enlarged to exactly match that dimension.
|
|
12315
|
+
* Aspect ratio is always preserved.
|
|
12316
|
+
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
12317
|
+
* and height. If the image has an aspect ratio different from the ratio
|
|
12318
|
+
* of width and height, it will be cropped to fit.
|
|
12319
|
+
* - crop: The image will be shrunk and cropped to fit within the area
|
|
12320
|
+
* specified by width and height. The image will not be enlarged. For images
|
|
12321
|
+
* smaller than the given dimensions it's the same as scale-down. For
|
|
12322
|
+
* images larger than the given dimensions, it's the same as cover.
|
|
12323
|
+
* See also trim.
|
|
12324
|
+
* - pad: Resizes to the maximum size that fits within the given width and
|
|
12325
|
+
* height, and then fills the remaining area with a background color
|
|
12326
|
+
* (white by default). Use of this mode is not recommended, as the same
|
|
12327
|
+
* effect can be more efficiently achieved with the contain mode and the
|
|
12328
|
+
* CSS object-fit: contain property.
|
|
12329
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
12330
|
+
* breaks aspect ratio
|
|
12331
|
+
*/
|
|
12332
|
+
fit?:
|
|
12333
|
+
| "scale-down"
|
|
12334
|
+
| "scale-up"
|
|
12335
|
+
| "contain"
|
|
12336
|
+
| "cover"
|
|
12337
|
+
| "crop"
|
|
12338
|
+
| "pad"
|
|
12339
|
+
| "squeeze";
|
|
12340
|
+
/**
|
|
12341
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
12342
|
+
* resizing or rotation.
|
|
12343
|
+
*
|
|
12344
|
+
* It can be used as:
|
|
12345
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
12346
|
+
* off each side
|
|
12347
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
12348
|
+
* in combination with the properties above
|
|
12349
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
12350
|
+
* it's color. It consists of three properties:
|
|
12351
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
12352
|
+
* - tolerance: difference from color to treat as color
|
|
12353
|
+
* - keep: the number of pixels of border to keep
|
|
12354
|
+
*/
|
|
12355
|
+
trim?:
|
|
12356
|
+
| "border"
|
|
12357
|
+
| {
|
|
12358
|
+
top?: number;
|
|
12359
|
+
bottom?: number;
|
|
12360
|
+
left?: number;
|
|
12361
|
+
right?: number;
|
|
12362
|
+
width?: number;
|
|
12363
|
+
height?: number;
|
|
12364
|
+
border?:
|
|
12365
|
+
| boolean
|
|
12366
|
+
| {
|
|
12367
|
+
color?: string;
|
|
12368
|
+
tolerance?: number;
|
|
12369
|
+
keep?: number;
|
|
12370
|
+
};
|
|
12371
|
+
};
|
|
12372
|
+
/**
|
|
12373
|
+
* Background color to add underneath the image. Applies only to images with
|
|
12374
|
+
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
|
|
12375
|
+
* hsl(…), etc.)
|
|
12376
|
+
*/
|
|
12377
|
+
background?: string;
|
|
12378
|
+
/**
|
|
12379
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
12380
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
12381
|
+
* horizontally, then rotated by 90 degrees.
|
|
12382
|
+
*/
|
|
12383
|
+
flip?: "h" | "v" | "hv";
|
|
12384
|
+
/**
|
|
12385
|
+
* Number of degrees (90, 180, 270) to rotate the image by. width and height
|
|
12386
|
+
* options refer to axes after rotation.
|
|
12387
|
+
*/
|
|
12388
|
+
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
12389
|
+
/**
|
|
12390
|
+
* Strength of sharpening filter to apply to the image. Floating-point
|
|
12391
|
+
* number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
|
|
12392
|
+
* recommended value for downscaled images.
|
|
12393
|
+
*/
|
|
12394
|
+
sharpen?: number;
|
|
12395
|
+
/**
|
|
12396
|
+
* Radius of a blur filter (approximate gaussian). Maximum supported radius
|
|
12397
|
+
* is 250.
|
|
12398
|
+
*/
|
|
12399
|
+
blur?: number;
|
|
12400
|
+
/**
|
|
12401
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12402
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12403
|
+
* ignored.
|
|
12404
|
+
*/
|
|
12405
|
+
contrast?: number;
|
|
12406
|
+
/**
|
|
12407
|
+
* Increase brightness by a factor. A value of 1.0 equals no change, a value
|
|
12408
|
+
* of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
|
|
12409
|
+
* 0 is ignored.
|
|
12410
|
+
*/
|
|
12411
|
+
brightness?: number;
|
|
12412
|
+
/**
|
|
12413
|
+
* Increase exposure by a factor. A value of 1.0 equals no change, a value of
|
|
12414
|
+
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
12415
|
+
*/
|
|
12416
|
+
gamma?: number;
|
|
12417
|
+
/**
|
|
12418
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12419
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12420
|
+
* ignored.
|
|
12421
|
+
*/
|
|
12422
|
+
saturation?: number;
|
|
12423
|
+
/**
|
|
12424
|
+
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
12425
|
+
* easier to specify higher-DPI sizes in <img srcset>.
|
|
12426
|
+
*/
|
|
12427
|
+
dpr?: number;
|
|
12428
|
+
/**
|
|
12429
|
+
* Adds a border around the image. The border is added after resizing. Border
|
|
12430
|
+
* width takes dpr into account, and can be specified either using a single
|
|
12431
|
+
* width property, or individually for each side.
|
|
12432
|
+
*/
|
|
12433
|
+
border?:
|
|
12434
|
+
| {
|
|
12435
|
+
color: string;
|
|
12436
|
+
width: number;
|
|
12437
|
+
}
|
|
12438
|
+
| {
|
|
12439
|
+
color: string;
|
|
12440
|
+
top: number;
|
|
12441
|
+
right: number;
|
|
12442
|
+
bottom: number;
|
|
12443
|
+
left: number;
|
|
12444
|
+
};
|
|
12445
|
+
/**
|
|
12446
|
+
* Image segmentation using artificial intelligence models. Sets pixels not
|
|
12447
|
+
* within selected segment area to transparent e.g "foreground" sets every
|
|
12448
|
+
* background pixel as transparent.
|
|
12449
|
+
*/
|
|
12450
|
+
segment?: "foreground";
|
|
12451
|
+
/**
|
|
12452
|
+
* Controls the algorithm used when an image needs to be enlarged. This
|
|
12453
|
+
* parameter works with any fit mode that upscales, such as `contain`,
|
|
12454
|
+
* `cover`, and `scale-up`. It has no effect when `fit=scale-down` or when
|
|
12455
|
+
* the target dimensions are smaller than the source.
|
|
12456
|
+
* - interpolate: Uses bicubic interpolation, which may reduce image quality.
|
|
12457
|
+
* This is the default behavior when `upscale` is not specified.
|
|
12458
|
+
* - generate: Uses AI upscaling to produce sharper, more detailed results
|
|
12459
|
+
* when enlarging images.
|
|
12460
|
+
*/
|
|
12461
|
+
upscale?: "interpolate" | "generate";
|
|
12462
|
+
}
|
|
12463
|
+
interface BasicImageTransformationsGravityCoordinates {
|
|
12464
|
+
x?: number;
|
|
12465
|
+
y?: number;
|
|
12466
|
+
mode?: "remainder" | "box-center";
|
|
12467
|
+
}
|
|
12253
12468
|
interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
12254
12469
|
/**
|
|
12255
12470
|
* Absolute URL of the image file to use for the drawing. It can be any of
|
|
@@ -12303,43 +12518,6 @@ interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
|
12303
12518
|
right?: number;
|
|
12304
12519
|
}
|
|
12305
12520
|
interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
12306
|
-
/**
|
|
12307
|
-
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
12308
|
-
* easier to specify higher-DPI sizes in <img srcset>.
|
|
12309
|
-
*/
|
|
12310
|
-
dpr?: number;
|
|
12311
|
-
/**
|
|
12312
|
-
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
12313
|
-
* resizing or rotation.
|
|
12314
|
-
*
|
|
12315
|
-
* It can be used as:
|
|
12316
|
-
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
12317
|
-
* off each side
|
|
12318
|
-
* - width, height - the width/height you'd like to end up with - can be used
|
|
12319
|
-
* in combination with the properties above
|
|
12320
|
-
* - border - this will automatically trim the surroundings of an image based on
|
|
12321
|
-
* it's color. It consists of three properties:
|
|
12322
|
-
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
12323
|
-
* - tolerance: difference from color to treat as color
|
|
12324
|
-
* - keep: the number of pixels of border to keep
|
|
12325
|
-
*/
|
|
12326
|
-
trim?:
|
|
12327
|
-
| "border"
|
|
12328
|
-
| {
|
|
12329
|
-
top?: number;
|
|
12330
|
-
bottom?: number;
|
|
12331
|
-
left?: number;
|
|
12332
|
-
right?: number;
|
|
12333
|
-
width?: number;
|
|
12334
|
-
height?: number;
|
|
12335
|
-
border?:
|
|
12336
|
-
| boolean
|
|
12337
|
-
| {
|
|
12338
|
-
color?: string;
|
|
12339
|
-
tolerance?: number;
|
|
12340
|
-
keep?: number;
|
|
12341
|
-
};
|
|
12342
|
-
};
|
|
12343
12521
|
/**
|
|
12344
12522
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
12345
12523
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
@@ -12389,17 +12567,6 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
12389
12567
|
* output formats always discard metadata.
|
|
12390
12568
|
*/
|
|
12391
12569
|
metadata?: "keep" | "copyright" | "none";
|
|
12392
|
-
/**
|
|
12393
|
-
* Strength of sharpening filter to apply to the image. Floating-point
|
|
12394
|
-
* number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
|
|
12395
|
-
* recommended value for downscaled images.
|
|
12396
|
-
*/
|
|
12397
|
-
sharpen?: number;
|
|
12398
|
-
/**
|
|
12399
|
-
* Radius of a blur filter (approximate gaussian). Maximum supported radius
|
|
12400
|
-
* is 250.
|
|
12401
|
-
*/
|
|
12402
|
-
blur?: number;
|
|
12403
12570
|
/**
|
|
12404
12571
|
* Overlays are drawn in the order they appear in the array (last array
|
|
12405
12572
|
* entry is the topmost layer).
|
|
@@ -12411,52 +12578,6 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
|
12411
12578
|
* the origin.
|
|
12412
12579
|
*/
|
|
12413
12580
|
"origin-auth"?: "share-publicly";
|
|
12414
|
-
/**
|
|
12415
|
-
* Adds a border around the image. The border is added after resizing. Border
|
|
12416
|
-
* width takes dpr into account, and can be specified either using a single
|
|
12417
|
-
* width property, or individually for each side.
|
|
12418
|
-
*/
|
|
12419
|
-
border?:
|
|
12420
|
-
| {
|
|
12421
|
-
color: string;
|
|
12422
|
-
width: number;
|
|
12423
|
-
}
|
|
12424
|
-
| {
|
|
12425
|
-
color: string;
|
|
12426
|
-
top: number;
|
|
12427
|
-
right: number;
|
|
12428
|
-
bottom: number;
|
|
12429
|
-
left: number;
|
|
12430
|
-
};
|
|
12431
|
-
/**
|
|
12432
|
-
* Increase brightness by a factor. A value of 1.0 equals no change, a value
|
|
12433
|
-
* of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
|
|
12434
|
-
* 0 is ignored.
|
|
12435
|
-
*/
|
|
12436
|
-
brightness?: number;
|
|
12437
|
-
/**
|
|
12438
|
-
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12439
|
-
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12440
|
-
* ignored.
|
|
12441
|
-
*/
|
|
12442
|
-
contrast?: number;
|
|
12443
|
-
/**
|
|
12444
|
-
* Increase exposure by a factor. A value of 1.0 equals no change, a value of
|
|
12445
|
-
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
12446
|
-
*/
|
|
12447
|
-
gamma?: number;
|
|
12448
|
-
/**
|
|
12449
|
-
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12450
|
-
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12451
|
-
* ignored.
|
|
12452
|
-
*/
|
|
12453
|
-
saturation?: number;
|
|
12454
|
-
/**
|
|
12455
|
-
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
12456
|
-
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
12457
|
-
* horizontally, then rotated by 90 degrees.
|
|
12458
|
-
*/
|
|
12459
|
-
flip?: "h" | "v" | "hv";
|
|
12460
12581
|
/**
|
|
12461
12582
|
* Slightly reduces latency on a cache miss by selecting a
|
|
12462
12583
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -14396,6 +14517,10 @@ declare namespace CloudflareWorkersModule {
|
|
|
14396
14517
|
timeout?: WorkflowTimeoutDuration | number;
|
|
14397
14518
|
sensitive?: WorkflowStepSensitivity;
|
|
14398
14519
|
};
|
|
14520
|
+
export type WorkflowStepRollbackConfig = Pick<
|
|
14521
|
+
WorkflowStepConfig,
|
|
14522
|
+
"retries" | "timeout"
|
|
14523
|
+
>;
|
|
14399
14524
|
export type WorkflowCronSchedule = {
|
|
14400
14525
|
/** Cron expression that triggered this event. */
|
|
14401
14526
|
cron: string;
|
|
@@ -14424,16 +14549,18 @@ declare namespace CloudflareWorkersModule {
|
|
|
14424
14549
|
config: WorkflowStepConfig;
|
|
14425
14550
|
};
|
|
14426
14551
|
export type WorkflowRollbackContext<T = unknown> = {
|
|
14552
|
+
ctx: WorkflowStepContext;
|
|
14427
14553
|
error: Error;
|
|
14428
14554
|
output: T | undefined;
|
|
14555
|
+
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
|
14429
14556
|
stepName: string;
|
|
14430
14557
|
};
|
|
14431
14558
|
export type WorkflowRollbackHandler<T = unknown> = (
|
|
14432
14559
|
ctx: WorkflowRollbackContext<T>,
|
|
14433
14560
|
) => Promise<void>;
|
|
14434
14561
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
|
14435
|
-
rollback
|
|
14436
|
-
rollbackConfig?:
|
|
14562
|
+
rollback: WorkflowRollbackHandler<T>;
|
|
14563
|
+
rollbackConfig?: WorkflowStepRollbackConfig;
|
|
14437
14564
|
};
|
|
14438
14565
|
export abstract class WorkflowStep {
|
|
14439
14566
|
do<T extends Rpc.Serializable<T>>(
|
|
@@ -15402,7 +15529,8 @@ declare namespace TailStream {
|
|
|
15402
15529
|
| "loadShed"
|
|
15403
15530
|
| "responseStreamDisconnected"
|
|
15404
15531
|
| "scriptNotFound"
|
|
15405
|
-
| "internalError"
|
|
15532
|
+
| "internalError"
|
|
15533
|
+
| "exceededWallTime";
|
|
15406
15534
|
interface ScriptVersion {
|
|
15407
15535
|
readonly id: string;
|
|
15408
15536
|
readonly tag?: string;
|