import { MouseEvent, CSSProperties, ReactNode, ComponentType } from "react"; type Key = string | number; export interface ImageTag { value: ReactNode; title: string; key?: Key; } export interface Image { key?: Key; src: string; width: number; height: number; nano?: string; alt?: string; tags?: ImageTag[]; isSelected?: boolean; caption?: ReactNode; customOverlay?: ReactNode; thumbnailCaption?: ReactNode; orientation?: number; } export type ImageExtended = T & { scaledWidth: number; scaledHeight: number; viewportWidth: number; marginLeft: number; }; export interface BuildLayoutOptions { containerWidth: number; maxRows?: number; rowHeight?: number; margin?: number; } export type ImageExtendedRow = ImageExtended[]; export type EventHandler = ( index: number, item: T, event: MouseEvent ) => void; export type StyleFunctionContext = { item: T; }; export type StyleFunction = ( context: StyleFunctionContext ) => CSSProperties; export type StyleProp = | CSSProperties | StyleFunction; export interface ImageProps { item: T; index: number; margin: number; isSelectable: boolean; onClick: (index: number, event: MouseEvent) => void; onSelect: (index: number, event: MouseEvent) => void; tileViewportStyle: StyleProp; thumbnailStyle: StyleProp; tagStyle: StyleProp; height?: number; thumbnailImageComponent?: ComponentType; } export interface ThumbnailImageComponentImageProps { key: string | number; src: string; alt: string; title: string | null; style: CSSProperties; } export type ThumbnailImageProps = ImageProps & { imageProps: ThumbnailImageComponentImageProps; }; export interface GalleryProps { images: T[]; id?: string; enableImageSelection?: boolean; onSelect?: EventHandler; rowHeight?: number; maxRows?: number; margin?: number; defaultContainerWidth?: number; onClick?: EventHandler; tileViewportStyle?: StyleProp; thumbnailStyle?: StyleProp; tagStyle?: StyleProp; thumbnailImageComponent?: ComponentType; } export interface CheckButtonProps { isSelected: boolean; isVisible: boolean; onClick: (event: MouseEvent) => void; color?: string; selectedColor?: string; hoverColor?: string; }