From 10c6ac4acc2a2ddcb17aad239bce47700babc671 Mon Sep 17 00:00:00 2001 From: Ovindu Atukorala Date: Wed, 2 Oct 2024 18:07:55 +0530 Subject: [PATCH] feat: add jsdoc descriptions to the helpers (#149) Co-authored-by: Willow (GHOST) --- .changeset/young-news-fold.md | 5 +++++ .../src/helpers/getCldImageUrl.ts | 20 +++++++++++++++++++ .../src/helpers/getCldOgImageUrl.ts | 18 +++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .changeset/young-news-fold.md diff --git a/.changeset/young-news-fold.md b/.changeset/young-news-fold.md new file mode 100644 index 00000000..2a6c8aa2 --- /dev/null +++ b/.changeset/young-news-fold.md @@ -0,0 +1,5 @@ +--- +"svelte-cloudinary": minor +--- + +feat: add jsdoc descriptions to the helpers diff --git a/packages/svelte-cloudinary/src/helpers/getCldImageUrl.ts b/packages/svelte-cloudinary/src/helpers/getCldImageUrl.ts index 7daa75a7..a41217a8 100644 --- a/packages/svelte-cloudinary/src/helpers/getCldImageUrl.ts +++ b/packages/svelte-cloudinary/src/helpers/getCldImageUrl.ts @@ -6,6 +6,26 @@ import { type ImageOptions, } from '@cloudinary-util/url-loader'; +/** + * This can be used to get a Cloudinary image URL outside the component. + * + * This helper provides a wide range of options for being able to easily optimize and transform images. + * + * @see https://svelte.cloudinary.dev/helpers/getcldimageurl/configuration + * + * @example + * + */ export function getCldImageUrl( options: ImageOptions, configOverride?: ConfigOptions, diff --git a/packages/svelte-cloudinary/src/helpers/getCldOgImageUrl.ts b/packages/svelte-cloudinary/src/helpers/getCldOgImageUrl.ts index 4090de59..e2d560f1 100644 --- a/packages/svelte-cloudinary/src/helpers/getCldOgImageUrl.ts +++ b/packages/svelte-cloudinary/src/helpers/getCldOgImageUrl.ts @@ -5,6 +5,24 @@ import type { ImageOptions, } from '@cloudinary-util/url-loader'; +/** + * This can be used to get a Cloudinary Open Graph image URL outside the component. This helper + * provides a wide range of options for being able to easily generate social card images and has + * sensible defaults, such as a width and height. + * + * @see https://svelte.cloudinary.dev/helpers/getcldogimageurl/configuration + * + * @example + * + */ export function getCldOgImageUrl( options: ImageOptions, configOverride?: ConfigOptions,