UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

41 lines 1.7 kB
import { toBaseImageDescriptors } from '../BaseImage'; import type { BaseImageProps } from '../BaseImage'; import type { Dimensions } from '../../types/types'; export type GalleryItem = Omit<BaseImageProps, 'src'> & { dimensions?: Dimensions; imageUrl?: string; videoThumbnailUrl?: string; videoUrl?: string; }; /** * Maps an attachment (or link preview) to gallery item fields. * Delegates to {@link toBaseImageDescriptors}. */ export declare const toGalleryItemDescriptors: (...args: Parameters<typeof toBaseImageDescriptors>) => Pick<GalleryItem, "alt" | "dimensions" | "imageUrl" | "title" | "videoThumbnailUrl" | "videoUrl"> | undefined; export type GalleryContextValue = { /** Whether clicking the empty gallery background should request close */ closeOnBackgroundClick: boolean; /** Currently displayed item index */ currentIndex: number; /** Currently displayed item */ currentItem: GalleryItem; /** Navigate to a specific index */ goToIndex: (index: number) => void; /** Navigate to the next item */ goToNext: () => void; /** Navigate to the previous item */ goToPrevious: () => void; /** Whether there is a next item */ hasNext: boolean; /** Whether there is a previous item */ hasPrevious: boolean; /** Total number of items */ itemCount: number; /** All items in the gallery */ items: GalleryItem[]; /** Request closing the gallery viewer */ onRequestClose?: () => void; }; export declare const GalleryContext: import("react").Context<GalleryContextValue | undefined>; export declare const useGalleryContext: () => GalleryContextValue; //# sourceMappingURL=GalleryContext.d.ts.map