File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
packages/svelte-cloudinary/src/helpers Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " svelte-cloudinary " : minor
3+ ---
4+
5+ feat: add jsdoc descriptions to the helpers
Original file line number Diff line number Diff line change @@ -6,6 +6,26 @@ import {
66 type ImageOptions ,
77} from '@cloudinary-util/url-loader' ;
88
9+ /**
10+ * This can be used to get a Cloudinary image URL outside the component.
11+ *
12+ * This helper provides a wide range of options for being able to easily optimize and transform images.
13+ *
14+ * @see https://svelte.cloudinary.dev/helpers/getcldimageurl/configuration
15+ *
16+ * @example
17+ * <script>
18+ * import { getCldImageUrl } from 'svelte-cloudinary';
19+ *
20+ * const url = getCldImageUrl({
21+ * src: 'samples/sea-turtle', // The public ID of the image in Cloudinary
22+ * height: 600, // The desired height of the image
23+ * width: 960, // The desired width of the image
24+ * });
25+ *
26+ * console.log(url); // This outputs Cloudinary URL
27+ * </script>
28+ */
929export function getCldImageUrl (
1030 options : ImageOptions ,
1131 configOverride ?: ConfigOptions ,
Original file line number Diff line number Diff line change @@ -5,6 +5,24 @@ import type {
55 ImageOptions ,
66} from '@cloudinary-util/url-loader' ;
77
8+ /**
9+ * This can be used to get a Cloudinary Open Graph image URL outside the component. This helper
10+ * provides a wide range of options for being able to easily generate social card images and has
11+ * sensible defaults, such as a width and height.
12+ *
13+ * @see https://svelte.cloudinary.dev/helpers/getcldogimageurl/configuration
14+ *
15+ * @example
16+ * <script>
17+ * import { getCldOgImageUrl } from 'svelte-cloudinary';
18+ *
19+ * const url = getCldOgImageUrl({
20+ * src: 'samples/sea-turtle', // The public ID of the image in Cloudinary
21+ * });
22+ *
23+ * console.log(url); // Outputs the Cloudinary OG image URL with the specified src
24+ * </script>
25+ */
826export function getCldOgImageUrl (
927 options : ImageOptions ,
1028 configOverride ?: ConfigOptions ,
You can’t perform that action at this time.
0 commit comments