@cloudflare/workers-types 4.20240925.0 → 4.20241011.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 +81 -47
- package/2021-11-03/index.ts +59 -31
- package/2022-01-31/index.d.ts +102 -68
- package/2022-01-31/index.ts +80 -52
- package/2022-03-21/index.d.ts +102 -68
- package/2022-03-21/index.ts +80 -52
- package/2022-08-04/index.d.ts +102 -68
- package/2022-08-04/index.ts +80 -52
- package/2022-10-31/index.d.ts +109 -75
- package/2022-10-31/index.ts +87 -59
- package/2022-11-30/index.d.ts +109 -75
- package/2022-11-30/index.ts +87 -59
- package/2023-03-01/index.d.ts +109 -75
- package/2023-03-01/index.ts +87 -59
- package/2023-07-01/index.d.ts +111 -77
- package/2023-07-01/index.ts +89 -61
- package/experimental/index.d.ts +111 -77
- package/experimental/index.ts +89 -61
- package/index.d.ts +81 -47
- package/index.ts +59 -31
- package/oldest/index.d.ts +81 -47
- package/oldest/index.ts +59 -31
- package/package.json +1 -1
package/2021-11-03/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
|
+
declare var onmessage: never;
|
|
17
18
|
/**
|
|
18
19
|
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
|
19
20
|
*
|
|
@@ -1517,12 +1518,18 @@ declare abstract class Body {
|
|
|
1517
1518
|
*
|
|
1518
1519
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1519
1520
|
*/
|
|
1520
|
-
declare
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1521
|
+
declare var Response: {
|
|
1522
|
+
prototype: Response;
|
|
1523
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
1524
|
+
redirect(url: string, status?: number): Response;
|
|
1525
|
+
json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1526
|
+
};
|
|
1527
|
+
/**
|
|
1528
|
+
* This Fetch API interface represents the response to a request.
|
|
1529
|
+
*
|
|
1530
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1531
|
+
*/
|
|
1532
|
+
interface Response extends Body {
|
|
1526
1533
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1527
1534
|
clone(): Response;
|
|
1528
1535
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
@@ -1557,11 +1564,20 @@ type RequestInfo<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>> =
|
|
|
1557
1564
|
*
|
|
1558
1565
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1559
1566
|
*/
|
|
1560
|
-
declare
|
|
1561
|
-
|
|
1562
|
-
Cf = CfProperties<CfHostMetadata
|
|
1563
|
-
|
|
1564
|
-
|
|
1567
|
+
declare var Request: {
|
|
1568
|
+
prototype: Request;
|
|
1569
|
+
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
|
|
1570
|
+
input: RequestInfo<CfProperties>,
|
|
1571
|
+
init?: RequestInit<Cf>,
|
|
1572
|
+
): Request<CfHostMetadata, Cf>;
|
|
1573
|
+
};
|
|
1574
|
+
/**
|
|
1575
|
+
* This Fetch API interface represents a resource request.
|
|
1576
|
+
*
|
|
1577
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1578
|
+
*/
|
|
1579
|
+
interface Request<CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>
|
|
1580
|
+
extends Body {
|
|
1565
1581
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1566
1582
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1567
1583
|
/**
|
|
@@ -2292,7 +2308,7 @@ declare class TextDecoderStream extends TransformStream<
|
|
|
2292
2308
|
ArrayBuffer | ArrayBufferView,
|
|
2293
2309
|
string
|
|
2294
2310
|
> {
|
|
2295
|
-
constructor(
|
|
2311
|
+
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
2296
2312
|
get encoding(): string;
|
|
2297
2313
|
get fatal(): boolean;
|
|
2298
2314
|
get ignoreBOM(): boolean;
|
|
@@ -2662,8 +2678,24 @@ type WebSocketEventMap = {
|
|
|
2662
2678
|
*
|
|
2663
2679
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2664
2680
|
*/
|
|
2665
|
-
declare
|
|
2666
|
-
|
|
2681
|
+
declare var WebSocket: {
|
|
2682
|
+
prototype: WebSocket;
|
|
2683
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
2684
|
+
readonly READY_STATE_CONNECTING: number;
|
|
2685
|
+
readonly CONNECTING: number;
|
|
2686
|
+
readonly READY_STATE_OPEN: number;
|
|
2687
|
+
readonly OPEN: number;
|
|
2688
|
+
readonly READY_STATE_CLOSING: number;
|
|
2689
|
+
readonly CLOSING: number;
|
|
2690
|
+
readonly READY_STATE_CLOSED: number;
|
|
2691
|
+
readonly CLOSED: number;
|
|
2692
|
+
};
|
|
2693
|
+
/**
|
|
2694
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2695
|
+
*
|
|
2696
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2697
|
+
*/
|
|
2698
|
+
interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2667
2699
|
accept(): void;
|
|
2668
2700
|
/**
|
|
2669
2701
|
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
@@ -2679,14 +2711,6 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
2679
2711
|
close(code?: number, reason?: string): void;
|
|
2680
2712
|
serializeAttachment(attachment: any): void;
|
|
2681
2713
|
deserializeAttachment(): any | null;
|
|
2682
|
-
static readonly READY_STATE_CONNECTING: number;
|
|
2683
|
-
static readonly CONNECTING: number;
|
|
2684
|
-
static readonly READY_STATE_OPEN: number;
|
|
2685
|
-
static readonly OPEN: number;
|
|
2686
|
-
static readonly READY_STATE_CLOSING: number;
|
|
2687
|
-
static readonly CLOSING: number;
|
|
2688
|
-
static readonly READY_STATE_CLOSED: number;
|
|
2689
|
-
static readonly CLOSED: number;
|
|
2690
2714
|
/**
|
|
2691
2715
|
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2692
2716
|
*
|
|
@@ -3484,7 +3508,7 @@ type AiTextToImageInput = {
|
|
|
3484
3508
|
strength?: number;
|
|
3485
3509
|
guidance?: number;
|
|
3486
3510
|
};
|
|
3487
|
-
type AiTextToImageOutput = Uint8Array
|
|
3511
|
+
type AiTextToImageOutput = ReadableStream<Uint8Array>;
|
|
3488
3512
|
declare abstract class BaseAiTextToImage {
|
|
3489
3513
|
inputs: AiTextToImageInput;
|
|
3490
3514
|
postProcessedOutputs: AiTextToImageOutput;
|
|
@@ -3503,9 +3527,11 @@ declare abstract class BaseAiTranslation {
|
|
|
3503
3527
|
}
|
|
3504
3528
|
type GatewayOptions = {
|
|
3505
3529
|
id: string;
|
|
3530
|
+
cacheKey?: string;
|
|
3506
3531
|
cacheTtl?: number;
|
|
3507
3532
|
skipCache?: boolean;
|
|
3508
3533
|
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
3534
|
+
collectLog?: boolean;
|
|
3509
3535
|
};
|
|
3510
3536
|
type AiOptions = {
|
|
3511
3537
|
gateway?: GatewayOptions;
|
|
@@ -4761,7 +4787,7 @@ interface Hyperdrive {
|
|
|
4761
4787
|
// Copyright (c) 2024 Cloudflare, Inc.
|
|
4762
4788
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4763
4789
|
// https://opensource.org/licenses/Apache-2.0
|
|
4764
|
-
type
|
|
4790
|
+
type ImageInfoResponse =
|
|
4765
4791
|
| {
|
|
4766
4792
|
format: "image/svg+xml";
|
|
4767
4793
|
}
|
|
@@ -4771,7 +4797,7 @@ type InfoResponse =
|
|
|
4771
4797
|
width: number;
|
|
4772
4798
|
height: number;
|
|
4773
4799
|
};
|
|
4774
|
-
type
|
|
4800
|
+
type ImageTransform = {
|
|
4775
4801
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
4776
4802
|
gravity?:
|
|
4777
4803
|
| "left"
|
|
@@ -4821,7 +4847,7 @@ type Transform = {
|
|
|
4821
4847
|
};
|
|
4822
4848
|
zoom?: number;
|
|
4823
4849
|
};
|
|
4824
|
-
type
|
|
4850
|
+
type ImageOutputOptions = {
|
|
4825
4851
|
format:
|
|
4826
4852
|
| "image/jpeg"
|
|
4827
4853
|
| "image/png"
|
|
@@ -4839,7 +4865,7 @@ interface ImagesBinding {
|
|
|
4839
4865
|
* @throws {@link ImagesError} with code 9412 if input is not an image
|
|
4840
4866
|
* @param stream The image bytes
|
|
4841
4867
|
*/
|
|
4842
|
-
info(stream: ReadableStream<Uint8Array>): Promise<
|
|
4868
|
+
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
|
|
4843
4869
|
/**
|
|
4844
4870
|
* Begin applying a series of transformations to an image
|
|
4845
4871
|
* @param stream The image bytes
|
|
@@ -4853,15 +4879,15 @@ interface ImageTransformer {
|
|
|
4853
4879
|
* You can then apply more transformations or retrieve the output.
|
|
4854
4880
|
* @param transform
|
|
4855
4881
|
*/
|
|
4856
|
-
transform(transform:
|
|
4882
|
+
transform(transform: ImageTransform): ImageTransformer;
|
|
4857
4883
|
/**
|
|
4858
4884
|
* Retrieve the image that results from applying the transforms to the
|
|
4859
4885
|
* provided input
|
|
4860
4886
|
* @param options Options that apply to the output e.g. output format
|
|
4861
4887
|
*/
|
|
4862
|
-
output(options:
|
|
4888
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
4863
4889
|
}
|
|
4864
|
-
interface
|
|
4890
|
+
interface ImageTransformationResult {
|
|
4865
4891
|
/**
|
|
4866
4892
|
* The image as a response, ready to store in cache or return to users
|
|
4867
4893
|
*/
|
|
@@ -5010,7 +5036,7 @@ declare namespace Rpc {
|
|
|
5010
5036
|
export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
|
|
5011
5037
|
export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
|
|
5012
5038
|
export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
|
|
5013
|
-
export const
|
|
5039
|
+
export const __WORKFLOW_ENTRYPOINT_BRAND: "__WORKFLOW_ENTRYPOINT_BRAND";
|
|
5014
5040
|
export interface RpcTargetBranded {
|
|
5015
5041
|
[__RPC_TARGET_BRAND]: never;
|
|
5016
5042
|
}
|
|
@@ -5020,13 +5046,13 @@ declare namespace Rpc {
|
|
|
5020
5046
|
export interface DurableObjectBranded {
|
|
5021
5047
|
[__DURABLE_OBJECT_BRAND]: never;
|
|
5022
5048
|
}
|
|
5023
|
-
export interface
|
|
5024
|
-
[
|
|
5049
|
+
export interface WorkflowEntrypointBranded {
|
|
5050
|
+
[__WORKFLOW_ENTRYPOINT_BRAND]: never;
|
|
5025
5051
|
}
|
|
5026
5052
|
export type EntrypointBranded =
|
|
5027
5053
|
| WorkerEntrypointBranded
|
|
5028
5054
|
| DurableObjectBranded
|
|
5029
|
-
|
|
|
5055
|
+
| WorkflowEntrypointBranded;
|
|
5030
5056
|
// Types that can be used through `Stub`s
|
|
5031
5057
|
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
5032
5058
|
// Types that can be passed over RPC
|
|
@@ -5221,25 +5247,33 @@ declare module "cloudflare:workers" {
|
|
|
5221
5247
|
timestamp: Date;
|
|
5222
5248
|
};
|
|
5223
5249
|
export type WorkflowStep = {
|
|
5224
|
-
do:
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5250
|
+
do:
|
|
5251
|
+
| (<T extends Rpc.Serializable>(
|
|
5252
|
+
name: string,
|
|
5253
|
+
callback: () => Promise<T>,
|
|
5254
|
+
) => Promise<T>)
|
|
5255
|
+
| (<T extends Rpc.Serializable>(
|
|
5256
|
+
name: string,
|
|
5257
|
+
config: WorkflowStepConfig,
|
|
5258
|
+
callback: () => Promise<T>,
|
|
5259
|
+
) => Promise<T>)
|
|
5260
|
+
| (<T extends Rpc.Serializable>(
|
|
5261
|
+
name: string,
|
|
5262
|
+
config: WorkflowStepConfig | (() => Promise<T>),
|
|
5263
|
+
callback?: () => Promise<T>,
|
|
5264
|
+
) => Promise<T>);
|
|
5265
|
+
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
5266
|
+
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
5233
5267
|
};
|
|
5234
|
-
export abstract class
|
|
5268
|
+
export abstract class WorkflowEntrypoint<
|
|
5235
5269
|
Env = unknown,
|
|
5236
5270
|
T extends Rpc.Serializable | unknown = unknown,
|
|
5237
|
-
> implements Rpc.
|
|
5271
|
+
> implements Rpc.WorkflowEntrypointBranded
|
|
5238
5272
|
{
|
|
5239
|
-
[Rpc.
|
|
5273
|
+
[Rpc.__WORKFLOW_ENTRYPOINT_BRAND]: never;
|
|
5240
5274
|
protected ctx: ExecutionContext;
|
|
5241
5275
|
protected env: Env;
|
|
5242
|
-
run(
|
|
5276
|
+
run(event: WorkflowEvent<T>, step: WorkflowStep): Promise<unknown>;
|
|
5243
5277
|
}
|
|
5244
5278
|
}
|
|
5245
5279
|
declare module "cloudflare:sockets" {
|
package/2021-11-03/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ and limitations under the License.
|
|
|
14
14
|
***************************************************************************** */
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
|
+
export declare var onmessage: never;
|
|
17
18
|
/**
|
|
18
19
|
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
|
|
19
20
|
*
|
|
@@ -1522,12 +1523,18 @@ export declare abstract class Body {
|
|
|
1522
1523
|
*
|
|
1523
1524
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1524
1525
|
*/
|
|
1525
|
-
export declare
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1526
|
+
export declare var Response: {
|
|
1527
|
+
prototype: Response;
|
|
1528
|
+
new (body?: BodyInit | null, init?: ResponseInit): Response;
|
|
1529
|
+
redirect(url: string, status?: number): Response;
|
|
1530
|
+
json(any: any, maybeInit?: ResponseInit | Response): Response;
|
|
1531
|
+
};
|
|
1532
|
+
/**
|
|
1533
|
+
* This Fetch API interface represents the response to a request.
|
|
1534
|
+
*
|
|
1535
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response)
|
|
1536
|
+
*/
|
|
1537
|
+
export interface Response extends Body {
|
|
1531
1538
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */
|
|
1532
1539
|
clone(): Response;
|
|
1533
1540
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/status) */
|
|
@@ -1562,11 +1569,22 @@ export type RequestInfo<
|
|
|
1562
1569
|
*
|
|
1563
1570
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1564
1571
|
*/
|
|
1565
|
-
export declare
|
|
1572
|
+
export declare var Request: {
|
|
1573
|
+
prototype: Request;
|
|
1574
|
+
new <CfHostMetadata = unknown, Cf = CfProperties<CfHostMetadata>>(
|
|
1575
|
+
input: RequestInfo<CfProperties>,
|
|
1576
|
+
init?: RequestInit<Cf>,
|
|
1577
|
+
): Request<CfHostMetadata, Cf>;
|
|
1578
|
+
};
|
|
1579
|
+
/**
|
|
1580
|
+
* This Fetch API interface represents a resource request.
|
|
1581
|
+
*
|
|
1582
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request)
|
|
1583
|
+
*/
|
|
1584
|
+
export interface Request<
|
|
1566
1585
|
CfHostMetadata = unknown,
|
|
1567
1586
|
Cf = CfProperties<CfHostMetadata>,
|
|
1568
1587
|
> extends Body {
|
|
1569
|
-
constructor(input: RequestInfo<CfProperties>, init?: RequestInit<Cf>);
|
|
1570
1588
|
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/clone) */
|
|
1571
1589
|
clone(): Request<CfHostMetadata, Cf>;
|
|
1572
1590
|
/**
|
|
@@ -2301,7 +2319,7 @@ export declare class TextDecoderStream extends TransformStream<
|
|
|
2301
2319
|
ArrayBuffer | ArrayBufferView,
|
|
2302
2320
|
string
|
|
2303
2321
|
> {
|
|
2304
|
-
constructor(
|
|
2322
|
+
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
2305
2323
|
get encoding(): string;
|
|
2306
2324
|
get fatal(): boolean;
|
|
2307
2325
|
get ignoreBOM(): boolean;
|
|
@@ -2671,8 +2689,24 @@ export type WebSocketEventMap = {
|
|
|
2671
2689
|
*
|
|
2672
2690
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2673
2691
|
*/
|
|
2674
|
-
export declare
|
|
2675
|
-
|
|
2692
|
+
export declare var WebSocket: {
|
|
2693
|
+
prototype: WebSocket;
|
|
2694
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
2695
|
+
readonly READY_STATE_CONNECTING: number;
|
|
2696
|
+
readonly CONNECTING: number;
|
|
2697
|
+
readonly READY_STATE_OPEN: number;
|
|
2698
|
+
readonly OPEN: number;
|
|
2699
|
+
readonly READY_STATE_CLOSING: number;
|
|
2700
|
+
readonly CLOSING: number;
|
|
2701
|
+
readonly READY_STATE_CLOSED: number;
|
|
2702
|
+
readonly CLOSED: number;
|
|
2703
|
+
};
|
|
2704
|
+
/**
|
|
2705
|
+
* Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
2706
|
+
*
|
|
2707
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
2708
|
+
*/
|
|
2709
|
+
export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
2676
2710
|
accept(): void;
|
|
2677
2711
|
/**
|
|
2678
2712
|
* Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView.
|
|
@@ -2688,14 +2722,6 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
2688
2722
|
close(code?: number, reason?: string): void;
|
|
2689
2723
|
serializeAttachment(attachment: any): void;
|
|
2690
2724
|
deserializeAttachment(): any | null;
|
|
2691
|
-
static readonly READY_STATE_CONNECTING: number;
|
|
2692
|
-
static readonly CONNECTING: number;
|
|
2693
|
-
static readonly READY_STATE_OPEN: number;
|
|
2694
|
-
static readonly OPEN: number;
|
|
2695
|
-
static readonly READY_STATE_CLOSING: number;
|
|
2696
|
-
static readonly CLOSING: number;
|
|
2697
|
-
static readonly READY_STATE_CLOSED: number;
|
|
2698
|
-
static readonly CLOSED: number;
|
|
2699
2725
|
/**
|
|
2700
2726
|
* Returns the state of the WebSocket object's connection. It can have the values described below.
|
|
2701
2727
|
*
|
|
@@ -3493,7 +3519,7 @@ export type AiTextToImageInput = {
|
|
|
3493
3519
|
strength?: number;
|
|
3494
3520
|
guidance?: number;
|
|
3495
3521
|
};
|
|
3496
|
-
export type AiTextToImageOutput = Uint8Array
|
|
3522
|
+
export type AiTextToImageOutput = ReadableStream<Uint8Array>;
|
|
3497
3523
|
export declare abstract class BaseAiTextToImage {
|
|
3498
3524
|
inputs: AiTextToImageInput;
|
|
3499
3525
|
postProcessedOutputs: AiTextToImageOutput;
|
|
@@ -3512,9 +3538,11 @@ export declare abstract class BaseAiTranslation {
|
|
|
3512
3538
|
}
|
|
3513
3539
|
export type GatewayOptions = {
|
|
3514
3540
|
id: string;
|
|
3541
|
+
cacheKey?: string;
|
|
3515
3542
|
cacheTtl?: number;
|
|
3516
3543
|
skipCache?: boolean;
|
|
3517
3544
|
metadata?: Record<string, number | string | boolean | null | bigint>;
|
|
3545
|
+
collectLog?: boolean;
|
|
3518
3546
|
};
|
|
3519
3547
|
export type AiOptions = {
|
|
3520
3548
|
gateway?: GatewayOptions;
|
|
@@ -4776,7 +4804,7 @@ export interface Hyperdrive {
|
|
|
4776
4804
|
// Copyright (c) 2024 Cloudflare, Inc.
|
|
4777
4805
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
4778
4806
|
// https://opensource.org/licenses/Apache-2.0
|
|
4779
|
-
export type
|
|
4807
|
+
export type ImageInfoResponse =
|
|
4780
4808
|
| {
|
|
4781
4809
|
format: "image/svg+xml";
|
|
4782
4810
|
}
|
|
@@ -4786,7 +4814,7 @@ export type InfoResponse =
|
|
|
4786
4814
|
width: number;
|
|
4787
4815
|
height: number;
|
|
4788
4816
|
};
|
|
4789
|
-
export type
|
|
4817
|
+
export type ImageTransform = {
|
|
4790
4818
|
fit?: "scale-down" | "contain" | "pad" | "squeeze" | "cover" | "crop";
|
|
4791
4819
|
gravity?:
|
|
4792
4820
|
| "left"
|
|
@@ -4836,7 +4864,7 @@ export type Transform = {
|
|
|
4836
4864
|
};
|
|
4837
4865
|
zoom?: number;
|
|
4838
4866
|
};
|
|
4839
|
-
export type
|
|
4867
|
+
export type ImageOutputOptions = {
|
|
4840
4868
|
format:
|
|
4841
4869
|
| "image/jpeg"
|
|
4842
4870
|
| "image/png"
|
|
@@ -4854,7 +4882,7 @@ export interface ImagesBinding {
|
|
|
4854
4882
|
* @throws {@link ImagesError} with code 9412 if input is not an image
|
|
4855
4883
|
* @param stream The image bytes
|
|
4856
4884
|
*/
|
|
4857
|
-
info(stream: ReadableStream<Uint8Array>): Promise<
|
|
4885
|
+
info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
|
|
4858
4886
|
/**
|
|
4859
4887
|
* Begin applying a series of transformations to an image
|
|
4860
4888
|
* @param stream The image bytes
|
|
@@ -4868,15 +4896,15 @@ export interface ImageTransformer {
|
|
|
4868
4896
|
* You can then apply more transformations or retrieve the output.
|
|
4869
4897
|
* @param transform
|
|
4870
4898
|
*/
|
|
4871
|
-
transform(transform:
|
|
4899
|
+
transform(transform: ImageTransform): ImageTransformer;
|
|
4872
4900
|
/**
|
|
4873
4901
|
* Retrieve the image that results from applying the transforms to the
|
|
4874
4902
|
* provided input
|
|
4875
4903
|
* @param options Options that apply to the output e.g. output format
|
|
4876
4904
|
*/
|
|
4877
|
-
output(options:
|
|
4905
|
+
output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
|
|
4878
4906
|
}
|
|
4879
|
-
export interface
|
|
4907
|
+
export interface ImageTransformationResult {
|
|
4880
4908
|
/**
|
|
4881
4909
|
* The image as a response, ready to store in cache or return to users
|
|
4882
4910
|
*/
|
|
@@ -5022,7 +5050,7 @@ export declare namespace Rpc {
|
|
|
5022
5050
|
export const __RPC_TARGET_BRAND: "__RPC_TARGET_BRAND";
|
|
5023
5051
|
export const __WORKER_ENTRYPOINT_BRAND: "__WORKER_ENTRYPOINT_BRAND";
|
|
5024
5052
|
export const __DURABLE_OBJECT_BRAND: "__DURABLE_OBJECT_BRAND";
|
|
5025
|
-
export const
|
|
5053
|
+
export const __WORKFLOW_ENTRYPOINT_BRAND: "__WORKFLOW_ENTRYPOINT_BRAND";
|
|
5026
5054
|
export interface RpcTargetBranded {
|
|
5027
5055
|
[__RPC_TARGET_BRAND]: never;
|
|
5028
5056
|
}
|
|
@@ -5032,13 +5060,13 @@ export declare namespace Rpc {
|
|
|
5032
5060
|
export interface DurableObjectBranded {
|
|
5033
5061
|
[__DURABLE_OBJECT_BRAND]: never;
|
|
5034
5062
|
}
|
|
5035
|
-
export interface
|
|
5036
|
-
[
|
|
5063
|
+
export interface WorkflowEntrypointBranded {
|
|
5064
|
+
[__WORKFLOW_ENTRYPOINT_BRAND]: never;
|
|
5037
5065
|
}
|
|
5038
5066
|
export type EntrypointBranded =
|
|
5039
5067
|
| WorkerEntrypointBranded
|
|
5040
5068
|
| DurableObjectBranded
|
|
5041
|
-
|
|
|
5069
|
+
| WorkflowEntrypointBranded;
|
|
5042
5070
|
// Types that can be used through `Stub`s
|
|
5043
5071
|
export type Stubable = RpcTargetBranded | ((...args: any[]) => any);
|
|
5044
5072
|
// Types that can be passed over RPC
|