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