next-cloudinary 6.0.0-beta.4 → 6.0.0-beta.7

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/README.md CHANGED
@@ -39,9 +39,8 @@ High-performance image delivery and uploading at scale in Next.js powered by Clo
39
39
  ### Installation
40
40
 
41
41
  * Install `next-cloudinary` with:
42
+
42
43
  ```
43
- yarn add next-cloudinary
44
- # or
45
44
  npm install next-cloudinary
46
45
  ```
47
46
 
@@ -91,12 +90,12 @@ Please read [CONTRIBUTING.md](https://github.com/cloudinary-community/next-cloud
91
90
 
92
91
  #### Installation
93
92
 
94
- This project is using [yarn](https://yarnpkg.com/) as a way to manage dependencies and workspaces.
93
+ This project is using [pnpm](https://pnpm.io/) as a way to manage dependencies and workspaces.
95
94
 
96
95
  With the project cloned, install the dependencies from the root of the project with:
97
96
 
98
97
  ```
99
- yarn install
98
+ pnpm install
100
99
  ```
101
100
 
102
101
  #### Configuration
@@ -128,7 +127,7 @@ CLOUDINARY_API_SECRET="<Your API Secret>"
128
127
  Then run the upload script with:
129
128
 
130
129
  ```
131
- yarn upload
130
+ pnpm upload
132
131
  ```
133
132
 
134
133
  By default, the images inside of `scripts/images.json` will be uploaded to the "images" directory inside of your Cloudinary account. To change the location, add the `CLOUDINARY_IMAGES_DIRECTORY` environment variable with your preferred directory:
@@ -142,7 +141,7 @@ CLOUDINARY_IMAGES_DIRECTORY="<Your Directory>"
142
141
  Once installed and configured, open two terminal tabs, navigating one to `next-cloudinary` and one to `docs`, running the following command in each:
143
142
 
144
143
  ```
145
- yarn dev
144
+ pnpm dev
146
145
  ```
147
146
 
148
147
  The project will now be available at <https://localhost:3000> or the configured local port.
@@ -154,7 +153,7 @@ All tests are located inside of `next-cloudinary/tests` with a directory structu
154
153
  While inside `next-cloudinary`, run tests with:
155
154
 
156
155
  ```
157
- yarn test
156
+ pnpm test
158
157
  ```
159
158
 
160
159
  ## Contributors
package/dist/index.d.mts CHANGED
@@ -1,7 +1,9 @@
1
- import * as _cloudinary_url_gen_config_interfaces_Config_ICloudinaryConfigurations from '@cloudinary/url-gen/config/interfaces/Config/ICloudinaryConfigurations';
1
+ import * as _cloudinary_util_url_loader_dist_schema_UX7RRFIR from '@cloudinary-util/url-loader/dist/schema-UX7RRFIR';
2
2
  import React, { MutableRefObject } from 'react';
3
3
  import { ImageProps } from 'next/image';
4
4
  import { ImageOptions, ConfigOptions, AnalyticsOptions, VideoOptions } from '@cloudinary-util/url-loader';
5
+ import { CloudinaryUploadWidgetOptions, CloudinaryUploadWidgetError, CloudinaryUploadWidgetResults, CloudinaryUploadWidgetInstanceMethods, CloudinaryVideoPlayerOptions, CloudinaryVideoPlayer, CloudinaryVideoPlayerOptionsLogo } from '@cloudinary-util/types';
6
+ export { CloudinaryUploadWidgetError, CloudinaryUploadWidgetInfo, CloudinaryUploadWidgetInstanceMethodCloseOptions, CloudinaryUploadWidgetInstanceMethodDestroyOptions, CloudinaryUploadWidgetInstanceMethodOpenOptions, CloudinaryUploadWidgetInstanceMethodUpdateOptions, CloudinaryUploadWidgetInstanceMethods, CloudinaryUploadWidgetOptions, CloudinaryUploadWidgetResults, CloudinaryUploadWidgetSources, CloudinaryVideoPlayer, CloudinaryVideoPlayerOptions, CloudinaryVideoPlayerOptionsColors, CloudinaryVideoPlayerOptionsLogo } from '@cloudinary-util/types';
5
7
 
6
8
  type CldImageProps = Omit<ImageProps, 'src'> & ImageOptions & {
7
9
  config?: ConfigOptions;
@@ -240,7 +242,7 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
240
242
  } | undefined;
241
243
  defaultImage?: string | undefined;
242
244
  } & {
243
- config?: _cloudinary_url_gen_config_interfaces_Config_ICloudinaryConfigurations.default | undefined;
245
+ config?: _cloudinary_util_url_loader_dist_schema_UX7RRFIR.g | undefined;
244
246
  preserveTransformations?: boolean | undefined;
245
247
  src: string;
246
248
  unoptimized?: boolean | undefined;
@@ -255,72 +257,6 @@ declare const CldOgImage: ({ excludeTags, twitterTitle, keys, ...props }: CldOgI
255
257
 
256
258
  type CldUploadWidgetCloudinaryInstance = any;
257
259
  type CldUploadWidgetWidgetInstance = any;
258
- type CustomURL = `https://${string}.${string}`;
259
- interface CldUploadWidgetResults {
260
- event?: string;
261
- info?: string | CldUploadWidgetInfo;
262
- }
263
- interface CldUploadWidgetInfo {
264
- access_mode: 'public' | 'authenticated';
265
- api_key: string;
266
- asset_id: string;
267
- batchId: string;
268
- bytes: number;
269
- context: Record<string, Record<string, string>>;
270
- created_at: string;
271
- etag: string;
272
- folder: string;
273
- format: string;
274
- height: number;
275
- hook_execution: Record<string, unknown>;
276
- id: string;
277
- info: Record<string, unknown>;
278
- original_filename: string;
279
- pages: number;
280
- path: string;
281
- placeholder: boolean;
282
- public_id: string;
283
- resource_type: 'image' | 'raw' | 'video' | 'auto';
284
- secure_url: string;
285
- signature: string;
286
- tags: string[];
287
- thumbnail_url: string;
288
- type: 'upload' | 'private' | 'authenticated';
289
- url: string;
290
- version: number;
291
- width: number;
292
- [key: string]: unknown;
293
- }
294
- type CldUploadWidgetDestroyInstanceMethodOptions = {
295
- removeThumbnails: boolean;
296
- };
297
- type CldUploadWidgetCloseInstanceMethodOptions = {
298
- quiet: boolean;
299
- };
300
- type CldUploadWidgetOpenInstanceMethodOptions = {
301
- files: CustomURL[];
302
- };
303
- type CldUploadWidgetOpenWidgetSources = 'local' | 'url' | 'camera' | 'image_search' | 'google_drive' | 'dropbox' | 'facebook' | 'instagram' | 'shutterstock' | 'getty' | 'istock' | 'unsplash' | null;
304
- type CldUploadWidgetUpdateInstanceMethodOptions = Omit<CldUploadWidgetPropsOptions, "secure" | "uploadSignature" | "getTags" | "preBatch" | "inlineContainer" | "fieldName"> & {
305
- cloudName: string;
306
- uploadPreset: string;
307
- };
308
- interface CldUploadWidgetInstanceMethods {
309
- close: (options?: CldUploadWidgetCloseInstanceMethodOptions) => void;
310
- destroy: (options?: CldUploadWidgetDestroyInstanceMethodOptions) => Promise<void>;
311
- hide: () => void;
312
- isDestroyed: () => boolean;
313
- isMinimized: () => boolean;
314
- isShowing: () => boolean;
315
- minimize: () => void;
316
- open: (widgetSource?: CldUploadWidgetOpenWidgetSources, options?: CldUploadWidgetOpenInstanceMethodOptions) => void;
317
- show: () => void;
318
- update: (options: CldUploadWidgetUpdateInstanceMethodOptions) => void;
319
- }
320
- type CldUploadWidgetError = {
321
- status: string;
322
- statusText: string;
323
- } | string | null;
324
260
  interface CldUploadWidgetProps {
325
261
  children?: ({ cloudinary, widget, open, results, error }: CldUploadWidgetPropsChildren) => JSX.Element;
326
262
  onError?: CldUploadEventCallbackError;
@@ -339,92 +275,24 @@ interface CldUploadWidgetProps {
339
275
  onSuccess?: CldUploadEventCallback;
340
276
  onTags?: CldUploadEventCallback;
341
277
  onUploadAdded?: CldUploadEventCallback;
342
- options?: CldUploadWidgetPropsOptions;
278
+ options?: CloudinaryUploadWidgetOptions;
343
279
  signatureEndpoint?: URL | RequestInfo;
344
280
  uploadPreset?: string;
345
281
  }
346
282
  type CldUploadWidgetPropsChildren = {
347
283
  cloudinary: CldUploadWidgetCloudinaryInstance;
348
284
  widget: CldUploadWidgetWidgetInstance;
349
- error?: CldUploadWidgetError;
285
+ error?: CloudinaryUploadWidgetError;
350
286
  isLoading?: boolean;
351
- results?: CldUploadWidgetResults;
352
- } & CldUploadWidgetInstanceMethods;
353
- interface CldUploadWidgetPropsOptions {
354
- encryption?: {
355
- key: string;
356
- iv: string;
357
- };
358
- defaultSource?: string;
359
- maxFiles?: number;
360
- multiple?: boolean;
361
- sources?: Array<"camera" | "dropbox" | "facebook" | "gettyimages" | "google_drive" | "image_search" | "instagram" | "istock" | "local" | "shutterstock" | "unsplash" | "url">;
362
- cropping?: boolean;
363
- croppingAspectRatio?: number;
364
- croppingCoordinatesMode?: string;
365
- croppingDefaultSelectionRatio?: number;
366
- croppingShowBackButton?: boolean;
367
- croppingShowDimensions?: boolean;
368
- showSkipCropButton?: boolean;
369
- dropboxAppKey?: string;
370
- facebookAppId?: string;
371
- googleApiKey?: string;
372
- googleDriveClientId?: string;
373
- instagramClientId?: string;
374
- searchByRights?: boolean;
375
- searchBySites?: Array<string>;
376
- context?: object;
377
- folder?: string;
378
- publicId?: string;
379
- resourceType?: string;
380
- tags?: Array<string>;
381
- uploadSignature?: string | Function;
382
- uploadSignatureTimestamp?: number;
383
- clientAllowedFormats?: Array<string>;
384
- croppingValidateDimensions?: boolean;
385
- maxChunkSize?: number;
386
- maxImageFileSize?: number;
387
- maxImageHeight?: number;
388
- maxImageWidth?: number;
389
- maxFileSize?: number;
390
- maxRawFileSize?: number;
391
- maxVideoFileSize?: number;
392
- minImageHeight?: number;
393
- minImageWidth?: number;
394
- validateMaxWidthHeight?: boolean;
395
- fieldName?: string;
396
- form?: string;
397
- thumbnails?: string;
398
- thumbnailTransformation?: string | Array<object>;
399
- buttonCaption?: string;
400
- buttonClass?: string;
401
- text?: object;
402
- theme?: string;
403
- styles?: object;
404
- autoMinimize?: boolean;
405
- getTags?: Function;
406
- getUploadPresets?: Function;
407
- inlineContainer?: any;
408
- language?: string;
409
- preBatch?: Function;
410
- prepareUploadParams?: Function;
411
- queueViewPosition?: string;
412
- showAdvancedOptions?: boolean;
413
- showCompletedButton?: boolean;
414
- showInsecurePreview?: boolean;
415
- showPoweredBy?: boolean;
416
- showUploadMoreButton?: boolean;
417
- singleUploadAutoClose?: boolean;
418
- detection?: string;
419
- on_success?: string;
420
- }
421
- type CldUploadEventCallback = (results: CldUploadWidgetResults, widget: CldUploadEventCallbackWidget) => void;
422
- type CldUploadEventCallbackNoOptions = (results: CldUploadWidgetResults, widget: CldUploadWidgetWidgetInstance) => void;
287
+ results?: CloudinaryUploadWidgetResults;
288
+ } & CloudinaryUploadWidgetInstanceMethods;
289
+ type CldUploadEventCallback = (results: CloudinaryUploadWidgetResults, widget: CldUploadEventCallbackWidget) => void;
290
+ type CldUploadEventCallbackNoOptions = (results: CloudinaryUploadWidgetResults, widget: CldUploadWidgetWidgetInstance) => void;
423
291
  type CldUploadEventCallbackWidgetOnly = (widget: CldUploadWidgetWidgetInstance) => void;
424
- type CldUploadEventCallbackError = (error: CldUploadWidgetError, widget: CldUploadWidgetWidgetInstance) => void;
292
+ type CldUploadEventCallbackError = (error: CloudinaryUploadWidgetError, widget: CldUploadWidgetWidgetInstance) => void;
425
293
  type CldUploadEventCallbackWidget = {
426
294
  widget: CldUploadWidgetWidgetInstance;
427
- } & CldUploadWidgetInstanceMethods;
295
+ } & CloudinaryUploadWidgetInstanceMethods;
428
296
 
429
297
  declare const CldUploadWidget: ({ children, onClose, onError, onOpen, onUpload, options, signatureEndpoint, uploadPreset, ...props }: CldUploadWidgetProps) => React.JSX.Element;
430
298
 
@@ -435,84 +303,6 @@ interface CldUploadButtonProps extends Omit<CldUploadWidgetProps, 'children'> {
435
303
  }
436
304
  declare const CldUploadButton: ({ className, children, onClick, onError, onOpen, onUpload, onAbort, onBatchCancelled, onClose, onDisplayChanged, onPublicId, onQueuesEnd, onQueuesStart, onRetry, onShowCompleted, onSourceChanged, onSuccess, onTags, onUploadAdded, options, signatureEndpoint, uploadPreset, ...props }: CldUploadButtonProps) => React.JSX.Element;
437
305
 
438
- interface CloudinaryVideoPlayer {
439
- on: Function;
440
- }
441
- interface CloudinaryVideoPlayerOptionsLogo {
442
- logoImageUrl?: string;
443
- logoOnclickUrl?: string;
444
- showLogo?: boolean;
445
- }
446
- interface CloudinaryVideoPlayerOptions extends CloudinaryVideoPlayerOptionsLogo {
447
- aiHighlightsGraph?: boolean;
448
- bigPlayButton?: boolean | string;
449
- colors?: CloudinaryVideoPlayerOptionsColors;
450
- controlBar?: {
451
- pictureInPictureToggle?: boolean;
452
- chaptersButton?: boolean;
453
- };
454
- controls?: boolean;
455
- floatingWhenNotVisible?: string;
456
- fluid?: boolean;
457
- fontFace?: string;
458
- hideContextMenu?: boolean;
459
- interactionAreas?: any;
460
- playbackRates?: Array<any>;
461
- playlistWidget?: {
462
- direction?: string;
463
- total?: string;
464
- };
465
- posterOptions?: CloudinaryVideoPlayerOptionPosterOptions;
466
- showJumpControls?: boolean;
467
- seekThumbnails?: boolean;
468
- videoJS?: object;
469
- autoPlay?: string | boolean | undefined;
470
- autoplay?: string | boolean | undefined;
471
- autoplayMode?: string;
472
- autoShowRecommendations?: boolean;
473
- loop?: boolean;
474
- maxTries?: Number;
475
- muted?: boolean;
476
- playedEventPercents?: number[];
477
- playedEventTimes?: null | Array<any>;
478
- playsinline?: boolean;
479
- videoTimeout?: number;
480
- withCredentials?: boolean;
481
- chapters?: object;
482
- preload?: string;
483
- publicId?: string;
484
- sourceTransformation?: object;
485
- sourceTypes?: Array<string>;
486
- transformation?: Array<object> | object;
487
- ads?: {
488
- adTagUrl?: string;
489
- adsInPlaylist?: string;
490
- showCountdown?: boolean;
491
- adLabel?: string;
492
- locale?: string;
493
- prerollTimeout?: number;
494
- postrollTimeout?: number;
495
- };
496
- analytics?: boolean;
497
- allowUsageReport?: Boolean;
498
- cloud_name?: string;
499
- cname?: string;
500
- privateCdn?: boolean;
501
- queryParams?: Record<string, string | number | boolean> | string;
502
- secure?: boolean;
503
- secureDistribution?: string;
504
- language?: string;
505
- languages?: Record<string, object>;
506
- }
507
- interface CloudinaryVideoPlayerOptionsColors {
508
- accent?: string;
509
- base?: string;
510
- text?: string;
511
- }
512
- interface CloudinaryVideoPlayerOptionPosterOptions {
513
- publicId: string;
514
- }
515
-
516
306
  /**
517
307
  * getCldImageUrl
518
308
  */
@@ -547,8 +337,6 @@ type CldVideoPlayerProps = Omit<CloudinaryVideoPlayerOptions, "cloud_name" | "au
547
337
  quality?: string | number;
548
338
  width: string | number;
549
339
  };
550
- interface CldVideoPlayerPropsColors extends CloudinaryVideoPlayerOptionsColors {
551
- }
552
340
  interface CldVideoPlayerPropsLogo {
553
341
  imageUrl?: CloudinaryVideoPlayerOptionsLogo['logoImageUrl'];
554
342
  logo?: boolean;
@@ -578,4 +366,4 @@ declare function cloudinaryLoader({ loaderOptions, imageProps, cldOptions, cldCo
578
366
  type GetCldOgImageUrlOptions = GetCldImageUrlOptions;
579
367
  declare function getCldOgImageUrl(options: GetCldOgImageUrlOptions): string;
580
368
 
581
- export { CldImage, CldImageProps, CldOgImage, CldOgImageProps, CldUploadButton, CldUploadButtonProps, CldUploadWidget, CldUploadWidgetInfo, CldUploadWidgetProps, CldUploadWidgetPropsChildren, CldUploadWidgetPropsOptions, CldUploadWidgetResults, CldVideoPlayer, CldVideoPlayerProps, CldVideoPlayerPropsColors, CldVideoPlayerPropsLogo, CloudinaryLoader, CloudinaryLoaderCldOptions, CloudinaryLoaderLoaderOptions, CloudinaryVideoPlayer, CloudinaryVideoPlayerOptions, CloudinaryVideoPlayerOptionsColors, CloudinaryVideoPlayerOptionsLogo, GetCldImageUrlAnalytics, GetCldImageUrlConfig, GetCldImageUrlOptions, GetCldOgImageUrlOptions, GetCldVideoUrlAnalytics, GetCldVideoUrlConfig, GetCldVideoUrlOptions, cloudinaryLoader, getCldImageUrl, getCldOgImageUrl, getCldVideoUrl };
369
+ export { CldImage, type CldImageProps, CldOgImage, type CldOgImageProps, CldUploadButton, type CldUploadButtonProps, CldUploadWidget, type CldUploadWidgetProps, type CldUploadWidgetPropsChildren, CldVideoPlayer, type CldVideoPlayerProps, type CldVideoPlayerPropsLogo, type CloudinaryLoader, type CloudinaryLoaderCldOptions, type CloudinaryLoaderLoaderOptions, type GetCldImageUrlAnalytics, type GetCldImageUrlConfig, type GetCldImageUrlOptions, type GetCldOgImageUrlOptions, type GetCldVideoUrlAnalytics, type GetCldVideoUrlConfig, type GetCldVideoUrlOptions, cloudinaryLoader, getCldImageUrl, getCldOgImageUrl, getCldVideoUrl };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import * as _cloudinary_url_gen_config_interfaces_Config_ICloudinaryConfigurations from '@cloudinary/url-gen/config/interfaces/Config/ICloudinaryConfigurations';
1
+ import * as _cloudinary_util_url_loader_dist_schema_UX7RRFIR from '@cloudinary-util/url-loader/dist/schema-UX7RRFIR';
2
2
  import React, { MutableRefObject } from 'react';
3
3
  import { ImageProps } from 'next/image';
4
4
  import { ImageOptions, ConfigOptions, AnalyticsOptions, VideoOptions } from '@cloudinary-util/url-loader';
5
+ import { CloudinaryUploadWidgetOptions, CloudinaryUploadWidgetError, CloudinaryUploadWidgetResults, CloudinaryUploadWidgetInstanceMethods, CloudinaryVideoPlayerOptions, CloudinaryVideoPlayer, CloudinaryVideoPlayerOptionsLogo } from '@cloudinary-util/types';
6
+ export { CloudinaryUploadWidgetError, CloudinaryUploadWidgetInfo, CloudinaryUploadWidgetInstanceMethodCloseOptions, CloudinaryUploadWidgetInstanceMethodDestroyOptions, CloudinaryUploadWidgetInstanceMethodOpenOptions, CloudinaryUploadWidgetInstanceMethodUpdateOptions, CloudinaryUploadWidgetInstanceMethods, CloudinaryUploadWidgetOptions, CloudinaryUploadWidgetResults, CloudinaryUploadWidgetSources, CloudinaryVideoPlayer, CloudinaryVideoPlayerOptions, CloudinaryVideoPlayerOptionsColors, CloudinaryVideoPlayerOptionsLogo } from '@cloudinary-util/types';
5
7
 
6
8
  type CldImageProps = Omit<ImageProps, 'src'> & ImageOptions & {
7
9
  config?: ConfigOptions;
@@ -240,7 +242,7 @@ declare const CldImage: React.ForwardRefExoticComponent<Omit<ImageProps, "src">
240
242
  } | undefined;
241
243
  defaultImage?: string | undefined;
242
244
  } & {
243
- config?: _cloudinary_url_gen_config_interfaces_Config_ICloudinaryConfigurations.default | undefined;
245
+ config?: _cloudinary_util_url_loader_dist_schema_UX7RRFIR.g | undefined;
244
246
  preserveTransformations?: boolean | undefined;
245
247
  src: string;
246
248
  unoptimized?: boolean | undefined;
@@ -255,72 +257,6 @@ declare const CldOgImage: ({ excludeTags, twitterTitle, keys, ...props }: CldOgI
255
257
 
256
258
  type CldUploadWidgetCloudinaryInstance = any;
257
259
  type CldUploadWidgetWidgetInstance = any;
258
- type CustomURL = `https://${string}.${string}`;
259
- interface CldUploadWidgetResults {
260
- event?: string;
261
- info?: string | CldUploadWidgetInfo;
262
- }
263
- interface CldUploadWidgetInfo {
264
- access_mode: 'public' | 'authenticated';
265
- api_key: string;
266
- asset_id: string;
267
- batchId: string;
268
- bytes: number;
269
- context: Record<string, Record<string, string>>;
270
- created_at: string;
271
- etag: string;
272
- folder: string;
273
- format: string;
274
- height: number;
275
- hook_execution: Record<string, unknown>;
276
- id: string;
277
- info: Record<string, unknown>;
278
- original_filename: string;
279
- pages: number;
280
- path: string;
281
- placeholder: boolean;
282
- public_id: string;
283
- resource_type: 'image' | 'raw' | 'video' | 'auto';
284
- secure_url: string;
285
- signature: string;
286
- tags: string[];
287
- thumbnail_url: string;
288
- type: 'upload' | 'private' | 'authenticated';
289
- url: string;
290
- version: number;
291
- width: number;
292
- [key: string]: unknown;
293
- }
294
- type CldUploadWidgetDestroyInstanceMethodOptions = {
295
- removeThumbnails: boolean;
296
- };
297
- type CldUploadWidgetCloseInstanceMethodOptions = {
298
- quiet: boolean;
299
- };
300
- type CldUploadWidgetOpenInstanceMethodOptions = {
301
- files: CustomURL[];
302
- };
303
- type CldUploadWidgetOpenWidgetSources = 'local' | 'url' | 'camera' | 'image_search' | 'google_drive' | 'dropbox' | 'facebook' | 'instagram' | 'shutterstock' | 'getty' | 'istock' | 'unsplash' | null;
304
- type CldUploadWidgetUpdateInstanceMethodOptions = Omit<CldUploadWidgetPropsOptions, "secure" | "uploadSignature" | "getTags" | "preBatch" | "inlineContainer" | "fieldName"> & {
305
- cloudName: string;
306
- uploadPreset: string;
307
- };
308
- interface CldUploadWidgetInstanceMethods {
309
- close: (options?: CldUploadWidgetCloseInstanceMethodOptions) => void;
310
- destroy: (options?: CldUploadWidgetDestroyInstanceMethodOptions) => Promise<void>;
311
- hide: () => void;
312
- isDestroyed: () => boolean;
313
- isMinimized: () => boolean;
314
- isShowing: () => boolean;
315
- minimize: () => void;
316
- open: (widgetSource?: CldUploadWidgetOpenWidgetSources, options?: CldUploadWidgetOpenInstanceMethodOptions) => void;
317
- show: () => void;
318
- update: (options: CldUploadWidgetUpdateInstanceMethodOptions) => void;
319
- }
320
- type CldUploadWidgetError = {
321
- status: string;
322
- statusText: string;
323
- } | string | null;
324
260
  interface CldUploadWidgetProps {
325
261
  children?: ({ cloudinary, widget, open, results, error }: CldUploadWidgetPropsChildren) => JSX.Element;
326
262
  onError?: CldUploadEventCallbackError;
@@ -339,92 +275,24 @@ interface CldUploadWidgetProps {
339
275
  onSuccess?: CldUploadEventCallback;
340
276
  onTags?: CldUploadEventCallback;
341
277
  onUploadAdded?: CldUploadEventCallback;
342
- options?: CldUploadWidgetPropsOptions;
278
+ options?: CloudinaryUploadWidgetOptions;
343
279
  signatureEndpoint?: URL | RequestInfo;
344
280
  uploadPreset?: string;
345
281
  }
346
282
  type CldUploadWidgetPropsChildren = {
347
283
  cloudinary: CldUploadWidgetCloudinaryInstance;
348
284
  widget: CldUploadWidgetWidgetInstance;
349
- error?: CldUploadWidgetError;
285
+ error?: CloudinaryUploadWidgetError;
350
286
  isLoading?: boolean;
351
- results?: CldUploadWidgetResults;
352
- } & CldUploadWidgetInstanceMethods;
353
- interface CldUploadWidgetPropsOptions {
354
- encryption?: {
355
- key: string;
356
- iv: string;
357
- };
358
- defaultSource?: string;
359
- maxFiles?: number;
360
- multiple?: boolean;
361
- sources?: Array<"camera" | "dropbox" | "facebook" | "gettyimages" | "google_drive" | "image_search" | "instagram" | "istock" | "local" | "shutterstock" | "unsplash" | "url">;
362
- cropping?: boolean;
363
- croppingAspectRatio?: number;
364
- croppingCoordinatesMode?: string;
365
- croppingDefaultSelectionRatio?: number;
366
- croppingShowBackButton?: boolean;
367
- croppingShowDimensions?: boolean;
368
- showSkipCropButton?: boolean;
369
- dropboxAppKey?: string;
370
- facebookAppId?: string;
371
- googleApiKey?: string;
372
- googleDriveClientId?: string;
373
- instagramClientId?: string;
374
- searchByRights?: boolean;
375
- searchBySites?: Array<string>;
376
- context?: object;
377
- folder?: string;
378
- publicId?: string;
379
- resourceType?: string;
380
- tags?: Array<string>;
381
- uploadSignature?: string | Function;
382
- uploadSignatureTimestamp?: number;
383
- clientAllowedFormats?: Array<string>;
384
- croppingValidateDimensions?: boolean;
385
- maxChunkSize?: number;
386
- maxImageFileSize?: number;
387
- maxImageHeight?: number;
388
- maxImageWidth?: number;
389
- maxFileSize?: number;
390
- maxRawFileSize?: number;
391
- maxVideoFileSize?: number;
392
- minImageHeight?: number;
393
- minImageWidth?: number;
394
- validateMaxWidthHeight?: boolean;
395
- fieldName?: string;
396
- form?: string;
397
- thumbnails?: string;
398
- thumbnailTransformation?: string | Array<object>;
399
- buttonCaption?: string;
400
- buttonClass?: string;
401
- text?: object;
402
- theme?: string;
403
- styles?: object;
404
- autoMinimize?: boolean;
405
- getTags?: Function;
406
- getUploadPresets?: Function;
407
- inlineContainer?: any;
408
- language?: string;
409
- preBatch?: Function;
410
- prepareUploadParams?: Function;
411
- queueViewPosition?: string;
412
- showAdvancedOptions?: boolean;
413
- showCompletedButton?: boolean;
414
- showInsecurePreview?: boolean;
415
- showPoweredBy?: boolean;
416
- showUploadMoreButton?: boolean;
417
- singleUploadAutoClose?: boolean;
418
- detection?: string;
419
- on_success?: string;
420
- }
421
- type CldUploadEventCallback = (results: CldUploadWidgetResults, widget: CldUploadEventCallbackWidget) => void;
422
- type CldUploadEventCallbackNoOptions = (results: CldUploadWidgetResults, widget: CldUploadWidgetWidgetInstance) => void;
287
+ results?: CloudinaryUploadWidgetResults;
288
+ } & CloudinaryUploadWidgetInstanceMethods;
289
+ type CldUploadEventCallback = (results: CloudinaryUploadWidgetResults, widget: CldUploadEventCallbackWidget) => void;
290
+ type CldUploadEventCallbackNoOptions = (results: CloudinaryUploadWidgetResults, widget: CldUploadWidgetWidgetInstance) => void;
423
291
  type CldUploadEventCallbackWidgetOnly = (widget: CldUploadWidgetWidgetInstance) => void;
424
- type CldUploadEventCallbackError = (error: CldUploadWidgetError, widget: CldUploadWidgetWidgetInstance) => void;
292
+ type CldUploadEventCallbackError = (error: CloudinaryUploadWidgetError, widget: CldUploadWidgetWidgetInstance) => void;
425
293
  type CldUploadEventCallbackWidget = {
426
294
  widget: CldUploadWidgetWidgetInstance;
427
- } & CldUploadWidgetInstanceMethods;
295
+ } & CloudinaryUploadWidgetInstanceMethods;
428
296
 
429
297
  declare const CldUploadWidget: ({ children, onClose, onError, onOpen, onUpload, options, signatureEndpoint, uploadPreset, ...props }: CldUploadWidgetProps) => React.JSX.Element;
430
298
 
@@ -435,84 +303,6 @@ interface CldUploadButtonProps extends Omit<CldUploadWidgetProps, 'children'> {
435
303
  }
436
304
  declare const CldUploadButton: ({ className, children, onClick, onError, onOpen, onUpload, onAbort, onBatchCancelled, onClose, onDisplayChanged, onPublicId, onQueuesEnd, onQueuesStart, onRetry, onShowCompleted, onSourceChanged, onSuccess, onTags, onUploadAdded, options, signatureEndpoint, uploadPreset, ...props }: CldUploadButtonProps) => React.JSX.Element;
437
305
 
438
- interface CloudinaryVideoPlayer {
439
- on: Function;
440
- }
441
- interface CloudinaryVideoPlayerOptionsLogo {
442
- logoImageUrl?: string;
443
- logoOnclickUrl?: string;
444
- showLogo?: boolean;
445
- }
446
- interface CloudinaryVideoPlayerOptions extends CloudinaryVideoPlayerOptionsLogo {
447
- aiHighlightsGraph?: boolean;
448
- bigPlayButton?: boolean | string;
449
- colors?: CloudinaryVideoPlayerOptionsColors;
450
- controlBar?: {
451
- pictureInPictureToggle?: boolean;
452
- chaptersButton?: boolean;
453
- };
454
- controls?: boolean;
455
- floatingWhenNotVisible?: string;
456
- fluid?: boolean;
457
- fontFace?: string;
458
- hideContextMenu?: boolean;
459
- interactionAreas?: any;
460
- playbackRates?: Array<any>;
461
- playlistWidget?: {
462
- direction?: string;
463
- total?: string;
464
- };
465
- posterOptions?: CloudinaryVideoPlayerOptionPosterOptions;
466
- showJumpControls?: boolean;
467
- seekThumbnails?: boolean;
468
- videoJS?: object;
469
- autoPlay?: string | boolean | undefined;
470
- autoplay?: string | boolean | undefined;
471
- autoplayMode?: string;
472
- autoShowRecommendations?: boolean;
473
- loop?: boolean;
474
- maxTries?: Number;
475
- muted?: boolean;
476
- playedEventPercents?: number[];
477
- playedEventTimes?: null | Array<any>;
478
- playsinline?: boolean;
479
- videoTimeout?: number;
480
- withCredentials?: boolean;
481
- chapters?: object;
482
- preload?: string;
483
- publicId?: string;
484
- sourceTransformation?: object;
485
- sourceTypes?: Array<string>;
486
- transformation?: Array<object> | object;
487
- ads?: {
488
- adTagUrl?: string;
489
- adsInPlaylist?: string;
490
- showCountdown?: boolean;
491
- adLabel?: string;
492
- locale?: string;
493
- prerollTimeout?: number;
494
- postrollTimeout?: number;
495
- };
496
- analytics?: boolean;
497
- allowUsageReport?: Boolean;
498
- cloud_name?: string;
499
- cname?: string;
500
- privateCdn?: boolean;
501
- queryParams?: Record<string, string | number | boolean> | string;
502
- secure?: boolean;
503
- secureDistribution?: string;
504
- language?: string;
505
- languages?: Record<string, object>;
506
- }
507
- interface CloudinaryVideoPlayerOptionsColors {
508
- accent?: string;
509
- base?: string;
510
- text?: string;
511
- }
512
- interface CloudinaryVideoPlayerOptionPosterOptions {
513
- publicId: string;
514
- }
515
-
516
306
  /**
517
307
  * getCldImageUrl
518
308
  */
@@ -547,8 +337,6 @@ type CldVideoPlayerProps = Omit<CloudinaryVideoPlayerOptions, "cloud_name" | "au
547
337
  quality?: string | number;
548
338
  width: string | number;
549
339
  };
550
- interface CldVideoPlayerPropsColors extends CloudinaryVideoPlayerOptionsColors {
551
- }
552
340
  interface CldVideoPlayerPropsLogo {
553
341
  imageUrl?: CloudinaryVideoPlayerOptionsLogo['logoImageUrl'];
554
342
  logo?: boolean;
@@ -578,4 +366,4 @@ declare function cloudinaryLoader({ loaderOptions, imageProps, cldOptions, cldCo
578
366
  type GetCldOgImageUrlOptions = GetCldImageUrlOptions;
579
367
  declare function getCldOgImageUrl(options: GetCldOgImageUrlOptions): string;
580
368
 
581
- export { CldImage, CldImageProps, CldOgImage, CldOgImageProps, CldUploadButton, CldUploadButtonProps, CldUploadWidget, CldUploadWidgetInfo, CldUploadWidgetProps, CldUploadWidgetPropsChildren, CldUploadWidgetPropsOptions, CldUploadWidgetResults, CldVideoPlayer, CldVideoPlayerProps, CldVideoPlayerPropsColors, CldVideoPlayerPropsLogo, CloudinaryLoader, CloudinaryLoaderCldOptions, CloudinaryLoaderLoaderOptions, CloudinaryVideoPlayer, CloudinaryVideoPlayerOptions, CloudinaryVideoPlayerOptionsColors, CloudinaryVideoPlayerOptionsLogo, GetCldImageUrlAnalytics, GetCldImageUrlConfig, GetCldImageUrlOptions, GetCldOgImageUrlOptions, GetCldVideoUrlAnalytics, GetCldVideoUrlConfig, GetCldVideoUrlOptions, cloudinaryLoader, getCldImageUrl, getCldOgImageUrl, getCldVideoUrl };
369
+ export { CldImage, type CldImageProps, CldOgImage, type CldOgImageProps, CldUploadButton, type CldUploadButtonProps, CldUploadWidget, type CldUploadWidgetProps, type CldUploadWidgetPropsChildren, CldVideoPlayer, type CldVideoPlayerProps, type CldVideoPlayerPropsLogo, type CloudinaryLoader, type CloudinaryLoaderCldOptions, type CloudinaryLoaderLoaderOptions, type GetCldImageUrlAnalytics, type GetCldImageUrlConfig, type GetCldImageUrlOptions, type GetCldOgImageUrlOptions, type GetCldVideoUrlAnalytics, type GetCldVideoUrlConfig, type GetCldVideoUrlOptions, cloudinaryLoader, getCldImageUrl, getCldOgImageUrl, getCldVideoUrl };