From c89d499c5a8018c7488f2a17eb21b929f16e66e7 Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Wed, 6 Dec 2023 09:07:34 +0100 Subject: [PATCH] some jsdocs updates --- .../src/polyfill-remote-file/types.ts | 10 +++++++++- packages/gatsby/src/utils/adapter/types.ts | 5 +---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/gatsby-plugin-utils/src/polyfill-remote-file/types.ts b/packages/gatsby-plugin-utils/src/polyfill-remote-file/types.ts index 3479b51ebe6d1..f6cea08de015a 100644 --- a/packages/gatsby-plugin-utils/src/polyfill-remote-file/types.ts +++ b/packages/gatsby-plugin-utils/src/polyfill-remote-file/types.ts @@ -128,7 +128,15 @@ export type ImageCdnUrlGeneratorFn = ( export type FileCdnSourceImage = CdnSourceImage +/** + * The function is used to optimize image delivery by generating URLs that leverage CDN capabilities + * @param {FileCdnSourceImage} source - An object representing the source file, including properties like + * URL, filename, and MIME type. + * @param {string} pathPrefix - A string representing the path prefix to be prepended to the + * generated URL. + * @returns {string} A string representing the generated URL for the file on the CDN. + */ export type FileCdnUrlGeneratorFn = ( - source: ImageCdnSourceImage, + source: FileCdnSourceImage, pathPrefix: string ) => string diff --git a/packages/gatsby/src/utils/adapter/types.ts b/packages/gatsby/src/utils/adapter/types.ts index 4cb15f935f23d..d5f7b8d1a617b 100644 --- a/packages/gatsby/src/utils/adapter/types.ts +++ b/packages/gatsby/src/utils/adapter/types.ts @@ -176,10 +176,7 @@ export interface IAdapterConfig { */ imageCDNUrlGeneratorModulePath?: string /** - * @todo: specify that image cdn does image transformation (like resizing) while file cdn does not - * (but might do content negotiation) - * Path to a CommonJS module that implements an file CDN URL generation function. The function - * is used to optimize image delivery by generating URLs that leverage CDN capabilities. This module + * Path to a CommonJS module that implements an file CDN URL generation function. This module * should have a default export function that conforms to the {@link FileCdnUrlGeneratorFn} type: * * Adapters should provide an absolute path to this module.