@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/2022-01-31/index.ts
CHANGED
|
@@ -471,7 +471,8 @@ export interface ExecutionContext<Props = unknown> {
|
|
|
471
471
|
passThroughOnException(): void;
|
|
472
472
|
readonly props: Props;
|
|
473
473
|
cache?: CacheContext;
|
|
474
|
-
|
|
474
|
+
readonly access?: CloudflareAccessContext;
|
|
475
|
+
tracing: Tracing;
|
|
475
476
|
}
|
|
476
477
|
export type ExportedHandlerFetchHandler<
|
|
477
478
|
Env = unknown,
|
|
@@ -564,6 +565,10 @@ export interface CachePurgeOptions {
|
|
|
564
565
|
export interface CacheContext {
|
|
565
566
|
purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
|
|
566
567
|
}
|
|
568
|
+
export interface CloudflareAccessContext {
|
|
569
|
+
readonly aud: string;
|
|
570
|
+
getIdentity(): Promise<CloudflareAccessIdentity | undefined>;
|
|
571
|
+
}
|
|
567
572
|
export declare abstract class ColoLocalActorNamespace {
|
|
568
573
|
get(actorId: string): Fetcher;
|
|
569
574
|
}
|
|
@@ -629,6 +634,8 @@ export type DurableObjectLocationHint =
|
|
|
629
634
|
| "weur"
|
|
630
635
|
| "eeur"
|
|
631
636
|
| "apac"
|
|
637
|
+
| "apac-ne"
|
|
638
|
+
| "apac-se"
|
|
632
639
|
| "oc"
|
|
633
640
|
| "afr"
|
|
634
641
|
| "me";
|
|
@@ -770,6 +777,7 @@ export interface DurableObjectFacets {
|
|
|
770
777
|
): Fetcher<T>;
|
|
771
778
|
abort(name: string, reason: any): void;
|
|
772
779
|
delete(name: string): void;
|
|
780
|
+
clone(src: string, dst: string): void;
|
|
773
781
|
}
|
|
774
782
|
export interface FacetStartupOptions<
|
|
775
783
|
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
@@ -3801,6 +3809,28 @@ export interface EventSourceEventSourceInit {
|
|
|
3801
3809
|
withCredentials?: boolean;
|
|
3802
3810
|
fetcher?: Fetcher;
|
|
3803
3811
|
}
|
|
3812
|
+
export interface ExecOutput {
|
|
3813
|
+
readonly stdout: ArrayBuffer;
|
|
3814
|
+
readonly stderr: ArrayBuffer;
|
|
3815
|
+
readonly exitCode: number;
|
|
3816
|
+
}
|
|
3817
|
+
export interface ContainerExecOptions {
|
|
3818
|
+
cwd?: string;
|
|
3819
|
+
env?: Record<string, string>;
|
|
3820
|
+
user?: string;
|
|
3821
|
+
stdin?: ReadableStream | "pipe";
|
|
3822
|
+
stdout?: "pipe" | "ignore";
|
|
3823
|
+
stderr?: "pipe" | "ignore" | "combined";
|
|
3824
|
+
}
|
|
3825
|
+
export interface ExecProcess {
|
|
3826
|
+
readonly stdin: WritableStream | null;
|
|
3827
|
+
readonly stdout: ReadableStream | null;
|
|
3828
|
+
readonly stderr: ReadableStream | null;
|
|
3829
|
+
readonly pid: number;
|
|
3830
|
+
readonly exitCode: Promise<number>;
|
|
3831
|
+
output(): Promise<ExecOutput>;
|
|
3832
|
+
kill(signal?: number): void;
|
|
3833
|
+
}
|
|
3804
3834
|
export interface Container {
|
|
3805
3835
|
get running(): boolean;
|
|
3806
3836
|
start(options?: ContainerStartupOptions): void;
|
|
@@ -3818,6 +3848,7 @@ export interface Container {
|
|
|
3818
3848
|
options: ContainerSnapshotOptions,
|
|
3819
3849
|
): Promise<ContainerSnapshot>;
|
|
3820
3850
|
interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
|
|
3851
|
+
exec(cmd: string[], options?: ContainerExecOptions): Promise<ExecProcess>;
|
|
3821
3852
|
}
|
|
3822
3853
|
export interface ContainerDirectorySnapshot {
|
|
3823
3854
|
id: string;
|
|
@@ -3992,11 +4023,62 @@ export interface Tracing {
|
|
|
3992
4023
|
callback: (span: Span, ...args: A) => T,
|
|
3993
4024
|
...args: A
|
|
3994
4025
|
): T;
|
|
4026
|
+
startActiveSpan<T, A extends unknown[]>(
|
|
4027
|
+
name: string,
|
|
4028
|
+
callback: (span: Span, ...args: A) => T,
|
|
4029
|
+
...args: A
|
|
4030
|
+
): T;
|
|
3995
4031
|
Span: typeof Span;
|
|
3996
4032
|
}
|
|
3997
4033
|
export declare abstract class Span {
|
|
3998
4034
|
get isTraced(): boolean;
|
|
3999
4035
|
setAttribute(key: string, value?: boolean | number | string): void;
|
|
4036
|
+
end(): void;
|
|
4037
|
+
}
|
|
4038
|
+
/**
|
|
4039
|
+
* Represents the identity of a user authenticated via Cloudflare Access.
|
|
4040
|
+
* This matches the result of calling /cdn-cgi/access/get-identity.
|
|
4041
|
+
*
|
|
4042
|
+
* The exact structure of the returned object depends on the identity provider
|
|
4043
|
+
* configuration for the Access application. The fields below represent commonly
|
|
4044
|
+
* available properties, but additional provider-specific fields may be present.
|
|
4045
|
+
*/
|
|
4046
|
+
export interface CloudflareAccessIdentity extends Record<string, unknown> {
|
|
4047
|
+
/** The user's email address, if available from the identity provider. */
|
|
4048
|
+
email?: string;
|
|
4049
|
+
/** The user's display name. */
|
|
4050
|
+
name?: string;
|
|
4051
|
+
/** The user's unique identifier. */
|
|
4052
|
+
user_uuid?: string;
|
|
4053
|
+
/** The Cloudflare account ID. */
|
|
4054
|
+
account_id?: string;
|
|
4055
|
+
/** Login timestamp (Unix epoch seconds). */
|
|
4056
|
+
iat?: number;
|
|
4057
|
+
/** The user's IP address at authentication time. */
|
|
4058
|
+
ip?: string;
|
|
4059
|
+
/** Authentication methods used (e.g., "pwd"). */
|
|
4060
|
+
amr?: string[];
|
|
4061
|
+
/** Identity provider information. */
|
|
4062
|
+
idp?: {
|
|
4063
|
+
id: string;
|
|
4064
|
+
type: string;
|
|
4065
|
+
};
|
|
4066
|
+
/** Geographic information about where the user authenticated. */
|
|
4067
|
+
geo?: {
|
|
4068
|
+
country: string;
|
|
4069
|
+
};
|
|
4070
|
+
/** Group memberships from the identity provider. */
|
|
4071
|
+
groups?: Array<{
|
|
4072
|
+
id: string;
|
|
4073
|
+
name: string;
|
|
4074
|
+
email?: string;
|
|
4075
|
+
}>;
|
|
4076
|
+
/** Device posture check results, keyed by check ID. */
|
|
4077
|
+
devicePosture?: Record<string, unknown>;
|
|
4078
|
+
/** True if the user connected via Cloudflare WARP. */
|
|
4079
|
+
is_warp?: boolean;
|
|
4080
|
+
/** True if the user is authenticated via Cloudflare Gateway. */
|
|
4081
|
+
is_gateway?: boolean;
|
|
4000
4082
|
}
|
|
4001
4083
|
// ============================================================================
|
|
4002
4084
|
// Agent Memory
|
|
@@ -12153,87 +12235,6 @@ export declare abstract class BrowserRun {
|
|
|
12153
12235
|
options: BrowserRunMarkdownOptions,
|
|
12154
12236
|
): Promise<Response>;
|
|
12155
12237
|
}
|
|
12156
|
-
export interface BasicImageTransformations {
|
|
12157
|
-
/**
|
|
12158
|
-
* Maximum width in image pixels. The value must be an integer.
|
|
12159
|
-
*/
|
|
12160
|
-
width?: number;
|
|
12161
|
-
/**
|
|
12162
|
-
* Maximum height in image pixels. The value must be an integer.
|
|
12163
|
-
*/
|
|
12164
|
-
height?: number;
|
|
12165
|
-
/**
|
|
12166
|
-
* Resizing mode as a string. It affects interpretation of width and height
|
|
12167
|
-
* options:
|
|
12168
|
-
* - scale-down: Similar to contain, but the image is never enlarged. If
|
|
12169
|
-
* the image is larger than given width or height, it will be resized.
|
|
12170
|
-
* Otherwise its original size will be kept.
|
|
12171
|
-
* - contain: Resizes to maximum size that fits within the given width and
|
|
12172
|
-
* height. If only a single dimension is given (e.g. only width), the
|
|
12173
|
-
* image will be shrunk or enlarged to exactly match that dimension.
|
|
12174
|
-
* Aspect ratio is always preserved.
|
|
12175
|
-
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
12176
|
-
* and height. If the image has an aspect ratio different from the ratio
|
|
12177
|
-
* of width and height, it will be cropped to fit.
|
|
12178
|
-
* - crop: The image will be shrunk and cropped to fit within the area
|
|
12179
|
-
* specified by width and height. The image will not be enlarged. For images
|
|
12180
|
-
* smaller than the given dimensions it's the same as scale-down. For
|
|
12181
|
-
* images larger than the given dimensions, it's the same as cover.
|
|
12182
|
-
* See also trim.
|
|
12183
|
-
* - pad: Resizes to the maximum size that fits within the given width and
|
|
12184
|
-
* height, and then fills the remaining area with a background color
|
|
12185
|
-
* (white by default). Use of this mode is not recommended, as the same
|
|
12186
|
-
* effect can be more efficiently achieved with the contain mode and the
|
|
12187
|
-
* CSS object-fit: contain property.
|
|
12188
|
-
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
12189
|
-
* breaks aspect ratio
|
|
12190
|
-
*/
|
|
12191
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
12192
|
-
/**
|
|
12193
|
-
* Image segmentation using artificial intelligence models. Sets pixels not
|
|
12194
|
-
* within selected segment area to transparent e.g "foreground" sets every
|
|
12195
|
-
* background pixel as transparent.
|
|
12196
|
-
*/
|
|
12197
|
-
segment?: "foreground";
|
|
12198
|
-
/**
|
|
12199
|
-
* When cropping with fit: "cover", this defines the side or point that should
|
|
12200
|
-
* be left uncropped. The value is either a string
|
|
12201
|
-
* "left", "right", "top", "bottom", "auto", or "center" (the default),
|
|
12202
|
-
* or an object {x, y} containing focal point coordinates in the original
|
|
12203
|
-
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
12204
|
-
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
12205
|
-
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
12206
|
-
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
12207
|
-
* preserve as much as possible around a point at 20% of the height of the
|
|
12208
|
-
* source image.
|
|
12209
|
-
*/
|
|
12210
|
-
gravity?:
|
|
12211
|
-
| "face"
|
|
12212
|
-
| "left"
|
|
12213
|
-
| "right"
|
|
12214
|
-
| "top"
|
|
12215
|
-
| "bottom"
|
|
12216
|
-
| "center"
|
|
12217
|
-
| "auto"
|
|
12218
|
-
| "entropy"
|
|
12219
|
-
| BasicImageTransformationsGravityCoordinates;
|
|
12220
|
-
/**
|
|
12221
|
-
* Background color to add underneath the image. Applies only to images with
|
|
12222
|
-
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
|
|
12223
|
-
* hsl(…), etc.)
|
|
12224
|
-
*/
|
|
12225
|
-
background?: string;
|
|
12226
|
-
/**
|
|
12227
|
-
* Number of degrees (90, 180, 270) to rotate the image by. width and height
|
|
12228
|
-
* options refer to axes after rotation.
|
|
12229
|
-
*/
|
|
12230
|
-
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
12231
|
-
}
|
|
12232
|
-
export interface BasicImageTransformationsGravityCoordinates {
|
|
12233
|
-
x?: number;
|
|
12234
|
-
y?: number;
|
|
12235
|
-
mode?: "remainder" | "box-center";
|
|
12236
|
-
}
|
|
12237
12238
|
/**
|
|
12238
12239
|
* In addition to the properties you can set in the RequestInit dict
|
|
12239
12240
|
* that you pass as an argument to the Request constructor, you can
|
|
@@ -12309,6 +12310,17 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
12309
12310
|
cacheReserveMinimumFileSize?: number;
|
|
12310
12311
|
scrapeShield?: boolean;
|
|
12311
12312
|
apps?: boolean;
|
|
12313
|
+
/**
|
|
12314
|
+
* Controls whether an outbound gRPC-web subrequest from this Worker is
|
|
12315
|
+
* converted to gRPC at the Cloudflare edge.
|
|
12316
|
+
*
|
|
12317
|
+
* - `"passthrough"`: forward the subrequest unchanged as gRPC-web (default).
|
|
12318
|
+
* - `"convert"`: convert the gRPC-web subrequest to gRPC at the edge.
|
|
12319
|
+
*
|
|
12320
|
+
* Provides per-request control over the same edge conversion behavior
|
|
12321
|
+
* gated by the `auto_grpc_convert` compatibility flag.
|
|
12322
|
+
*/
|
|
12323
|
+
grpcWeb?: "passthrough" | "convert";
|
|
12312
12324
|
image?: RequestInitCfPropertiesImage;
|
|
12313
12325
|
minify?: RequestInitCfPropertiesImageMinify;
|
|
12314
12326
|
mirage?: boolean;
|
|
@@ -12329,6 +12341,209 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
|
|
|
12329
12341
|
*/
|
|
12330
12342
|
resolveOverride?: string;
|
|
12331
12343
|
}
|
|
12344
|
+
export interface BasicImageTransformations {
|
|
12345
|
+
/**
|
|
12346
|
+
* Maximum width in image pixels. The value must be an integer.
|
|
12347
|
+
*/
|
|
12348
|
+
width?: number;
|
|
12349
|
+
/**
|
|
12350
|
+
* Maximum height in image pixels. The value must be an integer.
|
|
12351
|
+
*/
|
|
12352
|
+
height?: number;
|
|
12353
|
+
/**
|
|
12354
|
+
* When cropping with fit: "cover", this defines the side or point that should
|
|
12355
|
+
* be left uncropped. The value is either a string
|
|
12356
|
+
* "left", "right", "top", "bottom", "auto", or "center" (the default),
|
|
12357
|
+
* or an object {x, y} containing focal point coordinates in the original
|
|
12358
|
+
* image expressed as fractions ranging from 0.0 (top or left) to 1.0
|
|
12359
|
+
* (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
|
|
12360
|
+
* crop bottom or left and right sides as necessary, but won’t crop anything
|
|
12361
|
+
* from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
|
|
12362
|
+
* preserve as much as possible around a point at 20% of the height of the
|
|
12363
|
+
* source image.
|
|
12364
|
+
*/
|
|
12365
|
+
gravity?:
|
|
12366
|
+
| "face"
|
|
12367
|
+
| "left"
|
|
12368
|
+
| "right"
|
|
12369
|
+
| "top"
|
|
12370
|
+
| "bottom"
|
|
12371
|
+
| "center"
|
|
12372
|
+
| "auto"
|
|
12373
|
+
| "entropy"
|
|
12374
|
+
| BasicImageTransformationsGravityCoordinates;
|
|
12375
|
+
/**
|
|
12376
|
+
* Specifies how closely the image is cropped toward detected faces when combined
|
|
12377
|
+
* with the gravity=face option. Accepts a valid range between 0.0 (includes as much
|
|
12378
|
+
* of the background as possible) and 1.0 (crops the image as closely to the face as
|
|
12379
|
+
* possible). The default is 0.
|
|
12380
|
+
*/
|
|
12381
|
+
zoom?: number;
|
|
12382
|
+
/**
|
|
12383
|
+
* Resizing mode as a string. It affects interpretation of width and height
|
|
12384
|
+
* options:
|
|
12385
|
+
* - scale-down: Similar to contain, but the image is never enlarged. If
|
|
12386
|
+
* the image is larger than given width or height, it will be resized.
|
|
12387
|
+
* Otherwise its original size will be kept.
|
|
12388
|
+
* - scale-up: Similar to contain, but the image is never shrunk. If the
|
|
12389
|
+
* image is smaller than the given width or height, it will be resized.
|
|
12390
|
+
* Otherwise its original size will be kept.
|
|
12391
|
+
* - contain: Resizes to maximum size that fits within the given width and
|
|
12392
|
+
* height. If only a single dimension is given (e.g. only width), the
|
|
12393
|
+
* image will be shrunk or enlarged to exactly match that dimension.
|
|
12394
|
+
* Aspect ratio is always preserved.
|
|
12395
|
+
* - cover: Resizes (shrinks or enlarges) to fill the entire area of width
|
|
12396
|
+
* and height. If the image has an aspect ratio different from the ratio
|
|
12397
|
+
* of width and height, it will be cropped to fit.
|
|
12398
|
+
* - crop: The image will be shrunk and cropped to fit within the area
|
|
12399
|
+
* specified by width and height. The image will not be enlarged. For images
|
|
12400
|
+
* smaller than the given dimensions it's the same as scale-down. For
|
|
12401
|
+
* images larger than the given dimensions, it's the same as cover.
|
|
12402
|
+
* See also trim.
|
|
12403
|
+
* - pad: Resizes to the maximum size that fits within the given width and
|
|
12404
|
+
* height, and then fills the remaining area with a background color
|
|
12405
|
+
* (white by default). Use of this mode is not recommended, as the same
|
|
12406
|
+
* effect can be more efficiently achieved with the contain mode and the
|
|
12407
|
+
* CSS object-fit: contain property.
|
|
12408
|
+
* - squeeze: Stretches and deforms to the width and height given, even if it
|
|
12409
|
+
* breaks aspect ratio
|
|
12410
|
+
*/
|
|
12411
|
+
fit?:
|
|
12412
|
+
| "scale-down"
|
|
12413
|
+
| "scale-up"
|
|
12414
|
+
| "contain"
|
|
12415
|
+
| "cover"
|
|
12416
|
+
| "crop"
|
|
12417
|
+
| "pad"
|
|
12418
|
+
| "squeeze";
|
|
12419
|
+
/**
|
|
12420
|
+
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
12421
|
+
* resizing or rotation.
|
|
12422
|
+
*
|
|
12423
|
+
* It can be used as:
|
|
12424
|
+
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
12425
|
+
* off each side
|
|
12426
|
+
* - width, height - the width/height you'd like to end up with - can be used
|
|
12427
|
+
* in combination with the properties above
|
|
12428
|
+
* - border - this will automatically trim the surroundings of an image based on
|
|
12429
|
+
* it's color. It consists of three properties:
|
|
12430
|
+
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
12431
|
+
* - tolerance: difference from color to treat as color
|
|
12432
|
+
* - keep: the number of pixels of border to keep
|
|
12433
|
+
*/
|
|
12434
|
+
trim?:
|
|
12435
|
+
| "border"
|
|
12436
|
+
| {
|
|
12437
|
+
top?: number;
|
|
12438
|
+
bottom?: number;
|
|
12439
|
+
left?: number;
|
|
12440
|
+
right?: number;
|
|
12441
|
+
width?: number;
|
|
12442
|
+
height?: number;
|
|
12443
|
+
border?:
|
|
12444
|
+
| boolean
|
|
12445
|
+
| {
|
|
12446
|
+
color?: string;
|
|
12447
|
+
tolerance?: number;
|
|
12448
|
+
keep?: number;
|
|
12449
|
+
};
|
|
12450
|
+
};
|
|
12451
|
+
/**
|
|
12452
|
+
* Background color to add underneath the image. Applies only to images with
|
|
12453
|
+
* transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
|
|
12454
|
+
* hsl(…), etc.)
|
|
12455
|
+
*/
|
|
12456
|
+
background?: string;
|
|
12457
|
+
/**
|
|
12458
|
+
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
12459
|
+
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
12460
|
+
* horizontally, then rotated by 90 degrees.
|
|
12461
|
+
*/
|
|
12462
|
+
flip?: "h" | "v" | "hv";
|
|
12463
|
+
/**
|
|
12464
|
+
* Number of degrees (90, 180, 270) to rotate the image by. width and height
|
|
12465
|
+
* options refer to axes after rotation.
|
|
12466
|
+
*/
|
|
12467
|
+
rotate?: 0 | 90 | 180 | 270 | 360;
|
|
12468
|
+
/**
|
|
12469
|
+
* Strength of sharpening filter to apply to the image. Floating-point
|
|
12470
|
+
* number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
|
|
12471
|
+
* recommended value for downscaled images.
|
|
12472
|
+
*/
|
|
12473
|
+
sharpen?: number;
|
|
12474
|
+
/**
|
|
12475
|
+
* Radius of a blur filter (approximate gaussian). Maximum supported radius
|
|
12476
|
+
* is 250.
|
|
12477
|
+
*/
|
|
12478
|
+
blur?: number;
|
|
12479
|
+
/**
|
|
12480
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12481
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12482
|
+
* ignored.
|
|
12483
|
+
*/
|
|
12484
|
+
contrast?: number;
|
|
12485
|
+
/**
|
|
12486
|
+
* Increase brightness by a factor. A value of 1.0 equals no change, a value
|
|
12487
|
+
* of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
|
|
12488
|
+
* 0 is ignored.
|
|
12489
|
+
*/
|
|
12490
|
+
brightness?: number;
|
|
12491
|
+
/**
|
|
12492
|
+
* Increase exposure by a factor. A value of 1.0 equals no change, a value of
|
|
12493
|
+
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
12494
|
+
*/
|
|
12495
|
+
gamma?: number;
|
|
12496
|
+
/**
|
|
12497
|
+
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12498
|
+
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12499
|
+
* ignored.
|
|
12500
|
+
*/
|
|
12501
|
+
saturation?: number;
|
|
12502
|
+
/**
|
|
12503
|
+
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
12504
|
+
* easier to specify higher-DPI sizes in <img srcset>.
|
|
12505
|
+
*/
|
|
12506
|
+
dpr?: number;
|
|
12507
|
+
/**
|
|
12508
|
+
* Adds a border around the image. The border is added after resizing. Border
|
|
12509
|
+
* width takes dpr into account, and can be specified either using a single
|
|
12510
|
+
* width property, or individually for each side.
|
|
12511
|
+
*/
|
|
12512
|
+
border?:
|
|
12513
|
+
| {
|
|
12514
|
+
color: string;
|
|
12515
|
+
width: number;
|
|
12516
|
+
}
|
|
12517
|
+
| {
|
|
12518
|
+
color: string;
|
|
12519
|
+
top: number;
|
|
12520
|
+
right: number;
|
|
12521
|
+
bottom: number;
|
|
12522
|
+
left: number;
|
|
12523
|
+
};
|
|
12524
|
+
/**
|
|
12525
|
+
* Image segmentation using artificial intelligence models. Sets pixels not
|
|
12526
|
+
* within selected segment area to transparent e.g "foreground" sets every
|
|
12527
|
+
* background pixel as transparent.
|
|
12528
|
+
*/
|
|
12529
|
+
segment?: "foreground";
|
|
12530
|
+
/**
|
|
12531
|
+
* Controls the algorithm used when an image needs to be enlarged. This
|
|
12532
|
+
* parameter works with any fit mode that upscales, such as `contain`,
|
|
12533
|
+
* `cover`, and `scale-up`. It has no effect when `fit=scale-down` or when
|
|
12534
|
+
* the target dimensions are smaller than the source.
|
|
12535
|
+
* - interpolate: Uses bicubic interpolation, which may reduce image quality.
|
|
12536
|
+
* This is the default behavior when `upscale` is not specified.
|
|
12537
|
+
* - generate: Uses AI upscaling to produce sharper, more detailed results
|
|
12538
|
+
* when enlarging images.
|
|
12539
|
+
*/
|
|
12540
|
+
upscale?: "interpolate" | "generate";
|
|
12541
|
+
}
|
|
12542
|
+
export interface BasicImageTransformationsGravityCoordinates {
|
|
12543
|
+
x?: number;
|
|
12544
|
+
y?: number;
|
|
12545
|
+
mode?: "remainder" | "box-center";
|
|
12546
|
+
}
|
|
12332
12547
|
export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
12333
12548
|
/**
|
|
12334
12549
|
* Absolute URL of the image file to use for the drawing. It can be any of
|
|
@@ -12382,43 +12597,6 @@ export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformati
|
|
|
12382
12597
|
right?: number;
|
|
12383
12598
|
}
|
|
12384
12599
|
export interface RequestInitCfPropertiesImage extends BasicImageTransformations {
|
|
12385
|
-
/**
|
|
12386
|
-
* Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
|
|
12387
|
-
* easier to specify higher-DPI sizes in <img srcset>.
|
|
12388
|
-
*/
|
|
12389
|
-
dpr?: number;
|
|
12390
|
-
/**
|
|
12391
|
-
* Allows you to trim your image. Takes dpr into account and is performed before
|
|
12392
|
-
* resizing or rotation.
|
|
12393
|
-
*
|
|
12394
|
-
* It can be used as:
|
|
12395
|
-
* - left, top, right, bottom - it will specify the number of pixels to cut
|
|
12396
|
-
* off each side
|
|
12397
|
-
* - width, height - the width/height you'd like to end up with - can be used
|
|
12398
|
-
* in combination with the properties above
|
|
12399
|
-
* - border - this will automatically trim the surroundings of an image based on
|
|
12400
|
-
* it's color. It consists of three properties:
|
|
12401
|
-
* - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
|
|
12402
|
-
* - tolerance: difference from color to treat as color
|
|
12403
|
-
* - keep: the number of pixels of border to keep
|
|
12404
|
-
*/
|
|
12405
|
-
trim?:
|
|
12406
|
-
| "border"
|
|
12407
|
-
| {
|
|
12408
|
-
top?: number;
|
|
12409
|
-
bottom?: number;
|
|
12410
|
-
left?: number;
|
|
12411
|
-
right?: number;
|
|
12412
|
-
width?: number;
|
|
12413
|
-
height?: number;
|
|
12414
|
-
border?:
|
|
12415
|
-
| boolean
|
|
12416
|
-
| {
|
|
12417
|
-
color?: string;
|
|
12418
|
-
tolerance?: number;
|
|
12419
|
-
keep?: number;
|
|
12420
|
-
};
|
|
12421
|
-
};
|
|
12422
12600
|
/**
|
|
12423
12601
|
* Quality setting from 1-100 (useful values are in 60-90 range). Lower values
|
|
12424
12602
|
* make images look worse, but load faster. The default is 85. It applies only
|
|
@@ -12468,17 +12646,6 @@ export interface RequestInitCfPropertiesImage extends BasicImageTransformations
|
|
|
12468
12646
|
* output formats always discard metadata.
|
|
12469
12647
|
*/
|
|
12470
12648
|
metadata?: "keep" | "copyright" | "none";
|
|
12471
|
-
/**
|
|
12472
|
-
* Strength of sharpening filter to apply to the image. Floating-point
|
|
12473
|
-
* number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
|
|
12474
|
-
* recommended value for downscaled images.
|
|
12475
|
-
*/
|
|
12476
|
-
sharpen?: number;
|
|
12477
|
-
/**
|
|
12478
|
-
* Radius of a blur filter (approximate gaussian). Maximum supported radius
|
|
12479
|
-
* is 250.
|
|
12480
|
-
*/
|
|
12481
|
-
blur?: number;
|
|
12482
12649
|
/**
|
|
12483
12650
|
* Overlays are drawn in the order they appear in the array (last array
|
|
12484
12651
|
* entry is the topmost layer).
|
|
@@ -12490,52 +12657,6 @@ export interface RequestInitCfPropertiesImage extends BasicImageTransformations
|
|
|
12490
12657
|
* the origin.
|
|
12491
12658
|
*/
|
|
12492
12659
|
"origin-auth"?: "share-publicly";
|
|
12493
|
-
/**
|
|
12494
|
-
* Adds a border around the image. The border is added after resizing. Border
|
|
12495
|
-
* width takes dpr into account, and can be specified either using a single
|
|
12496
|
-
* width property, or individually for each side.
|
|
12497
|
-
*/
|
|
12498
|
-
border?:
|
|
12499
|
-
| {
|
|
12500
|
-
color: string;
|
|
12501
|
-
width: number;
|
|
12502
|
-
}
|
|
12503
|
-
| {
|
|
12504
|
-
color: string;
|
|
12505
|
-
top: number;
|
|
12506
|
-
right: number;
|
|
12507
|
-
bottom: number;
|
|
12508
|
-
left: number;
|
|
12509
|
-
};
|
|
12510
|
-
/**
|
|
12511
|
-
* Increase brightness by a factor. A value of 1.0 equals no change, a value
|
|
12512
|
-
* of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
|
|
12513
|
-
* 0 is ignored.
|
|
12514
|
-
*/
|
|
12515
|
-
brightness?: number;
|
|
12516
|
-
/**
|
|
12517
|
-
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12518
|
-
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12519
|
-
* ignored.
|
|
12520
|
-
*/
|
|
12521
|
-
contrast?: number;
|
|
12522
|
-
/**
|
|
12523
|
-
* Increase exposure by a factor. A value of 1.0 equals no change, a value of
|
|
12524
|
-
* 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
|
|
12525
|
-
*/
|
|
12526
|
-
gamma?: number;
|
|
12527
|
-
/**
|
|
12528
|
-
* Increase contrast by a factor. A value of 1.0 equals no change, a value of
|
|
12529
|
-
* 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
|
|
12530
|
-
* ignored.
|
|
12531
|
-
*/
|
|
12532
|
-
saturation?: number;
|
|
12533
|
-
/**
|
|
12534
|
-
* Flips the images horizontally, vertically, or both. Flipping is applied before
|
|
12535
|
-
* rotation, so if you apply flip=h,rotate=90 then the image will be flipped
|
|
12536
|
-
* horizontally, then rotated by 90 degrees.
|
|
12537
|
-
*/
|
|
12538
|
-
flip?: "h" | "v" | "hv";
|
|
12539
12660
|
/**
|
|
12540
12661
|
* Slightly reduces latency on a cache miss by selecting a
|
|
12541
12662
|
* quickest-to-compress file format, at a cost of increased file size and
|
|
@@ -14434,6 +14555,10 @@ export declare namespace CloudflareWorkersModule {
|
|
|
14434
14555
|
timeout?: WorkflowTimeoutDuration | number;
|
|
14435
14556
|
sensitive?: WorkflowStepSensitivity;
|
|
14436
14557
|
};
|
|
14558
|
+
export type WorkflowStepRollbackConfig = Pick<
|
|
14559
|
+
WorkflowStepConfig,
|
|
14560
|
+
"retries" | "timeout"
|
|
14561
|
+
>;
|
|
14437
14562
|
export type WorkflowCronSchedule = {
|
|
14438
14563
|
/** Cron expression that triggered this event. */
|
|
14439
14564
|
cron: string;
|
|
@@ -14462,16 +14587,18 @@ export declare namespace CloudflareWorkersModule {
|
|
|
14462
14587
|
config: WorkflowStepConfig;
|
|
14463
14588
|
};
|
|
14464
14589
|
export type WorkflowRollbackContext<T = unknown> = {
|
|
14590
|
+
ctx: WorkflowStepContext;
|
|
14465
14591
|
error: Error;
|
|
14466
14592
|
output: T | undefined;
|
|
14593
|
+
/** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
|
|
14467
14594
|
stepName: string;
|
|
14468
14595
|
};
|
|
14469
14596
|
export type WorkflowRollbackHandler<T = unknown> = (
|
|
14470
14597
|
ctx: WorkflowRollbackContext<T>,
|
|
14471
14598
|
) => Promise<void>;
|
|
14472
14599
|
export type WorkflowStepRollbackOptions<T = unknown> = {
|
|
14473
|
-
rollback
|
|
14474
|
-
rollbackConfig?:
|
|
14600
|
+
rollback: WorkflowRollbackHandler<T>;
|
|
14601
|
+
rollbackConfig?: WorkflowStepRollbackConfig;
|
|
14475
14602
|
};
|
|
14476
14603
|
export abstract class WorkflowStep {
|
|
14477
14604
|
do<T extends Rpc.Serializable<T>>(
|
|
@@ -15430,7 +15557,8 @@ export declare namespace TailStream {
|
|
|
15430
15557
|
| "loadShed"
|
|
15431
15558
|
| "responseStreamDisconnected"
|
|
15432
15559
|
| "scriptNotFound"
|
|
15433
|
-
| "internalError"
|
|
15560
|
+
| "internalError"
|
|
15561
|
+
| "exceededWallTime";
|
|
15434
15562
|
interface ScriptVersion {
|
|
15435
15563
|
readonly id: string;
|
|
15436
15564
|
readonly tag?: string;
|