react-gallery-layouts
Version:
React gallery layouts library with masonry, stack, grid, and justified layouts
27 lines (26 loc) • 1.15 kB
TypeScript
import { GalleryColumns, GalleryGutter, GalleryItem, WindowSize } from './types';
/**
* Calculate aspect ratio from width and height
*/
export declare const calculateAspectRatio: (width: number, height: number) => number;
/**
* Normalize all items to ensure they have aspect ratio
*/
export declare const normalizeItems: (items: GalleryItem[]) => GalleryItem[];
/**
* Calculate width for an item given a target height and aspect ratio
*/
export declare const calculateWidth: (height: number, aspectRatio: number) => number;
/**
* Calculate height for an item given a target width and aspect ratio
*/
export declare const calculateHeight: (width: number, aspectRatio: number) => number;
/**
* Determine how many columns to use based on responsive settings
*/
export declare const getColumnsCount: (columns: GalleryColumns | undefined, windowSize: WindowSize) => number;
/**
* Determine how many columns to use based on responsive settings
*/
export declare const getGutter: (gutter: GalleryGutter | undefined, windowSize: WindowSize) => number;
export declare const debounce: (func: Function, delay: number) => (...args: any[]) => void;