File tree 3 files changed +43
-0
lines changed
packages/svelte-cloudinary/src/helpers 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 {
6
6
type ImageOptions ,
7
7
} from '@cloudinary-util/url-loader' ;
8
8
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
+ */
9
29
export function getCldImageUrl (
10
30
options : ImageOptions ,
11
31
configOverride ?: ConfigOptions ,
Original file line number Diff line number Diff line change @@ -5,6 +5,24 @@ import type {
5
5
ImageOptions ,
6
6
} from '@cloudinary-util/url-loader' ;
7
7
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
+ */
8
26
export function getCldOgImageUrl (
9
27
options : ImageOptions ,
10
28
configOverride ?: ConfigOptions ,
You can’t perform that action at this time.
0 commit comments