@cloudflare/workers-types 4.20260331.1 → 4.20260402.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.
@@ -3758,12 +3758,43 @@ interface Container {
3758
3758
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3759
3759
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3760
3760
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3761
+ snapshotDirectory(
3762
+ options: ContainerDirectorySnapshotOptions,
3763
+ ): Promise<ContainerDirectorySnapshot>;
3764
+ snapshotContainer(
3765
+ options: ContainerSnapshotOptions,
3766
+ ): Promise<ContainerSnapshot>;
3767
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3768
+ }
3769
+ interface ContainerDirectorySnapshot {
3770
+ id: string;
3771
+ size: number;
3772
+ dir: string;
3773
+ name?: string;
3774
+ }
3775
+ interface ContainerDirectorySnapshotOptions {
3776
+ dir: string;
3777
+ name?: string;
3778
+ }
3779
+ interface ContainerDirectorySnapshotRestoreParams {
3780
+ snapshot: ContainerDirectorySnapshot;
3781
+ mountPoint?: string;
3782
+ }
3783
+ interface ContainerSnapshot {
3784
+ id: string;
3785
+ size: number;
3786
+ name?: string;
3787
+ }
3788
+ interface ContainerSnapshotOptions {
3789
+ name?: string;
3761
3790
  }
3762
3791
  interface ContainerStartupOptions {
3763
3792
  entrypoint?: string[];
3764
3793
  enableInternet: boolean;
3765
3794
  env?: Record<string, string>;
3766
3795
  labels?: Record<string, string>;
3796
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3797
+ containerSnapshot?: ContainerSnapshot;
3767
3798
  }
3768
3799
  /**
3769
3800
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12155,19 +12186,37 @@ interface ImageList {
12155
12186
  cursor?: string;
12156
12187
  listComplete: boolean;
12157
12188
  }
12158
- interface HostedImagesBinding {
12189
+ interface ImageHandle {
12159
12190
  /**
12160
- * Get detailed metadata for a hosted image
12161
- * @param imageId The ID of the image (UUID or custom ID)
12191
+ * Get metadata for a hosted image
12162
12192
  * @returns Image metadata, or null if not found
12163
12193
  */
12164
- details(imageId: string): Promise<ImageMetadata | null>;
12194
+ details(): Promise<ImageMetadata | null>;
12165
12195
  /**
12166
12196
  * Get the raw image data for a hosted image
12167
- * @param imageId The ID of the image (UUID or custom ID)
12168
12197
  * @returns ReadableStream of image bytes, or null if not found
12169
12198
  */
12170
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12199
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12200
+ /**
12201
+ * Update hosted image metadata
12202
+ * @param options Properties to update
12203
+ * @returns Updated image metadata
12204
+ * @throws {@link ImagesError} if update fails
12205
+ */
12206
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12207
+ /**
12208
+ * Delete a hosted image
12209
+ * @returns True if deleted, false if not found
12210
+ */
12211
+ delete(): Promise<boolean>;
12212
+ }
12213
+ interface HostedImagesBinding {
12214
+ /**
12215
+ * Get a handle for a hosted image
12216
+ * @param imageId The ID of the image (UUID or custom ID)
12217
+ * @returns A handle for per-image operations
12218
+ */
12219
+ image(imageId: string): ImageHandle;
12171
12220
  /**
12172
12221
  * Upload a new hosted image
12173
12222
  * @param image The image file to upload
@@ -12179,20 +12228,6 @@ interface HostedImagesBinding {
12179
12228
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12180
12229
  options?: ImageUploadOptions,
12181
12230
  ): Promise<ImageMetadata>;
12182
- /**
12183
- * Update hosted image metadata
12184
- * @param imageId The ID of the image
12185
- * @param options Properties to update
12186
- * @returns Updated image metadata
12187
- * @throws {@link ImagesError} if update fails
12188
- */
12189
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12190
- /**
12191
- * Delete a hosted image
12192
- * @param imageId The ID of the image
12193
- * @returns True if deleted, false if not found
12194
- */
12195
- delete(imageId: string): Promise<boolean>;
12196
12231
  /**
12197
12232
  * List hosted images with pagination
12198
12233
  * @param options List configuration
@@ -13268,14 +13303,13 @@ interface StreamScopedCaptions {
13268
13303
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13269
13304
  * One caption or subtitle file per language is allowed.
13270
13305
  * @param language The BCP 47 language tag for the caption or subtitle.
13271
- * @param file The caption or subtitle file to upload.
13306
+ * @param input The caption or subtitle stream to upload.
13272
13307
  * @returns The created caption entry.
13273
13308
  * @throws {NotFoundError} if the video is not found
13274
13309
  * @throws {BadRequestError} if the language or file is invalid
13275
- * @throws {MaxFileSizeError} if the file size is too large
13276
13310
  * @throws {InternalError} if an unexpected error occurs
13277
13311
  */
13278
- upload(language: string, file: File): Promise<StreamCaption>;
13312
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13279
13313
  /**
13280
13314
  * Generate captions or subtitles for the provided language via AI.
13281
13315
  * @param language The BCP 47 language tag to generate.
@@ -13351,17 +13385,16 @@ interface StreamVideos {
13351
13385
  interface StreamWatermarks {
13352
13386
  /**
13353
13387
  * Generate a new watermark profile
13354
- * @param file The image file to upload
13388
+ * @param input The image stream to upload
13355
13389
  * @param params The watermark creation parameters.
13356
13390
  * @returns The created watermark profile.
13357
13391
  * @throws {BadRequestError} if the parameters are invalid
13358
13392
  * @throws {InvalidURLError} if the URL is invalid
13359
- * @throws {MaxFileSizeError} if the file size is too large
13360
13393
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13361
13394
  * @throws {InternalError} if an unexpected error occurs
13362
13395
  */
13363
13396
  generate(
13364
- file: File,
13397
+ input: ReadableStream,
13365
13398
  params: StreamWatermarkCreateParams,
13366
13399
  ): Promise<StreamWatermark>;
13367
13400
  /**
@@ -13371,7 +13404,6 @@ interface StreamWatermarks {
13371
13404
  * @returns The created watermark profile.
13372
13405
  * @throws {BadRequestError} if the parameters are invalid
13373
13406
  * @throws {InvalidURLError} if the URL is invalid
13374
- * @throws {MaxFileSizeError} if the file size is too large
13375
13407
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13376
13408
  * @throws {InternalError} if an unexpected error occurs
13377
13409
  */
@@ -3764,12 +3764,43 @@ export interface Container {
3764
3764
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3765
3765
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3766
3766
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3767
+ snapshotDirectory(
3768
+ options: ContainerDirectorySnapshotOptions,
3769
+ ): Promise<ContainerDirectorySnapshot>;
3770
+ snapshotContainer(
3771
+ options: ContainerSnapshotOptions,
3772
+ ): Promise<ContainerSnapshot>;
3773
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3774
+ }
3775
+ export interface ContainerDirectorySnapshot {
3776
+ id: string;
3777
+ size: number;
3778
+ dir: string;
3779
+ name?: string;
3780
+ }
3781
+ export interface ContainerDirectorySnapshotOptions {
3782
+ dir: string;
3783
+ name?: string;
3784
+ }
3785
+ export interface ContainerDirectorySnapshotRestoreParams {
3786
+ snapshot: ContainerDirectorySnapshot;
3787
+ mountPoint?: string;
3788
+ }
3789
+ export interface ContainerSnapshot {
3790
+ id: string;
3791
+ size: number;
3792
+ name?: string;
3793
+ }
3794
+ export interface ContainerSnapshotOptions {
3795
+ name?: string;
3767
3796
  }
3768
3797
  export interface ContainerStartupOptions {
3769
3798
  entrypoint?: string[];
3770
3799
  enableInternet: boolean;
3771
3800
  env?: Record<string, string>;
3772
3801
  labels?: Record<string, string>;
3802
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3803
+ containerSnapshot?: ContainerSnapshot;
3773
3804
  }
3774
3805
  /**
3775
3806
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12171,19 +12202,37 @@ export interface ImageList {
12171
12202
  cursor?: string;
12172
12203
  listComplete: boolean;
12173
12204
  }
12174
- export interface HostedImagesBinding {
12205
+ export interface ImageHandle {
12175
12206
  /**
12176
- * Get detailed metadata for a hosted image
12177
- * @param imageId The ID of the image (UUID or custom ID)
12207
+ * Get metadata for a hosted image
12178
12208
  * @returns Image metadata, or null if not found
12179
12209
  */
12180
- details(imageId: string): Promise<ImageMetadata | null>;
12210
+ details(): Promise<ImageMetadata | null>;
12181
12211
  /**
12182
12212
  * Get the raw image data for a hosted image
12183
- * @param imageId The ID of the image (UUID or custom ID)
12184
12213
  * @returns ReadableStream of image bytes, or null if not found
12185
12214
  */
12186
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12215
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12216
+ /**
12217
+ * Update hosted image metadata
12218
+ * @param options Properties to update
12219
+ * @returns Updated image metadata
12220
+ * @throws {@link ImagesError} if update fails
12221
+ */
12222
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12223
+ /**
12224
+ * Delete a hosted image
12225
+ * @returns True if deleted, false if not found
12226
+ */
12227
+ delete(): Promise<boolean>;
12228
+ }
12229
+ export interface HostedImagesBinding {
12230
+ /**
12231
+ * Get a handle for a hosted image
12232
+ * @param imageId The ID of the image (UUID or custom ID)
12233
+ * @returns A handle for per-image operations
12234
+ */
12235
+ image(imageId: string): ImageHandle;
12187
12236
  /**
12188
12237
  * Upload a new hosted image
12189
12238
  * @param image The image file to upload
@@ -12195,20 +12244,6 @@ export interface HostedImagesBinding {
12195
12244
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12196
12245
  options?: ImageUploadOptions,
12197
12246
  ): Promise<ImageMetadata>;
12198
- /**
12199
- * Update hosted image metadata
12200
- * @param imageId The ID of the image
12201
- * @param options Properties to update
12202
- * @returns Updated image metadata
12203
- * @throws {@link ImagesError} if update fails
12204
- */
12205
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12206
- /**
12207
- * Delete a hosted image
12208
- * @param imageId The ID of the image
12209
- * @returns True if deleted, false if not found
12210
- */
12211
- delete(imageId: string): Promise<boolean>;
12212
12247
  /**
12213
12248
  * List hosted images with pagination
12214
12249
  * @param options List configuration
@@ -13225,14 +13260,13 @@ export interface StreamScopedCaptions {
13225
13260
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13226
13261
  * One caption or subtitle file per language is allowed.
13227
13262
  * @param language The BCP 47 language tag for the caption or subtitle.
13228
- * @param file The caption or subtitle file to upload.
13263
+ * @param input The caption or subtitle stream to upload.
13229
13264
  * @returns The created caption entry.
13230
13265
  * @throws {NotFoundError} if the video is not found
13231
13266
  * @throws {BadRequestError} if the language or file is invalid
13232
- * @throws {MaxFileSizeError} if the file size is too large
13233
13267
  * @throws {InternalError} if an unexpected error occurs
13234
13268
  */
13235
- upload(language: string, file: File): Promise<StreamCaption>;
13269
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13236
13270
  /**
13237
13271
  * Generate captions or subtitles for the provided language via AI.
13238
13272
  * @param language The BCP 47 language tag to generate.
@@ -13308,17 +13342,16 @@ export interface StreamVideos {
13308
13342
  export interface StreamWatermarks {
13309
13343
  /**
13310
13344
  * Generate a new watermark profile
13311
- * @param file The image file to upload
13345
+ * @param input The image stream to upload
13312
13346
  * @param params The watermark creation parameters.
13313
13347
  * @returns The created watermark profile.
13314
13348
  * @throws {BadRequestError} if the parameters are invalid
13315
13349
  * @throws {InvalidURLError} if the URL is invalid
13316
- * @throws {MaxFileSizeError} if the file size is too large
13317
13350
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13318
13351
  * @throws {InternalError} if an unexpected error occurs
13319
13352
  */
13320
13353
  generate(
13321
- file: File,
13354
+ input: ReadableStream,
13322
13355
  params: StreamWatermarkCreateParams,
13323
13356
  ): Promise<StreamWatermark>;
13324
13357
  /**
@@ -13328,7 +13361,6 @@ export interface StreamWatermarks {
13328
13361
  * @returns The created watermark profile.
13329
13362
  * @throws {BadRequestError} if the parameters are invalid
13330
13363
  * @throws {InvalidURLError} if the URL is invalid
13331
- * @throws {MaxFileSizeError} if the file size is too large
13332
13364
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13333
13365
  * @throws {InternalError} if an unexpected error occurs
13334
13366
  */
@@ -3763,12 +3763,43 @@ interface Container {
3763
3763
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3764
3764
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3765
3765
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3766
+ snapshotDirectory(
3767
+ options: ContainerDirectorySnapshotOptions,
3768
+ ): Promise<ContainerDirectorySnapshot>;
3769
+ snapshotContainer(
3770
+ options: ContainerSnapshotOptions,
3771
+ ): Promise<ContainerSnapshot>;
3772
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3773
+ }
3774
+ interface ContainerDirectorySnapshot {
3775
+ id: string;
3776
+ size: number;
3777
+ dir: string;
3778
+ name?: string;
3779
+ }
3780
+ interface ContainerDirectorySnapshotOptions {
3781
+ dir: string;
3782
+ name?: string;
3783
+ }
3784
+ interface ContainerDirectorySnapshotRestoreParams {
3785
+ snapshot: ContainerDirectorySnapshot;
3786
+ mountPoint?: string;
3787
+ }
3788
+ interface ContainerSnapshot {
3789
+ id: string;
3790
+ size: number;
3791
+ name?: string;
3792
+ }
3793
+ interface ContainerSnapshotOptions {
3794
+ name?: string;
3766
3795
  }
3767
3796
  interface ContainerStartupOptions {
3768
3797
  entrypoint?: string[];
3769
3798
  enableInternet: boolean;
3770
3799
  env?: Record<string, string>;
3771
3800
  labels?: Record<string, string>;
3801
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3802
+ containerSnapshot?: ContainerSnapshot;
3772
3803
  }
3773
3804
  /**
3774
3805
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12160,19 +12191,37 @@ interface ImageList {
12160
12191
  cursor?: string;
12161
12192
  listComplete: boolean;
12162
12193
  }
12163
- interface HostedImagesBinding {
12194
+ interface ImageHandle {
12164
12195
  /**
12165
- * Get detailed metadata for a hosted image
12166
- * @param imageId The ID of the image (UUID or custom ID)
12196
+ * Get metadata for a hosted image
12167
12197
  * @returns Image metadata, or null if not found
12168
12198
  */
12169
- details(imageId: string): Promise<ImageMetadata | null>;
12199
+ details(): Promise<ImageMetadata | null>;
12170
12200
  /**
12171
12201
  * Get the raw image data for a hosted image
12172
- * @param imageId The ID of the image (UUID or custom ID)
12173
12202
  * @returns ReadableStream of image bytes, or null if not found
12174
12203
  */
12175
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12204
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12205
+ /**
12206
+ * Update hosted image metadata
12207
+ * @param options Properties to update
12208
+ * @returns Updated image metadata
12209
+ * @throws {@link ImagesError} if update fails
12210
+ */
12211
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12212
+ /**
12213
+ * Delete a hosted image
12214
+ * @returns True if deleted, false if not found
12215
+ */
12216
+ delete(): Promise<boolean>;
12217
+ }
12218
+ interface HostedImagesBinding {
12219
+ /**
12220
+ * Get a handle for a hosted image
12221
+ * @param imageId The ID of the image (UUID or custom ID)
12222
+ * @returns A handle for per-image operations
12223
+ */
12224
+ image(imageId: string): ImageHandle;
12176
12225
  /**
12177
12226
  * Upload a new hosted image
12178
12227
  * @param image The image file to upload
@@ -12184,20 +12233,6 @@ interface HostedImagesBinding {
12184
12233
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12185
12234
  options?: ImageUploadOptions,
12186
12235
  ): Promise<ImageMetadata>;
12187
- /**
12188
- * Update hosted image metadata
12189
- * @param imageId The ID of the image
12190
- * @param options Properties to update
12191
- * @returns Updated image metadata
12192
- * @throws {@link ImagesError} if update fails
12193
- */
12194
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12195
- /**
12196
- * Delete a hosted image
12197
- * @param imageId The ID of the image
12198
- * @returns True if deleted, false if not found
12199
- */
12200
- delete(imageId: string): Promise<boolean>;
12201
12236
  /**
12202
12237
  * List hosted images with pagination
12203
12238
  * @param options List configuration
@@ -13273,14 +13308,13 @@ interface StreamScopedCaptions {
13273
13308
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13274
13309
  * One caption or subtitle file per language is allowed.
13275
13310
  * @param language The BCP 47 language tag for the caption or subtitle.
13276
- * @param file The caption or subtitle file to upload.
13311
+ * @param input The caption or subtitle stream to upload.
13277
13312
  * @returns The created caption entry.
13278
13313
  * @throws {NotFoundError} if the video is not found
13279
13314
  * @throws {BadRequestError} if the language or file is invalid
13280
- * @throws {MaxFileSizeError} if the file size is too large
13281
13315
  * @throws {InternalError} if an unexpected error occurs
13282
13316
  */
13283
- upload(language: string, file: File): Promise<StreamCaption>;
13317
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13284
13318
  /**
13285
13319
  * Generate captions or subtitles for the provided language via AI.
13286
13320
  * @param language The BCP 47 language tag to generate.
@@ -13356,17 +13390,16 @@ interface StreamVideos {
13356
13390
  interface StreamWatermarks {
13357
13391
  /**
13358
13392
  * Generate a new watermark profile
13359
- * @param file The image file to upload
13393
+ * @param input The image stream to upload
13360
13394
  * @param params The watermark creation parameters.
13361
13395
  * @returns The created watermark profile.
13362
13396
  * @throws {BadRequestError} if the parameters are invalid
13363
13397
  * @throws {InvalidURLError} if the URL is invalid
13364
- * @throws {MaxFileSizeError} if the file size is too large
13365
13398
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13366
13399
  * @throws {InternalError} if an unexpected error occurs
13367
13400
  */
13368
13401
  generate(
13369
- file: File,
13402
+ input: ReadableStream,
13370
13403
  params: StreamWatermarkCreateParams,
13371
13404
  ): Promise<StreamWatermark>;
13372
13405
  /**
@@ -13376,7 +13409,6 @@ interface StreamWatermarks {
13376
13409
  * @returns The created watermark profile.
13377
13410
  * @throws {BadRequestError} if the parameters are invalid
13378
13411
  * @throws {InvalidURLError} if the URL is invalid
13379
- * @throws {MaxFileSizeError} if the file size is too large
13380
13412
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13381
13413
  * @throws {InternalError} if an unexpected error occurs
13382
13414
  */
@@ -3769,12 +3769,43 @@ export interface Container {
3769
3769
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3770
3770
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3771
3771
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3772
+ snapshotDirectory(
3773
+ options: ContainerDirectorySnapshotOptions,
3774
+ ): Promise<ContainerDirectorySnapshot>;
3775
+ snapshotContainer(
3776
+ options: ContainerSnapshotOptions,
3777
+ ): Promise<ContainerSnapshot>;
3778
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3779
+ }
3780
+ export interface ContainerDirectorySnapshot {
3781
+ id: string;
3782
+ size: number;
3783
+ dir: string;
3784
+ name?: string;
3785
+ }
3786
+ export interface ContainerDirectorySnapshotOptions {
3787
+ dir: string;
3788
+ name?: string;
3789
+ }
3790
+ export interface ContainerDirectorySnapshotRestoreParams {
3791
+ snapshot: ContainerDirectorySnapshot;
3792
+ mountPoint?: string;
3793
+ }
3794
+ export interface ContainerSnapshot {
3795
+ id: string;
3796
+ size: number;
3797
+ name?: string;
3798
+ }
3799
+ export interface ContainerSnapshotOptions {
3800
+ name?: string;
3772
3801
  }
3773
3802
  export interface ContainerStartupOptions {
3774
3803
  entrypoint?: string[];
3775
3804
  enableInternet: boolean;
3776
3805
  env?: Record<string, string>;
3777
3806
  labels?: Record<string, string>;
3807
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3808
+ containerSnapshot?: ContainerSnapshot;
3778
3809
  }
3779
3810
  /**
3780
3811
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12176,19 +12207,37 @@ export interface ImageList {
12176
12207
  cursor?: string;
12177
12208
  listComplete: boolean;
12178
12209
  }
12179
- export interface HostedImagesBinding {
12210
+ export interface ImageHandle {
12180
12211
  /**
12181
- * Get detailed metadata for a hosted image
12182
- * @param imageId The ID of the image (UUID or custom ID)
12212
+ * Get metadata for a hosted image
12183
12213
  * @returns Image metadata, or null if not found
12184
12214
  */
12185
- details(imageId: string): Promise<ImageMetadata | null>;
12215
+ details(): Promise<ImageMetadata | null>;
12186
12216
  /**
12187
12217
  * Get the raw image data for a hosted image
12188
- * @param imageId The ID of the image (UUID or custom ID)
12189
12218
  * @returns ReadableStream of image bytes, or null if not found
12190
12219
  */
12191
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12220
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12221
+ /**
12222
+ * Update hosted image metadata
12223
+ * @param options Properties to update
12224
+ * @returns Updated image metadata
12225
+ * @throws {@link ImagesError} if update fails
12226
+ */
12227
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12228
+ /**
12229
+ * Delete a hosted image
12230
+ * @returns True if deleted, false if not found
12231
+ */
12232
+ delete(): Promise<boolean>;
12233
+ }
12234
+ export interface HostedImagesBinding {
12235
+ /**
12236
+ * Get a handle for a hosted image
12237
+ * @param imageId The ID of the image (UUID or custom ID)
12238
+ * @returns A handle for per-image operations
12239
+ */
12240
+ image(imageId: string): ImageHandle;
12192
12241
  /**
12193
12242
  * Upload a new hosted image
12194
12243
  * @param image The image file to upload
@@ -12200,20 +12249,6 @@ export interface HostedImagesBinding {
12200
12249
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12201
12250
  options?: ImageUploadOptions,
12202
12251
  ): Promise<ImageMetadata>;
12203
- /**
12204
- * Update hosted image metadata
12205
- * @param imageId The ID of the image
12206
- * @param options Properties to update
12207
- * @returns Updated image metadata
12208
- * @throws {@link ImagesError} if update fails
12209
- */
12210
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12211
- /**
12212
- * Delete a hosted image
12213
- * @param imageId The ID of the image
12214
- * @returns True if deleted, false if not found
12215
- */
12216
- delete(imageId: string): Promise<boolean>;
12217
12252
  /**
12218
12253
  * List hosted images with pagination
12219
12254
  * @param options List configuration
@@ -13230,14 +13265,13 @@ export interface StreamScopedCaptions {
13230
13265
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13231
13266
  * One caption or subtitle file per language is allowed.
13232
13267
  * @param language The BCP 47 language tag for the caption or subtitle.
13233
- * @param file The caption or subtitle file to upload.
13268
+ * @param input The caption or subtitle stream to upload.
13234
13269
  * @returns The created caption entry.
13235
13270
  * @throws {NotFoundError} if the video is not found
13236
13271
  * @throws {BadRequestError} if the language or file is invalid
13237
- * @throws {MaxFileSizeError} if the file size is too large
13238
13272
  * @throws {InternalError} if an unexpected error occurs
13239
13273
  */
13240
- upload(language: string, file: File): Promise<StreamCaption>;
13274
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13241
13275
  /**
13242
13276
  * Generate captions or subtitles for the provided language via AI.
13243
13277
  * @param language The BCP 47 language tag to generate.
@@ -13313,17 +13347,16 @@ export interface StreamVideos {
13313
13347
  export interface StreamWatermarks {
13314
13348
  /**
13315
13349
  * Generate a new watermark profile
13316
- * @param file The image file to upload
13350
+ * @param input The image stream to upload
13317
13351
  * @param params The watermark creation parameters.
13318
13352
  * @returns The created watermark profile.
13319
13353
  * @throws {BadRequestError} if the parameters are invalid
13320
13354
  * @throws {InvalidURLError} if the URL is invalid
13321
- * @throws {MaxFileSizeError} if the file size is too large
13322
13355
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13323
13356
  * @throws {InternalError} if an unexpected error occurs
13324
13357
  */
13325
13358
  generate(
13326
- file: File,
13359
+ input: ReadableStream,
13327
13360
  params: StreamWatermarkCreateParams,
13328
13361
  ): Promise<StreamWatermark>;
13329
13362
  /**
@@ -13333,7 +13366,6 @@ export interface StreamWatermarks {
13333
13366
  * @returns The created watermark profile.
13334
13367
  * @throws {BadRequestError} if the parameters are invalid
13335
13368
  * @throws {InvalidURLError} if the URL is invalid
13336
- * @throws {MaxFileSizeError} if the file size is too large
13337
13369
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13338
13370
  * @throws {InternalError} if an unexpected error occurs
13339
13371
  */