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