Skip to content

Commit

Permalink
some jsdocs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Dec 6, 2023
1 parent d0cbd0a commit c89d499
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 9 additions & 1 deletion packages/gatsby-plugin-utils/src/polyfill-remote-file/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions packages/gatsby/src/utils/adapter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c89d499

Please sign in to comment.