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