/** * SharePoint Framework helper library to generate image urls optimized for delivery. * * @packagedocumentation */ import type { _IPreloadedData } from '@microsoft/sp-loader'; import { ServiceScope } from '@microsoft/sp-core-library'; import { SPResourcePath as _SPResourcePath } from '@msinternal/odsp-datasources/lib/Thumbnail'; import { _SPResourcePathFormat } from '@msinternal/odsp-datasources/lib/Thumbnail'; import { ThumbnailProviderType as _ThumbnailProviderType } from '@msinternal/odsp-datasources/lib/Thumbnail'; import { UserPhotoSize as _UserPhotoSize } from '@msinternal/odsp-utilities/lib/alternativeUrls/SPAlternativeUrls'; /* Excluded from this release type: _CACHE_BREAKPOINT_S */ /* Excluded from this release type: _CACHE_BREAKPOINT_XL */ /* Excluded from this release type: _CropMode */ /* Excluded from this release type: _getDeformationThumbnailWidth */ /** * Interface for constructing a request to create an optimized image url from a file on SharePoint. * * @public */ export declare interface IImageHelperRequest { /** * The url to the item to be retrieved as an image. This can be an absolute url or a relative url. */ sourceUrl: string; /** * Width of the image requested. * * @remarks * When the height is unspecified, the width is mapped to nearest larger resolution breakpoint with a maximum size. */ width: number; /** * Optional height of the image requested * * @remarks * By default, the image height would be based on the width while maintaining the aspect ratio for the image. (This provides the image with the quickest response.) * When the height is specified, the width is not adjusted to the nearest larger resolution breakpoint. */ height?: number; /** * guid generated for image to use as param to avoid caching from api on adv edited images */ cacheBuster?: string; } /** * ImageHelper exposes the ability to convert a SharePoint url to an optimized thumbnail url. * @public */ export declare class ImageHelper { /** * Convert a url to a file or page on SharePoint into an optimized image url. * * @param request - IImageHelperRequest for the bundled parameters. * * @remarks * - If width and height are provided, then the resulting image will be scaled to the minimum of the width or height. * - The url will be most performant if only a width is provided. If a height is provided, the image will take longer to download due to the scaling. * - Only use this url at rendering time. It may contain an expiration token. Continue to use the original file's url for serialization. * * @returns A full url string for the image of the file. If no optimized url can be created (i.e. an external url or an unsupported file type), * the original sourceUrl is returned. * * @public */ static convertToImageUrl(request: IImageHelperRequest): string; } /* Excluded from this release type: _IPreloadedData */ /* Excluded from this release type: _IThumbnailDimension */ /* Excluded from this release type: _IThumbnailRequest */ /* Excluded from this release type: _PreviewHelper */ /* Excluded from this release type: _PreviewUtility */ /* Excluded from this release type: _SPResourcePath */ /* Excluded from this release type: _SPResourcePathFormat */ /* Excluded from this release type: _ThumbnailProviderType */ /* Excluded from this release type: _ThumbnailUrlGenerator */ /* Excluded from this release type: _ThumbnailUrlGeneratorClass */ export { _UserPhotoSize } export { }