mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2026-04-06 07:46:05 +00:00
index
This commit is contained in:
@@ -21,6 +21,7 @@ export interface ImageProps extends Omit<HTMLAttributes<'img'>, 'src'> {
|
||||
layout?: Layout;
|
||||
widths?: number[] | null;
|
||||
aspectRatio?: string | number | null;
|
||||
objectPosition?: string;
|
||||
}
|
||||
|
||||
export type ImagesOptimizer = (
|
||||
@@ -259,7 +260,18 @@ export const unpicOptimizer: ImagesOptimizer = async (image, breakpoints, width,
|
||||
/* ** */
|
||||
export async function getImagesOptimized(
|
||||
image: ImageMetadata | string,
|
||||
{ src: _, width, height, sizes, aspectRatio, widths, layout = 'constrained', style = '', ...rest }: ImageProps,
|
||||
{
|
||||
src: _,
|
||||
width,
|
||||
height,
|
||||
sizes,
|
||||
aspectRatio,
|
||||
objectPosition,
|
||||
widths,
|
||||
layout = 'constrained',
|
||||
style = '',
|
||||
...rest
|
||||
}: ImageProps,
|
||||
transform: ImagesOptimizer = () => Promise.resolve([])
|
||||
): Promise<{ src: string; attributes: HTMLAttributes<'img'> }> {
|
||||
if (typeof image !== 'string') {
|
||||
@@ -315,6 +327,7 @@ export async function getImagesOptimized(
|
||||
width: width,
|
||||
height: height,
|
||||
aspectRatio: aspectRatio,
|
||||
objectPosition: objectPosition,
|
||||
layout: layout,
|
||||
})}${style ?? ''}`,
|
||||
...rest,
|
||||
|
||||
Reference in New Issue
Block a user