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