@cloudflare/workers-types 4.20260310.1 → 4.20260313.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.
@@ -3564,7 +3564,7 @@ declare var WebSocket: {
3564
3564
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
3565
3565
  */
3566
3566
  interface WebSocket extends EventTarget<WebSocketEventMap> {
3567
- accept(): void;
3567
+ accept(options?: WebSocketAcceptOptions): void;
3568
3568
  /**
3569
3569
  * The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
3570
3570
  *
@@ -3610,6 +3610,16 @@ interface WebSocket extends EventTarget<WebSocketEventMap> {
3610
3610
  */
3611
3611
  binaryType: "blob" | "arraybuffer";
3612
3612
  }
3613
+ interface WebSocketAcceptOptions {
3614
+ /**
3615
+ * When set to `true`, receiving a server-initiated WebSocket Close frame will not
3616
+ * automatically send a reciprocal Close frame, leaving the connection in a half-open
3617
+ * state. This is useful for proxying scenarios where you need to coordinate closing
3618
+ * both sides independently. Defaults to `false` when the
3619
+ * `no_web_socket_half_open_by_default` compatibility flag is enabled.
3620
+ */
3621
+ allowHalfOpen?: boolean;
3622
+ }
3613
3623
  declare const WebSocketPair: {
3614
3624
  new (): {
3615
3625
  0: WebSocket;
@@ -12052,6 +12062,767 @@ declare module "cloudflare:sockets" {
12052
12062
  ): Socket;
12053
12063
  export { _connect as connect };
12054
12064
  }
12065
+ /**
12066
+ * Binding entrypoint for Cloudflare Stream.
12067
+ *
12068
+ * Usage:
12069
+ * - Binding-level operations:
12070
+ * `await env.STREAM.videos.upload`
12071
+ * `await env.STREAM.videos.createDirectUpload`
12072
+ * `await env.STREAM.videos.*`
12073
+ * `await env.STREAM.watermarks.*`
12074
+ * - Per-video operations:
12075
+ * `await env.STREAM.video(id).downloads.*`
12076
+ * `await env.STREAM.video(id).captions.*`
12077
+ *
12078
+ * Example usage:
12079
+ * ```ts
12080
+ * await env.STREAM.video(id).downloads.generate();
12081
+ *
12082
+ * const video = env.STREAM.video(id)
12083
+ * const captions = video.captions.list();
12084
+ * const videoDetails = video.details()
12085
+ * ```
12086
+ */
12087
+ interface StreamBinding {
12088
+ /**
12089
+ * Returns a handle scoped to a single video for per-video operations.
12090
+ * @param id The unique identifier for the video.
12091
+ * @returns A handle for per-video operations.
12092
+ */
12093
+ video(id: string): StreamVideoHandle;
12094
+ /**
12095
+ * Uploads a new video from a File.
12096
+ * @param file The video file to upload.
12097
+ * @returns The uploaded video details.
12098
+ * @throws {BadRequestError} if the upload parameter is invalid
12099
+ * @throws {QuotaReachedError} if the account storage capacity is exceeded
12100
+ * @throws {MaxFileSizeError} if the file size is too large
12101
+ * @throws {RateLimitedError} if the server received too many requests
12102
+ * @throws {InternalError} if an unexpected error occurs
12103
+ */
12104
+ upload(file: File): Promise<StreamVideo>;
12105
+ /**
12106
+ * Uploads a new video from a provided URL.
12107
+ * @param url The URL to upload from.
12108
+ * @param params Optional upload parameters.
12109
+ * @returns The uploaded video details.
12110
+ * @throws {BadRequestError} if the upload parameter is invalid or the URL is invalid
12111
+ * @throws {QuotaReachedError} if the account storage capacity is exceeded
12112
+ * @throws {MaxFileSizeError} if the file size is too large
12113
+ * @throws {RateLimitedError} if the server received too many requests
12114
+ * @throws {AlreadyUploadedError} if a video was already uploaded to this URL
12115
+ * @throws {InternalError} if an unexpected error occurs
12116
+ */
12117
+ upload(url: string, params?: StreamUrlUploadParams): Promise<StreamVideo>;
12118
+ /**
12119
+ * Creates a direct upload that allows video uploads without an API key.
12120
+ * @param params Parameters for the direct upload
12121
+ * @returns The direct upload details.
12122
+ * @throws {BadRequestError} if the parameters are invalid
12123
+ * @throws {RateLimitedError} if the server received too many requests
12124
+ * @throws {InternalError} if an unexpected error occurs
12125
+ */
12126
+ createDirectUpload(
12127
+ params: StreamDirectUploadCreateParams,
12128
+ ): Promise<StreamDirectUpload>;
12129
+ videos: StreamVideos;
12130
+ watermarks: StreamWatermarks;
12131
+ }
12132
+ /**
12133
+ * Handle for operations scoped to a single Stream video.
12134
+ */
12135
+ interface StreamVideoHandle {
12136
+ /**
12137
+ * The unique identifier for the video.
12138
+ */
12139
+ id: string;
12140
+ /**
12141
+ * Get a full videos details
12142
+ * @returns The full video details.
12143
+ * @throws {NotFoundError} if the video is not found
12144
+ * @throws {InternalError} if an unexpected error occurs
12145
+ */
12146
+ details(): Promise<StreamVideo>;
12147
+ /**
12148
+ * Update details for a single video.
12149
+ * @param params The fields to update for the video.
12150
+ * @returns The updated video details.
12151
+ * @throws {NotFoundError} if the video is not found
12152
+ * @throws {BadRequestError} if the parameters are invalid
12153
+ * @throws {InternalError} if an unexpected error occurs
12154
+ */
12155
+ update(params: StreamUpdateVideoParams): Promise<StreamVideo>;
12156
+ /**
12157
+ * Deletes a video and its copies from Cloudflare Stream.
12158
+ * @returns A promise that resolves when deletion completes.
12159
+ * @throws {NotFoundError} if the video is not found
12160
+ * @throws {InternalError} if an unexpected error occurs
12161
+ */
12162
+ delete(): Promise<void>;
12163
+ /**
12164
+ * Creates a signed URL token for a video.
12165
+ * @returns The signed token that was created.
12166
+ * @throws {InternalError} if the signing key cannot be retrieved or the token cannot be signed
12167
+ */
12168
+ generateToken(): Promise<string>;
12169
+ downloads: StreamScopedDownloads;
12170
+ captions: StreamScopedCaptions;
12171
+ }
12172
+ interface StreamVideo {
12173
+ /**
12174
+ * The unique identifier for the video.
12175
+ */
12176
+ id: string;
12177
+ /**
12178
+ * A user-defined identifier for the media creator.
12179
+ */
12180
+ creator: string | null;
12181
+ /**
12182
+ * The thumbnail URL for the video.
12183
+ */
12184
+ thumbnail: string;
12185
+ /**
12186
+ * The thumbnail timestamp percentage.
12187
+ */
12188
+ thumbnailTimestampPct: number;
12189
+ /**
12190
+ * Indicates whether the video is ready to stream.
12191
+ */
12192
+ readyToStream: boolean;
12193
+ /**
12194
+ * The date and time the video became ready to stream.
12195
+ */
12196
+ readyToStreamAt: string | null;
12197
+ /**
12198
+ * Processing status information.
12199
+ */
12200
+ status: StreamVideoStatus;
12201
+ /**
12202
+ * A user modifiable key-value store.
12203
+ */
12204
+ meta: Record<string, string>;
12205
+ /**
12206
+ * The date and time the video was created.
12207
+ */
12208
+ created: string;
12209
+ /**
12210
+ * The date and time the video was last modified.
12211
+ */
12212
+ modified: string;
12213
+ /**
12214
+ * The date and time at which the video will be deleted.
12215
+ */
12216
+ scheduledDeletion: string | null;
12217
+ /**
12218
+ * The size of the video in bytes.
12219
+ */
12220
+ size: number;
12221
+ /**
12222
+ * The preview URL for the video.
12223
+ */
12224
+ preview?: string;
12225
+ /**
12226
+ * Origins allowed to display the video.
12227
+ */
12228
+ allowedOrigins: Array<string>;
12229
+ /**
12230
+ * Indicates whether signed URLs are required.
12231
+ */
12232
+ requireSignedURLs: boolean | null;
12233
+ /**
12234
+ * The date and time the video was uploaded.
12235
+ */
12236
+ uploaded: string | null;
12237
+ /**
12238
+ * The date and time when the upload URL expires.
12239
+ */
12240
+ uploadExpiry: string | null;
12241
+ /**
12242
+ * The maximum size in bytes for direct uploads.
12243
+ */
12244
+ maxSizeBytes: number | null;
12245
+ /**
12246
+ * The maximum duration in seconds for direct uploads.
12247
+ */
12248
+ maxDurationSeconds: number | null;
12249
+ /**
12250
+ * The video duration in seconds. -1 indicates unknown.
12251
+ */
12252
+ duration: number;
12253
+ /**
12254
+ * Input metadata for the original upload.
12255
+ */
12256
+ input: StreamVideoInput;
12257
+ /**
12258
+ * Playback URLs for the video.
12259
+ */
12260
+ hlsPlaybackUrl: string;
12261
+ dashPlaybackUrl: string;
12262
+ /**
12263
+ * The watermark applied to the video, if any.
12264
+ */
12265
+ watermark: StreamWatermark | null;
12266
+ /**
12267
+ * The live input id associated with the video, if any.
12268
+ */
12269
+ liveInputId?: string | null;
12270
+ /**
12271
+ * The source video id if this is a clip.
12272
+ */
12273
+ clippedFromId: string | null;
12274
+ /**
12275
+ * Public details associated with the video.
12276
+ */
12277
+ publicDetails: StreamPublicDetails | null;
12278
+ }
12279
+ type StreamVideoStatus = {
12280
+ /**
12281
+ * The current processing state.
12282
+ */
12283
+ state: string;
12284
+ /**
12285
+ * The current processing step.
12286
+ */
12287
+ step?: string;
12288
+ /**
12289
+ * The percent complete as a string.
12290
+ */
12291
+ pctComplete?: string;
12292
+ /**
12293
+ * An error reason code, if applicable.
12294
+ */
12295
+ errorReasonCode: string;
12296
+ /**
12297
+ * An error reason text, if applicable.
12298
+ */
12299
+ errorReasonText: string;
12300
+ };
12301
+ type StreamVideoInput = {
12302
+ /**
12303
+ * The input width in pixels.
12304
+ */
12305
+ width: number;
12306
+ /**
12307
+ * The input height in pixels.
12308
+ */
12309
+ height: number;
12310
+ };
12311
+ type StreamPublicDetails = {
12312
+ /**
12313
+ * The public title for the video.
12314
+ */
12315
+ title: string | null;
12316
+ /**
12317
+ * The public share link.
12318
+ */
12319
+ share_link: string | null;
12320
+ /**
12321
+ * The public channel link.
12322
+ */
12323
+ channel_link: string | null;
12324
+ /**
12325
+ * The public logo URL.
12326
+ */
12327
+ logo: string | null;
12328
+ };
12329
+ type StreamDirectUpload = {
12330
+ /**
12331
+ * The URL an unauthenticated upload can use for a single multipart request.
12332
+ */
12333
+ uploadURL: string;
12334
+ /**
12335
+ * A Cloudflare-generated unique identifier for a media item.
12336
+ */
12337
+ id: string;
12338
+ /**
12339
+ * The watermark profile applied to the upload.
12340
+ */
12341
+ watermark: StreamWatermark | null;
12342
+ /**
12343
+ * The scheduled deletion time, if any.
12344
+ */
12345
+ scheduledDeletion: string | null;
12346
+ };
12347
+ type StreamDirectUploadCreateParams = {
12348
+ /**
12349
+ * The maximum duration in seconds for a video upload.
12350
+ */
12351
+ maxDurationSeconds: number;
12352
+ /**
12353
+ * The date and time after upload when videos will not be accepted.
12354
+ */
12355
+ expiry?: string;
12356
+ /**
12357
+ * A user-defined identifier for the media creator.
12358
+ */
12359
+ creator?: string;
12360
+ /**
12361
+ * A user modifiable key-value store used to reference other systems of record for
12362
+ * managing videos.
12363
+ */
12364
+ meta?: Record<string, string>;
12365
+ /**
12366
+ * Lists the origins allowed to display the video.
12367
+ */
12368
+ allowedOrigins?: Array<string>;
12369
+ /**
12370
+ * Indicates whether the video can be accessed using the id. When set to `true`,
12371
+ * a signed token must be generated with a signing key to view the video.
12372
+ */
12373
+ requireSignedURLs?: boolean;
12374
+ /**
12375
+ * The thumbnail timestamp percentage.
12376
+ */
12377
+ thumbnailTimestampPct?: number;
12378
+ /**
12379
+ * The date and time at which the video will be deleted. Include `null` to remove
12380
+ * a scheduled deletion.
12381
+ */
12382
+ scheduledDeletion?: string | null;
12383
+ /**
12384
+ * The watermark profile to apply.
12385
+ */
12386
+ watermark?: StreamDirectUploadWatermark;
12387
+ };
12388
+ type StreamDirectUploadWatermark = {
12389
+ /**
12390
+ * The unique identifier for the watermark profile.
12391
+ */
12392
+ id: string;
12393
+ };
12394
+ type StreamUrlUploadParams = {
12395
+ /**
12396
+ * Lists the origins allowed to display the video. Enter allowed origin
12397
+ * domains in an array and use `*` for wildcard subdomains. Empty arrays allow the
12398
+ * video to be viewed on any origin.
12399
+ */
12400
+ allowedOrigins?: Array<string>;
12401
+ /**
12402
+ * A user-defined identifier for the media creator.
12403
+ */
12404
+ creator?: string;
12405
+ /**
12406
+ * A user modifiable key-value store used to reference other systems of
12407
+ * record for managing videos.
12408
+ */
12409
+ meta?: Record<string, string>;
12410
+ /**
12411
+ * Indicates whether the video can be a accessed using the id. When
12412
+ * set to `true`, a signed token must be generated with a signing key to view the
12413
+ * video.
12414
+ */
12415
+ requireSignedURLs?: boolean;
12416
+ /**
12417
+ * Indicates the date and time at which the video will be deleted. Omit
12418
+ * the field to indicate no change, or include with a `null` value to remove an
12419
+ * existing scheduled deletion. If specified, must be at least 30 days from upload
12420
+ * time.
12421
+ */
12422
+ scheduledDeletion?: string | null;
12423
+ /**
12424
+ * The timestamp for a thumbnail image calculated as a percentage value
12425
+ * of the video's duration. To convert from a second-wise timestamp to a
12426
+ * percentage, divide the desired timestamp by the total duration of the video. If
12427
+ * this value is not set, the default thumbnail image is taken from 0s of the
12428
+ * video.
12429
+ */
12430
+ thumbnailTimestampPct?: number;
12431
+ /**
12432
+ * The identifier for the watermark profile
12433
+ */
12434
+ watermarkId?: string;
12435
+ };
12436
+ interface StreamScopedCaptions {
12437
+ /**
12438
+ * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
12439
+ * One caption or subtitle file per language is allowed.
12440
+ * @param language The BCP 47 language tag for the caption or subtitle.
12441
+ * @param file The caption or subtitle file to upload.
12442
+ * @returns The created caption entry.
12443
+ * @throws {NotFoundError} if the video is not found
12444
+ * @throws {BadRequestError} if the language or file is invalid
12445
+ * @throws {MaxFileSizeError} if the file size is too large
12446
+ * @throws {InternalError} if an unexpected error occurs
12447
+ */
12448
+ upload(language: string, file: File): Promise<StreamCaption>;
12449
+ /**
12450
+ * Generate captions or subtitles for the provided language via AI.
12451
+ * @param language The BCP 47 language tag to generate.
12452
+ * @returns The generated caption entry.
12453
+ * @throws {NotFoundError} if the video is not found
12454
+ * @throws {BadRequestError} if the language is invalid
12455
+ * @throws {StreamError} if a generated caption already exists
12456
+ * @throws {StreamError} if the video duration is too long
12457
+ * @throws {StreamError} if the video is missing audio
12458
+ * @throws {StreamError} if the requested language is not supported
12459
+ * @throws {InternalError} if an unexpected error occurs
12460
+ */
12461
+ generate(language: string): Promise<StreamCaption>;
12462
+ /**
12463
+ * Lists the captions or subtitles.
12464
+ * Use the language parameter to filter by a specific language.
12465
+ * @param language The optional BCP 47 language tag to filter by.
12466
+ * @returns The list of captions or subtitles.
12467
+ * @throws {NotFoundError} if the video or caption is not found
12468
+ * @throws {InternalError} if an unexpected error occurs
12469
+ */
12470
+ list(language?: string): Promise<StreamCaption[]>;
12471
+ /**
12472
+ * Removes the captions or subtitles from a video.
12473
+ * @param language The BCP 47 language tag to remove.
12474
+ * @returns A promise that resolves when deletion completes.
12475
+ * @throws {NotFoundError} if the video or caption is not found
12476
+ * @throws {InternalError} if an unexpected error occurs
12477
+ */
12478
+ delete(language: string): Promise<void>;
12479
+ }
12480
+ interface StreamScopedDownloads {
12481
+ /**
12482
+ * Generates a download for a video when a video is ready to view. Available
12483
+ * types are `default` and `audio`. Defaults to `default` when omitted.
12484
+ * @param downloadType The download type to create.
12485
+ * @returns The current downloads for the video.
12486
+ * @throws {NotFoundError} if the video is not found
12487
+ * @throws {BadRequestError} if the download type is invalid
12488
+ * @throws {StreamError} if the video duration is too long to generate a download
12489
+ * @throws {StreamError} if the video is not ready to stream
12490
+ * @throws {InternalError} if an unexpected error occurs
12491
+ */
12492
+ generate(
12493
+ downloadType?: StreamDownloadType,
12494
+ ): Promise<StreamDownloadGetResponse>;
12495
+ /**
12496
+ * Lists the downloads created for a video.
12497
+ * @returns The current downloads for the video.
12498
+ * @throws {NotFoundError} if the video or downloads are not found
12499
+ * @throws {InternalError} if an unexpected error occurs
12500
+ */
12501
+ get(): Promise<StreamDownloadGetResponse>;
12502
+ /**
12503
+ * Delete the downloads for a video. Available types are `default` and `audio`.
12504
+ * Defaults to `default` when omitted.
12505
+ * @param downloadType The download type to delete.
12506
+ * @returns A promise that resolves when deletion completes.
12507
+ * @throws {NotFoundError} if the video or downloads are not found
12508
+ * @throws {InternalError} if an unexpected error occurs
12509
+ */
12510
+ delete(downloadType?: StreamDownloadType): Promise<void>;
12511
+ }
12512
+ interface StreamVideos {
12513
+ /**
12514
+ * Lists all videos in a users account.
12515
+ * @returns The list of videos.
12516
+ * @throws {BadRequestError} if the parameters are invalid
12517
+ * @throws {InternalError} if an unexpected error occurs
12518
+ */
12519
+ list(params?: StreamVideosListParams): Promise<StreamVideo[]>;
12520
+ }
12521
+ interface StreamWatermarks {
12522
+ /**
12523
+ * Generate a new watermark profile
12524
+ * @param file The image file to upload
12525
+ * @param params The watermark creation parameters.
12526
+ * @returns The created watermark profile.
12527
+ * @throws {BadRequestError} if the parameters are invalid
12528
+ * @throws {InvalidURLError} if the URL is invalid
12529
+ * @throws {MaxFileSizeError} if the file size is too large
12530
+ * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
12531
+ * @throws {InternalError} if an unexpected error occurs
12532
+ */
12533
+ generate(
12534
+ file: File,
12535
+ params: StreamWatermarkCreateParams,
12536
+ ): Promise<StreamWatermark>;
12537
+ /**
12538
+ * Generate a new watermark profile
12539
+ * @param url The image url to upload
12540
+ * @param params The watermark creation parameters.
12541
+ * @returns The created watermark profile.
12542
+ * @throws {BadRequestError} if the parameters are invalid
12543
+ * @throws {InvalidURLError} if the URL is invalid
12544
+ * @throws {MaxFileSizeError} if the file size is too large
12545
+ * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
12546
+ * @throws {InternalError} if an unexpected error occurs
12547
+ */
12548
+ generate(
12549
+ url: string,
12550
+ params: StreamWatermarkCreateParams,
12551
+ ): Promise<StreamWatermark>;
12552
+ /**
12553
+ * Lists all watermark profiles for an account.
12554
+ * @returns The list of watermark profiles.
12555
+ * @throws {InternalError} if an unexpected error occurs
12556
+ */
12557
+ list(): Promise<StreamWatermark[]>;
12558
+ /**
12559
+ * Retrieves details for a single watermark profile.
12560
+ * @param watermarkId The watermark profile identifier.
12561
+ * @returns The watermark profile details.
12562
+ * @throws {NotFoundError} if the watermark is not found
12563
+ * @throws {InternalError} if an unexpected error occurs
12564
+ */
12565
+ get(watermarkId: string): Promise<StreamWatermark>;
12566
+ /**
12567
+ * Deletes a watermark profile.
12568
+ * @param watermarkId The watermark profile identifier.
12569
+ * @returns A promise that resolves when deletion completes.
12570
+ * @throws {NotFoundError} if the watermark is not found
12571
+ * @throws {InternalError} if an unexpected error occurs
12572
+ */
12573
+ delete(watermarkId: string): Promise<void>;
12574
+ }
12575
+ type StreamUpdateVideoParams = {
12576
+ /**
12577
+ * Lists the origins allowed to display the video. Enter allowed origin
12578
+ * domains in an array and use `*` for wildcard subdomains. Empty arrays allow the
12579
+ * video to be viewed on any origin.
12580
+ */
12581
+ allowedOrigins?: Array<string>;
12582
+ /**
12583
+ * A user-defined identifier for the media creator.
12584
+ */
12585
+ creator?: string;
12586
+ /**
12587
+ * The maximum duration in seconds for a video upload. Can be set for a
12588
+ * video that is not yet uploaded to limit its duration. Uploads that exceed the
12589
+ * specified duration will fail during processing. A value of `-1` means the value
12590
+ * is unknown.
12591
+ */
12592
+ maxDurationSeconds?: number;
12593
+ /**
12594
+ * A user modifiable key-value store used to reference other systems of
12595
+ * record for managing videos.
12596
+ */
12597
+ meta?: Record<string, string>;
12598
+ /**
12599
+ * Indicates whether the video can be a accessed using the id. When
12600
+ * set to `true`, a signed token must be generated with a signing key to view the
12601
+ * video.
12602
+ */
12603
+ requireSignedURLs?: boolean;
12604
+ /**
12605
+ * Indicates the date and time at which the video will be deleted. Omit
12606
+ * the field to indicate no change, or include with a `null` value to remove an
12607
+ * existing scheduled deletion. If specified, must be at least 30 days from upload
12608
+ * time.
12609
+ */
12610
+ scheduledDeletion?: string | null;
12611
+ /**
12612
+ * The timestamp for a thumbnail image calculated as a percentage value
12613
+ * of the video's duration. To convert from a second-wise timestamp to a
12614
+ * percentage, divide the desired timestamp by the total duration of the video. If
12615
+ * this value is not set, the default thumbnail image is taken from 0s of the
12616
+ * video.
12617
+ */
12618
+ thumbnailTimestampPct?: number;
12619
+ };
12620
+ type StreamCaption = {
12621
+ /**
12622
+ * Whether the caption was generated via AI.
12623
+ */
12624
+ generated?: boolean;
12625
+ /**
12626
+ * The language label displayed in the native language to users.
12627
+ */
12628
+ label: string;
12629
+ /**
12630
+ * The language tag in BCP 47 format.
12631
+ */
12632
+ language: string;
12633
+ /**
12634
+ * The status of a generated caption.
12635
+ */
12636
+ status?: "ready" | "inprogress" | "error";
12637
+ };
12638
+ type StreamDownloadStatus = "ready" | "inprogress" | "error";
12639
+ type StreamDownloadType = "default" | "audio";
12640
+ type StreamDownload = {
12641
+ /**
12642
+ * Indicates the progress as a percentage between 0 and 100.
12643
+ */
12644
+ percentComplete: number;
12645
+ /**
12646
+ * The status of a generated download.
12647
+ */
12648
+ status: StreamDownloadStatus;
12649
+ /**
12650
+ * The URL to access the generated download.
12651
+ */
12652
+ url?: string;
12653
+ };
12654
+ /**
12655
+ * An object with download type keys. Each key is optional and only present if that
12656
+ * download type has been created.
12657
+ */
12658
+ type StreamDownloadGetResponse = {
12659
+ /**
12660
+ * The audio-only download. Only present if this download type has been created.
12661
+ */
12662
+ audio?: StreamDownload;
12663
+ /**
12664
+ * The default video download. Only present if this download type has been created.
12665
+ */
12666
+ default?: StreamDownload;
12667
+ };
12668
+ type StreamWatermarkPosition =
12669
+ | "upperRight"
12670
+ | "upperLeft"
12671
+ | "lowerLeft"
12672
+ | "lowerRight"
12673
+ | "center";
12674
+ type StreamWatermark = {
12675
+ /**
12676
+ * The unique identifier for a watermark profile.
12677
+ */
12678
+ id: string;
12679
+ /**
12680
+ * The size of the image in bytes.
12681
+ */
12682
+ size: number;
12683
+ /**
12684
+ * The height of the image in pixels.
12685
+ */
12686
+ height: number;
12687
+ /**
12688
+ * The width of the image in pixels.
12689
+ */
12690
+ width: number;
12691
+ /**
12692
+ * The date and a time a watermark profile was created.
12693
+ */
12694
+ created: string;
12695
+ /**
12696
+ * The source URL for a downloaded image. If the watermark profile was created via
12697
+ * direct upload, this field is null.
12698
+ */
12699
+ downloadedFrom: string | null;
12700
+ /**
12701
+ * A short description of the watermark profile.
12702
+ */
12703
+ name: string;
12704
+ /**
12705
+ * The translucency of the image. A value of `0.0` makes the image completely
12706
+ * transparent, and `1.0` makes the image completely opaque. Note that if the image
12707
+ * is already semi-transparent, setting this to `1.0` will not make the image
12708
+ * completely opaque.
12709
+ */
12710
+ opacity: number;
12711
+ /**
12712
+ * The whitespace between the adjacent edges (determined by position) of the video
12713
+ * and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
12714
+ * video width or length, as determined by the algorithm.
12715
+ */
12716
+ padding: number;
12717
+ /**
12718
+ * The size of the image relative to the overall size of the video. This parameter
12719
+ * will adapt to horizontal and vertical videos automatically. `0.0` indicates no
12720
+ * scaling (use the size of the image as-is), and `1.0 `fills the entire video.
12721
+ */
12722
+ scale: number;
12723
+ /**
12724
+ * The location of the image. Valid positions are: `upperRight`, `upperLeft`,
12725
+ * `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
12726
+ * `padding` parameter.
12727
+ */
12728
+ position: StreamWatermarkPosition;
12729
+ };
12730
+ type StreamWatermarkCreateParams = {
12731
+ /**
12732
+ * A short description of the watermark profile.
12733
+ */
12734
+ name?: string;
12735
+ /**
12736
+ * The translucency of the image. A value of `0.0` makes the image completely
12737
+ * transparent, and `1.0` makes the image completely opaque. Note that if the
12738
+ * image is already semi-transparent, setting this to `1.0` will not make the
12739
+ * image completely opaque.
12740
+ */
12741
+ opacity?: number;
12742
+ /**
12743
+ * The whitespace between the adjacent edges (determined by position) of the
12744
+ * video and the image. `0.0` indicates no padding, and `1.0` indicates a fully
12745
+ * padded video width or length, as determined by the algorithm.
12746
+ */
12747
+ padding?: number;
12748
+ /**
12749
+ * The size of the image relative to the overall size of the video. This
12750
+ * parameter will adapt to horizontal and vertical videos automatically. `0.0`
12751
+ * indicates no scaling (use the size of the image as-is), and `1.0 `fills the
12752
+ * entire video.
12753
+ */
12754
+ scale?: number;
12755
+ /**
12756
+ * The location of the image.
12757
+ */
12758
+ position?: StreamWatermarkPosition;
12759
+ };
12760
+ type StreamVideosListParams = {
12761
+ /**
12762
+ * The maximum number of videos to return.
12763
+ */
12764
+ limit?: number;
12765
+ /**
12766
+ * Return videos created before this timestamp.
12767
+ * (RFC3339/RFC3339Nano)
12768
+ */
12769
+ before?: string;
12770
+ /**
12771
+ * Comparison operator for the `before` field.
12772
+ * @default 'lt'
12773
+ */
12774
+ beforeComp?: StreamPaginationComparison;
12775
+ /**
12776
+ * Return videos created after this timestamp.
12777
+ * (RFC3339/RFC3339Nano)
12778
+ */
12779
+ after?: string;
12780
+ /**
12781
+ * Comparison operator for the `after` field.
12782
+ * @default 'gte'
12783
+ */
12784
+ afterComp?: StreamPaginationComparison;
12785
+ };
12786
+ type StreamPaginationComparison = "eq" | "gt" | "gte" | "lt" | "lte";
12787
+ /**
12788
+ * Error object for Stream binding operations.
12789
+ */
12790
+ interface StreamError extends Error {
12791
+ readonly code: number;
12792
+ readonly statusCode: number;
12793
+ readonly message: string;
12794
+ readonly stack?: string;
12795
+ }
12796
+ interface InternalError extends StreamError {
12797
+ name: "InternalError";
12798
+ }
12799
+ interface BadRequestError extends StreamError {
12800
+ name: "BadRequestError";
12801
+ }
12802
+ interface NotFoundError extends StreamError {
12803
+ name: "NotFoundError";
12804
+ }
12805
+ interface ForbiddenError extends StreamError {
12806
+ name: "ForbiddenError";
12807
+ }
12808
+ interface RateLimitedError extends StreamError {
12809
+ name: "RateLimitedError";
12810
+ }
12811
+ interface QuotaReachedError extends StreamError {
12812
+ name: "QuotaReachedError";
12813
+ }
12814
+ interface MaxFileSizeError extends StreamError {
12815
+ name: "MaxFileSizeError";
12816
+ }
12817
+ interface InvalidURLError extends StreamError {
12818
+ name: "InvalidURLError";
12819
+ }
12820
+ interface AlreadyUploadedError extends StreamError {
12821
+ name: "AlreadyUploadedError";
12822
+ }
12823
+ interface TooManyWatermarksError extends StreamError {
12824
+ name: "TooManyWatermarksError";
12825
+ }
12055
12826
  type MarkdownDocument = {
12056
12827
  name: string;
12057
12828
  blob: Blob;