@cloudflare/workers-types 4.20260304.0 → 4.20260305.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 +96 -0
- package/2021-11-03/index.ts +96 -0
- package/2022-01-31/index.d.ts +96 -0
- package/2022-01-31/index.ts +96 -0
- package/2022-03-21/index.d.ts +96 -0
- package/2022-03-21/index.ts +96 -0
- package/2022-08-04/index.d.ts +96 -0
- package/2022-08-04/index.ts +96 -0
- package/2022-10-31/index.d.ts +96 -0
- package/2022-10-31/index.ts +96 -0
- package/2022-11-30/index.d.ts +96 -0
- package/2022-11-30/index.ts +96 -0
- package/2023-03-01/index.d.ts +96 -0
- package/2023-03-01/index.ts +96 -0
- package/2023-07-01/index.d.ts +96 -0
- package/2023-07-01/index.ts +96 -0
- package/experimental/index.d.ts +122 -6
- package/experimental/index.ts +122 -6
- package/index.d.ts +96 -0
- package/index.ts +96 -0
- package/latest/index.d.ts +96 -0
- package/latest/index.ts +96 -0
- package/oldest/index.d.ts +96 -0
- package/oldest/index.ts +96 -0
- package/package.json +1 -1
package/2021-11-03/index.d.ts
CHANGED
|
@@ -3493,6 +3493,12 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3493
3493
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3494
3494
|
*/
|
|
3495
3495
|
readonly extensions: string | null;
|
|
3496
|
+
/**
|
|
3497
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3498
|
+
*
|
|
3499
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3500
|
+
*/
|
|
3501
|
+
binaryType: "blob" | "arraybuffer";
|
|
3496
3502
|
}
|
|
3497
3503
|
declare const WebSocketPair: {
|
|
3498
3504
|
new (): {
|
|
@@ -3741,6 +3747,12 @@ declare abstract class Performance {
|
|
|
3741
3747
|
get timeOrigin(): number;
|
|
3742
3748
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3743
3749
|
now(): number;
|
|
3750
|
+
/**
|
|
3751
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3752
|
+
*
|
|
3753
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3754
|
+
*/
|
|
3755
|
+
toJSON(): object;
|
|
3744
3756
|
}
|
|
3745
3757
|
// AI Search V2 API Error Interfaces
|
|
3746
3758
|
interface AiSearchInternalError extends Error {}
|
|
@@ -11149,6 +11161,86 @@ type ImageOutputOptions = {
|
|
|
11149
11161
|
background?: string;
|
|
11150
11162
|
anim?: boolean;
|
|
11151
11163
|
};
|
|
11164
|
+
interface ImageMetadata {
|
|
11165
|
+
id: string;
|
|
11166
|
+
filename?: string;
|
|
11167
|
+
uploaded?: string;
|
|
11168
|
+
requireSignedURLs: boolean;
|
|
11169
|
+
meta?: Record<string, unknown>;
|
|
11170
|
+
variants: string[];
|
|
11171
|
+
draft?: boolean;
|
|
11172
|
+
creator?: string;
|
|
11173
|
+
}
|
|
11174
|
+
interface ImageUploadOptions {
|
|
11175
|
+
id?: string;
|
|
11176
|
+
filename?: string;
|
|
11177
|
+
requireSignedURLs?: boolean;
|
|
11178
|
+
metadata?: Record<string, unknown>;
|
|
11179
|
+
creator?: string;
|
|
11180
|
+
encoding?: "base64";
|
|
11181
|
+
}
|
|
11182
|
+
interface ImageUpdateOptions {
|
|
11183
|
+
requireSignedURLs?: boolean;
|
|
11184
|
+
metadata?: Record<string, unknown>;
|
|
11185
|
+
creator?: string;
|
|
11186
|
+
}
|
|
11187
|
+
interface ImageListOptions {
|
|
11188
|
+
limit?: number;
|
|
11189
|
+
cursor?: string;
|
|
11190
|
+
sortOrder?: "asc" | "desc";
|
|
11191
|
+
creator?: string;
|
|
11192
|
+
}
|
|
11193
|
+
interface ImageList {
|
|
11194
|
+
images: ImageMetadata[];
|
|
11195
|
+
cursor?: string;
|
|
11196
|
+
listComplete: boolean;
|
|
11197
|
+
}
|
|
11198
|
+
interface HostedImagesBinding {
|
|
11199
|
+
/**
|
|
11200
|
+
* Get detailed metadata for a hosted image
|
|
11201
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11202
|
+
* @returns Image metadata, or null if not found
|
|
11203
|
+
*/
|
|
11204
|
+
details(imageId: string): Promise<ImageMetadata | null>;
|
|
11205
|
+
/**
|
|
11206
|
+
* Get the raw image data for a hosted image
|
|
11207
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11208
|
+
* @returns ReadableStream of image bytes, or null if not found
|
|
11209
|
+
*/
|
|
11210
|
+
image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
|
|
11211
|
+
/**
|
|
11212
|
+
* Upload a new hosted image
|
|
11213
|
+
* @param image The image file to upload
|
|
11214
|
+
* @param options Upload configuration
|
|
11215
|
+
* @returns Metadata for the uploaded image
|
|
11216
|
+
* @throws {@link ImagesError} if upload fails
|
|
11217
|
+
*/
|
|
11218
|
+
upload(
|
|
11219
|
+
image: ReadableStream<Uint8Array> | ArrayBuffer,
|
|
11220
|
+
options?: ImageUploadOptions,
|
|
11221
|
+
): Promise<ImageMetadata>;
|
|
11222
|
+
/**
|
|
11223
|
+
* Update hosted image metadata
|
|
11224
|
+
* @param imageId The ID of the image
|
|
11225
|
+
* @param options Properties to update
|
|
11226
|
+
* @returns Updated image metadata
|
|
11227
|
+
* @throws {@link ImagesError} if update fails
|
|
11228
|
+
*/
|
|
11229
|
+
update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
|
|
11230
|
+
/**
|
|
11231
|
+
* Delete a hosted image
|
|
11232
|
+
* @param imageId The ID of the image
|
|
11233
|
+
* @returns True if deleted, false if not found
|
|
11234
|
+
*/
|
|
11235
|
+
delete(imageId: string): Promise<boolean>;
|
|
11236
|
+
/**
|
|
11237
|
+
* List hosted images with pagination
|
|
11238
|
+
* @param options List configuration
|
|
11239
|
+
* @returns List of images with pagination info
|
|
11240
|
+
* @throws {@link ImagesError} if list fails
|
|
11241
|
+
*/
|
|
11242
|
+
list(options?: ImageListOptions): Promise<ImageList>;
|
|
11243
|
+
}
|
|
11152
11244
|
interface ImagesBinding {
|
|
11153
11245
|
/**
|
|
11154
11246
|
* Get image metadata (type, width and height)
|
|
@@ -11168,6 +11260,10 @@ interface ImagesBinding {
|
|
|
11168
11260
|
stream: ReadableStream<Uint8Array>,
|
|
11169
11261
|
options?: ImageInputOptions,
|
|
11170
11262
|
): ImageTransformer;
|
|
11263
|
+
/**
|
|
11264
|
+
* Access hosted images CRUD operations
|
|
11265
|
+
*/
|
|
11266
|
+
readonly hosted: HostedImagesBinding;
|
|
11171
11267
|
}
|
|
11172
11268
|
interface ImageTransformer {
|
|
11173
11269
|
/**
|
package/2021-11-03/index.ts
CHANGED
|
@@ -3502,6 +3502,12 @@ export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3502
3502
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3503
3503
|
*/
|
|
3504
3504
|
readonly extensions: string | null;
|
|
3505
|
+
/**
|
|
3506
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3507
|
+
*
|
|
3508
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3509
|
+
*/
|
|
3510
|
+
binaryType: "blob" | "arraybuffer";
|
|
3505
3511
|
}
|
|
3506
3512
|
export declare const WebSocketPair: {
|
|
3507
3513
|
new (): {
|
|
@@ -3750,6 +3756,12 @@ export declare abstract class Performance {
|
|
|
3750
3756
|
get timeOrigin(): number;
|
|
3751
3757
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3752
3758
|
now(): number;
|
|
3759
|
+
/**
|
|
3760
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3761
|
+
*
|
|
3762
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3763
|
+
*/
|
|
3764
|
+
toJSON(): object;
|
|
3753
3765
|
}
|
|
3754
3766
|
// AI Search V2 API Error Interfaces
|
|
3755
3767
|
export interface AiSearchInternalError extends Error {}
|
|
@@ -11166,6 +11178,86 @@ export type ImageOutputOptions = {
|
|
|
11166
11178
|
background?: string;
|
|
11167
11179
|
anim?: boolean;
|
|
11168
11180
|
};
|
|
11181
|
+
export interface ImageMetadata {
|
|
11182
|
+
id: string;
|
|
11183
|
+
filename?: string;
|
|
11184
|
+
uploaded?: string;
|
|
11185
|
+
requireSignedURLs: boolean;
|
|
11186
|
+
meta?: Record<string, unknown>;
|
|
11187
|
+
variants: string[];
|
|
11188
|
+
draft?: boolean;
|
|
11189
|
+
creator?: string;
|
|
11190
|
+
}
|
|
11191
|
+
export interface ImageUploadOptions {
|
|
11192
|
+
id?: string;
|
|
11193
|
+
filename?: string;
|
|
11194
|
+
requireSignedURLs?: boolean;
|
|
11195
|
+
metadata?: Record<string, unknown>;
|
|
11196
|
+
creator?: string;
|
|
11197
|
+
encoding?: "base64";
|
|
11198
|
+
}
|
|
11199
|
+
export interface ImageUpdateOptions {
|
|
11200
|
+
requireSignedURLs?: boolean;
|
|
11201
|
+
metadata?: Record<string, unknown>;
|
|
11202
|
+
creator?: string;
|
|
11203
|
+
}
|
|
11204
|
+
export interface ImageListOptions {
|
|
11205
|
+
limit?: number;
|
|
11206
|
+
cursor?: string;
|
|
11207
|
+
sortOrder?: "asc" | "desc";
|
|
11208
|
+
creator?: string;
|
|
11209
|
+
}
|
|
11210
|
+
export interface ImageList {
|
|
11211
|
+
images: ImageMetadata[];
|
|
11212
|
+
cursor?: string;
|
|
11213
|
+
listComplete: boolean;
|
|
11214
|
+
}
|
|
11215
|
+
export interface HostedImagesBinding {
|
|
11216
|
+
/**
|
|
11217
|
+
* Get detailed metadata for a hosted image
|
|
11218
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11219
|
+
* @returns Image metadata, or null if not found
|
|
11220
|
+
*/
|
|
11221
|
+
details(imageId: string): Promise<ImageMetadata | null>;
|
|
11222
|
+
/**
|
|
11223
|
+
* Get the raw image data for a hosted image
|
|
11224
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11225
|
+
* @returns ReadableStream of image bytes, or null if not found
|
|
11226
|
+
*/
|
|
11227
|
+
image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
|
|
11228
|
+
/**
|
|
11229
|
+
* Upload a new hosted image
|
|
11230
|
+
* @param image The image file to upload
|
|
11231
|
+
* @param options Upload configuration
|
|
11232
|
+
* @returns Metadata for the uploaded image
|
|
11233
|
+
* @throws {@link ImagesError} if upload fails
|
|
11234
|
+
*/
|
|
11235
|
+
upload(
|
|
11236
|
+
image: ReadableStream<Uint8Array> | ArrayBuffer,
|
|
11237
|
+
options?: ImageUploadOptions,
|
|
11238
|
+
): Promise<ImageMetadata>;
|
|
11239
|
+
/**
|
|
11240
|
+
* Update hosted image metadata
|
|
11241
|
+
* @param imageId The ID of the image
|
|
11242
|
+
* @param options Properties to update
|
|
11243
|
+
* @returns Updated image metadata
|
|
11244
|
+
* @throws {@link ImagesError} if update fails
|
|
11245
|
+
*/
|
|
11246
|
+
update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
|
|
11247
|
+
/**
|
|
11248
|
+
* Delete a hosted image
|
|
11249
|
+
* @param imageId The ID of the image
|
|
11250
|
+
* @returns True if deleted, false if not found
|
|
11251
|
+
*/
|
|
11252
|
+
delete(imageId: string): Promise<boolean>;
|
|
11253
|
+
/**
|
|
11254
|
+
* List hosted images with pagination
|
|
11255
|
+
* @param options List configuration
|
|
11256
|
+
* @returns List of images with pagination info
|
|
11257
|
+
* @throws {@link ImagesError} if list fails
|
|
11258
|
+
*/
|
|
11259
|
+
list(options?: ImageListOptions): Promise<ImageList>;
|
|
11260
|
+
}
|
|
11169
11261
|
export interface ImagesBinding {
|
|
11170
11262
|
/**
|
|
11171
11263
|
* Get image metadata (type, width and height)
|
|
@@ -11185,6 +11277,10 @@ export interface ImagesBinding {
|
|
|
11185
11277
|
stream: ReadableStream<Uint8Array>,
|
|
11186
11278
|
options?: ImageInputOptions,
|
|
11187
11279
|
): ImageTransformer;
|
|
11280
|
+
/**
|
|
11281
|
+
* Access hosted images CRUD operations
|
|
11282
|
+
*/
|
|
11283
|
+
readonly hosted: HostedImagesBinding;
|
|
11188
11284
|
}
|
|
11189
11285
|
export interface ImageTransformer {
|
|
11190
11286
|
/**
|
package/2022-01-31/index.d.ts
CHANGED
|
@@ -3560,6 +3560,12 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3560
3560
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3561
3561
|
*/
|
|
3562
3562
|
extensions: string | null;
|
|
3563
|
+
/**
|
|
3564
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3565
|
+
*
|
|
3566
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3567
|
+
*/
|
|
3568
|
+
binaryType: "blob" | "arraybuffer";
|
|
3563
3569
|
}
|
|
3564
3570
|
declare const WebSocketPair: {
|
|
3565
3571
|
new (): {
|
|
@@ -3808,6 +3814,12 @@ declare abstract class Performance {
|
|
|
3808
3814
|
get timeOrigin(): number;
|
|
3809
3815
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3810
3816
|
now(): number;
|
|
3817
|
+
/**
|
|
3818
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3819
|
+
*
|
|
3820
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3821
|
+
*/
|
|
3822
|
+
toJSON(): object;
|
|
3811
3823
|
}
|
|
3812
3824
|
// AI Search V2 API Error Interfaces
|
|
3813
3825
|
interface AiSearchInternalError extends Error {}
|
|
@@ -11216,6 +11228,86 @@ type ImageOutputOptions = {
|
|
|
11216
11228
|
background?: string;
|
|
11217
11229
|
anim?: boolean;
|
|
11218
11230
|
};
|
|
11231
|
+
interface ImageMetadata {
|
|
11232
|
+
id: string;
|
|
11233
|
+
filename?: string;
|
|
11234
|
+
uploaded?: string;
|
|
11235
|
+
requireSignedURLs: boolean;
|
|
11236
|
+
meta?: Record<string, unknown>;
|
|
11237
|
+
variants: string[];
|
|
11238
|
+
draft?: boolean;
|
|
11239
|
+
creator?: string;
|
|
11240
|
+
}
|
|
11241
|
+
interface ImageUploadOptions {
|
|
11242
|
+
id?: string;
|
|
11243
|
+
filename?: string;
|
|
11244
|
+
requireSignedURLs?: boolean;
|
|
11245
|
+
metadata?: Record<string, unknown>;
|
|
11246
|
+
creator?: string;
|
|
11247
|
+
encoding?: "base64";
|
|
11248
|
+
}
|
|
11249
|
+
interface ImageUpdateOptions {
|
|
11250
|
+
requireSignedURLs?: boolean;
|
|
11251
|
+
metadata?: Record<string, unknown>;
|
|
11252
|
+
creator?: string;
|
|
11253
|
+
}
|
|
11254
|
+
interface ImageListOptions {
|
|
11255
|
+
limit?: number;
|
|
11256
|
+
cursor?: string;
|
|
11257
|
+
sortOrder?: "asc" | "desc";
|
|
11258
|
+
creator?: string;
|
|
11259
|
+
}
|
|
11260
|
+
interface ImageList {
|
|
11261
|
+
images: ImageMetadata[];
|
|
11262
|
+
cursor?: string;
|
|
11263
|
+
listComplete: boolean;
|
|
11264
|
+
}
|
|
11265
|
+
interface HostedImagesBinding {
|
|
11266
|
+
/**
|
|
11267
|
+
* Get detailed metadata for a hosted image
|
|
11268
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11269
|
+
* @returns Image metadata, or null if not found
|
|
11270
|
+
*/
|
|
11271
|
+
details(imageId: string): Promise<ImageMetadata | null>;
|
|
11272
|
+
/**
|
|
11273
|
+
* Get the raw image data for a hosted image
|
|
11274
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11275
|
+
* @returns ReadableStream of image bytes, or null if not found
|
|
11276
|
+
*/
|
|
11277
|
+
image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
|
|
11278
|
+
/**
|
|
11279
|
+
* Upload a new hosted image
|
|
11280
|
+
* @param image The image file to upload
|
|
11281
|
+
* @param options Upload configuration
|
|
11282
|
+
* @returns Metadata for the uploaded image
|
|
11283
|
+
* @throws {@link ImagesError} if upload fails
|
|
11284
|
+
*/
|
|
11285
|
+
upload(
|
|
11286
|
+
image: ReadableStream<Uint8Array> | ArrayBuffer,
|
|
11287
|
+
options?: ImageUploadOptions,
|
|
11288
|
+
): Promise<ImageMetadata>;
|
|
11289
|
+
/**
|
|
11290
|
+
* Update hosted image metadata
|
|
11291
|
+
* @param imageId The ID of the image
|
|
11292
|
+
* @param options Properties to update
|
|
11293
|
+
* @returns Updated image metadata
|
|
11294
|
+
* @throws {@link ImagesError} if update fails
|
|
11295
|
+
*/
|
|
11296
|
+
update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
|
|
11297
|
+
/**
|
|
11298
|
+
* Delete a hosted image
|
|
11299
|
+
* @param imageId The ID of the image
|
|
11300
|
+
* @returns True if deleted, false if not found
|
|
11301
|
+
*/
|
|
11302
|
+
delete(imageId: string): Promise<boolean>;
|
|
11303
|
+
/**
|
|
11304
|
+
* List hosted images with pagination
|
|
11305
|
+
* @param options List configuration
|
|
11306
|
+
* @returns List of images with pagination info
|
|
11307
|
+
* @throws {@link ImagesError} if list fails
|
|
11308
|
+
*/
|
|
11309
|
+
list(options?: ImageListOptions): Promise<ImageList>;
|
|
11310
|
+
}
|
|
11219
11311
|
interface ImagesBinding {
|
|
11220
11312
|
/**
|
|
11221
11313
|
* Get image metadata (type, width and height)
|
|
@@ -11235,6 +11327,10 @@ interface ImagesBinding {
|
|
|
11235
11327
|
stream: ReadableStream<Uint8Array>,
|
|
11236
11328
|
options?: ImageInputOptions,
|
|
11237
11329
|
): ImageTransformer;
|
|
11330
|
+
/**
|
|
11331
|
+
* Access hosted images CRUD operations
|
|
11332
|
+
*/
|
|
11333
|
+
readonly hosted: HostedImagesBinding;
|
|
11238
11334
|
}
|
|
11239
11335
|
interface ImageTransformer {
|
|
11240
11336
|
/**
|
package/2022-01-31/index.ts
CHANGED
|
@@ -3569,6 +3569,12 @@ export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3569
3569
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3570
3570
|
*/
|
|
3571
3571
|
extensions: string | null;
|
|
3572
|
+
/**
|
|
3573
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3574
|
+
*
|
|
3575
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3576
|
+
*/
|
|
3577
|
+
binaryType: "blob" | "arraybuffer";
|
|
3572
3578
|
}
|
|
3573
3579
|
export declare const WebSocketPair: {
|
|
3574
3580
|
new (): {
|
|
@@ -3817,6 +3823,12 @@ export declare abstract class Performance {
|
|
|
3817
3823
|
get timeOrigin(): number;
|
|
3818
3824
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3819
3825
|
now(): number;
|
|
3826
|
+
/**
|
|
3827
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3828
|
+
*
|
|
3829
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3830
|
+
*/
|
|
3831
|
+
toJSON(): object;
|
|
3820
3832
|
}
|
|
3821
3833
|
// AI Search V2 API Error Interfaces
|
|
3822
3834
|
export interface AiSearchInternalError extends Error {}
|
|
@@ -11233,6 +11245,86 @@ export type ImageOutputOptions = {
|
|
|
11233
11245
|
background?: string;
|
|
11234
11246
|
anim?: boolean;
|
|
11235
11247
|
};
|
|
11248
|
+
export interface ImageMetadata {
|
|
11249
|
+
id: string;
|
|
11250
|
+
filename?: string;
|
|
11251
|
+
uploaded?: string;
|
|
11252
|
+
requireSignedURLs: boolean;
|
|
11253
|
+
meta?: Record<string, unknown>;
|
|
11254
|
+
variants: string[];
|
|
11255
|
+
draft?: boolean;
|
|
11256
|
+
creator?: string;
|
|
11257
|
+
}
|
|
11258
|
+
export interface ImageUploadOptions {
|
|
11259
|
+
id?: string;
|
|
11260
|
+
filename?: string;
|
|
11261
|
+
requireSignedURLs?: boolean;
|
|
11262
|
+
metadata?: Record<string, unknown>;
|
|
11263
|
+
creator?: string;
|
|
11264
|
+
encoding?: "base64";
|
|
11265
|
+
}
|
|
11266
|
+
export interface ImageUpdateOptions {
|
|
11267
|
+
requireSignedURLs?: boolean;
|
|
11268
|
+
metadata?: Record<string, unknown>;
|
|
11269
|
+
creator?: string;
|
|
11270
|
+
}
|
|
11271
|
+
export interface ImageListOptions {
|
|
11272
|
+
limit?: number;
|
|
11273
|
+
cursor?: string;
|
|
11274
|
+
sortOrder?: "asc" | "desc";
|
|
11275
|
+
creator?: string;
|
|
11276
|
+
}
|
|
11277
|
+
export interface ImageList {
|
|
11278
|
+
images: ImageMetadata[];
|
|
11279
|
+
cursor?: string;
|
|
11280
|
+
listComplete: boolean;
|
|
11281
|
+
}
|
|
11282
|
+
export interface HostedImagesBinding {
|
|
11283
|
+
/**
|
|
11284
|
+
* Get detailed metadata for a hosted image
|
|
11285
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11286
|
+
* @returns Image metadata, or null if not found
|
|
11287
|
+
*/
|
|
11288
|
+
details(imageId: string): Promise<ImageMetadata | null>;
|
|
11289
|
+
/**
|
|
11290
|
+
* Get the raw image data for a hosted image
|
|
11291
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11292
|
+
* @returns ReadableStream of image bytes, or null if not found
|
|
11293
|
+
*/
|
|
11294
|
+
image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
|
|
11295
|
+
/**
|
|
11296
|
+
* Upload a new hosted image
|
|
11297
|
+
* @param image The image file to upload
|
|
11298
|
+
* @param options Upload configuration
|
|
11299
|
+
* @returns Metadata for the uploaded image
|
|
11300
|
+
* @throws {@link ImagesError} if upload fails
|
|
11301
|
+
*/
|
|
11302
|
+
upload(
|
|
11303
|
+
image: ReadableStream<Uint8Array> | ArrayBuffer,
|
|
11304
|
+
options?: ImageUploadOptions,
|
|
11305
|
+
): Promise<ImageMetadata>;
|
|
11306
|
+
/**
|
|
11307
|
+
* Update hosted image metadata
|
|
11308
|
+
* @param imageId The ID of the image
|
|
11309
|
+
* @param options Properties to update
|
|
11310
|
+
* @returns Updated image metadata
|
|
11311
|
+
* @throws {@link ImagesError} if update fails
|
|
11312
|
+
*/
|
|
11313
|
+
update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
|
|
11314
|
+
/**
|
|
11315
|
+
* Delete a hosted image
|
|
11316
|
+
* @param imageId The ID of the image
|
|
11317
|
+
* @returns True if deleted, false if not found
|
|
11318
|
+
*/
|
|
11319
|
+
delete(imageId: string): Promise<boolean>;
|
|
11320
|
+
/**
|
|
11321
|
+
* List hosted images with pagination
|
|
11322
|
+
* @param options List configuration
|
|
11323
|
+
* @returns List of images with pagination info
|
|
11324
|
+
* @throws {@link ImagesError} if list fails
|
|
11325
|
+
*/
|
|
11326
|
+
list(options?: ImageListOptions): Promise<ImageList>;
|
|
11327
|
+
}
|
|
11236
11328
|
export interface ImagesBinding {
|
|
11237
11329
|
/**
|
|
11238
11330
|
* Get image metadata (type, width and height)
|
|
@@ -11252,6 +11344,10 @@ export interface ImagesBinding {
|
|
|
11252
11344
|
stream: ReadableStream<Uint8Array>,
|
|
11253
11345
|
options?: ImageInputOptions,
|
|
11254
11346
|
): ImageTransformer;
|
|
11347
|
+
/**
|
|
11348
|
+
* Access hosted images CRUD operations
|
|
11349
|
+
*/
|
|
11350
|
+
readonly hosted: HostedImagesBinding;
|
|
11255
11351
|
}
|
|
11256
11352
|
export interface ImageTransformer {
|
|
11257
11353
|
/**
|
package/2022-03-21/index.d.ts
CHANGED
|
@@ -3568,6 +3568,12 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
3568
3568
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3569
3569
|
*/
|
|
3570
3570
|
extensions: string | null;
|
|
3571
|
+
/**
|
|
3572
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3573
|
+
*
|
|
3574
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3575
|
+
*/
|
|
3576
|
+
binaryType: "blob" | "arraybuffer";
|
|
3571
3577
|
}
|
|
3572
3578
|
declare const WebSocketPair: {
|
|
3573
3579
|
new (): {
|
|
@@ -3816,6 +3822,12 @@ declare abstract class Performance {
|
|
|
3816
3822
|
get timeOrigin(): number;
|
|
3817
3823
|
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
3818
3824
|
now(): number;
|
|
3825
|
+
/**
|
|
3826
|
+
* The **`toJSON()`** method of the Performance interface is a Serialization; it returns a JSON representation of the Performance object.
|
|
3827
|
+
*
|
|
3828
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
3829
|
+
*/
|
|
3830
|
+
toJSON(): object;
|
|
3819
3831
|
}
|
|
3820
3832
|
// AI Search V2 API Error Interfaces
|
|
3821
3833
|
interface AiSearchInternalError extends Error {}
|
|
@@ -11224,6 +11236,86 @@ type ImageOutputOptions = {
|
|
|
11224
11236
|
background?: string;
|
|
11225
11237
|
anim?: boolean;
|
|
11226
11238
|
};
|
|
11239
|
+
interface ImageMetadata {
|
|
11240
|
+
id: string;
|
|
11241
|
+
filename?: string;
|
|
11242
|
+
uploaded?: string;
|
|
11243
|
+
requireSignedURLs: boolean;
|
|
11244
|
+
meta?: Record<string, unknown>;
|
|
11245
|
+
variants: string[];
|
|
11246
|
+
draft?: boolean;
|
|
11247
|
+
creator?: string;
|
|
11248
|
+
}
|
|
11249
|
+
interface ImageUploadOptions {
|
|
11250
|
+
id?: string;
|
|
11251
|
+
filename?: string;
|
|
11252
|
+
requireSignedURLs?: boolean;
|
|
11253
|
+
metadata?: Record<string, unknown>;
|
|
11254
|
+
creator?: string;
|
|
11255
|
+
encoding?: "base64";
|
|
11256
|
+
}
|
|
11257
|
+
interface ImageUpdateOptions {
|
|
11258
|
+
requireSignedURLs?: boolean;
|
|
11259
|
+
metadata?: Record<string, unknown>;
|
|
11260
|
+
creator?: string;
|
|
11261
|
+
}
|
|
11262
|
+
interface ImageListOptions {
|
|
11263
|
+
limit?: number;
|
|
11264
|
+
cursor?: string;
|
|
11265
|
+
sortOrder?: "asc" | "desc";
|
|
11266
|
+
creator?: string;
|
|
11267
|
+
}
|
|
11268
|
+
interface ImageList {
|
|
11269
|
+
images: ImageMetadata[];
|
|
11270
|
+
cursor?: string;
|
|
11271
|
+
listComplete: boolean;
|
|
11272
|
+
}
|
|
11273
|
+
interface HostedImagesBinding {
|
|
11274
|
+
/**
|
|
11275
|
+
* Get detailed metadata for a hosted image
|
|
11276
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11277
|
+
* @returns Image metadata, or null if not found
|
|
11278
|
+
*/
|
|
11279
|
+
details(imageId: string): Promise<ImageMetadata | null>;
|
|
11280
|
+
/**
|
|
11281
|
+
* Get the raw image data for a hosted image
|
|
11282
|
+
* @param imageId The ID of the image (UUID or custom ID)
|
|
11283
|
+
* @returns ReadableStream of image bytes, or null if not found
|
|
11284
|
+
*/
|
|
11285
|
+
image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
|
|
11286
|
+
/**
|
|
11287
|
+
* Upload a new hosted image
|
|
11288
|
+
* @param image The image file to upload
|
|
11289
|
+
* @param options Upload configuration
|
|
11290
|
+
* @returns Metadata for the uploaded image
|
|
11291
|
+
* @throws {@link ImagesError} if upload fails
|
|
11292
|
+
*/
|
|
11293
|
+
upload(
|
|
11294
|
+
image: ReadableStream<Uint8Array> | ArrayBuffer,
|
|
11295
|
+
options?: ImageUploadOptions,
|
|
11296
|
+
): Promise<ImageMetadata>;
|
|
11297
|
+
/**
|
|
11298
|
+
* Update hosted image metadata
|
|
11299
|
+
* @param imageId The ID of the image
|
|
11300
|
+
* @param options Properties to update
|
|
11301
|
+
* @returns Updated image metadata
|
|
11302
|
+
* @throws {@link ImagesError} if update fails
|
|
11303
|
+
*/
|
|
11304
|
+
update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
|
|
11305
|
+
/**
|
|
11306
|
+
* Delete a hosted image
|
|
11307
|
+
* @param imageId The ID of the image
|
|
11308
|
+
* @returns True if deleted, false if not found
|
|
11309
|
+
*/
|
|
11310
|
+
delete(imageId: string): Promise<boolean>;
|
|
11311
|
+
/**
|
|
11312
|
+
* List hosted images with pagination
|
|
11313
|
+
* @param options List configuration
|
|
11314
|
+
* @returns List of images with pagination info
|
|
11315
|
+
* @throws {@link ImagesError} if list fails
|
|
11316
|
+
*/
|
|
11317
|
+
list(options?: ImageListOptions): Promise<ImageList>;
|
|
11318
|
+
}
|
|
11227
11319
|
interface ImagesBinding {
|
|
11228
11320
|
/**
|
|
11229
11321
|
* Get image metadata (type, width and height)
|
|
@@ -11243,6 +11335,10 @@ interface ImagesBinding {
|
|
|
11243
11335
|
stream: ReadableStream<Uint8Array>,
|
|
11244
11336
|
options?: ImageInputOptions,
|
|
11245
11337
|
): ImageTransformer;
|
|
11338
|
+
/**
|
|
11339
|
+
* Access hosted images CRUD operations
|
|
11340
|
+
*/
|
|
11341
|
+
readonly hosted: HostedImagesBinding;
|
|
11246
11342
|
}
|
|
11247
11343
|
interface ImageTransformer {
|
|
11248
11344
|
/**
|