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