import * as React from 'react';
import React__default from 'react';

/**
 * Props for the Masonry component
 */
type MasonryProps = React.ComponentProps<"div"> & {
    /**
     * The width of each column in pixels.
     * @default 200
     */
    columnWidth?: number;
    /**
     * Fixed number of columns. Takes precedence over `columnWidth` if provided.
     */
    columnCount?: number;
    /**
     * Maximum number of columns allowed. Useful for responsive layouts.
     */
    maxColumnCount?: number;
    /**
     * Gap between items. Can be a single number for uniform spacing or an object
     * with separate `column` and `row` gaps.
     * @default 16
     * @example
     * gap={20}
     * gap={{ column: 16, row: 24 }}
     */
    gap?: number | {
        column: number;
        row: number;
    };
    /**
     * Default height for items before they are measured. Used for initial layout calculations.
     * @default 300
     */
    itemHeight?: number;
    /**
     * Default container width used during SSR or before first measurement.
     */
    defaultWidth?: number;
    /**
     * Default container height used during SSR or before first measurement.
     */
    defaultHeight?: number;
    /**
     * Number of pixels to render outside the visible viewport for smoother scrolling.
     * @default 200
     */
    overscan?: number;
    /**
     * Scroll event sampling rate in frames per second. Higher values provide smoother
     * updates but may impact performance.
     * @default 12
     */
    scrollFps?: number;
    /**
     * Content to display while items are being measured or loaded.
     */
    fallback?: React.ReactNode;
    /**
     * When `true`, items are positioned linearly (left-to-right, top-to-bottom)
     * instead of using the default masonry algorithm that fills shortest columns first.
     * @default false
     */
    linear?: boolean;
    /**
     * When `true`, renders the component as its child element using Radix UI's Slot.
     * @default false
     */
    asChild?: boolean;
};
type MasonryElement = React.ComponentRef<"div">;
/**
 * A performant masonry layout component that efficiently arranges items of varying heights
 * into columns. Features virtualization, resize observation, and smooth scrolling performance.
 *
 * @component
 * @example
 * // Basic usage
 * <Masonry>
 *   {items.map((item, index) => (
 *     <Masonry.Item key={index}>
 *       <img src={item.url} alt={item.title} />
 *     </Masonry.Item>
 *   ))}
 * </Masonry>
 *
 * @example
 * // Custom column width and gap
 * <Masonry columnWidth={250} gap={{ column: 20, row: 30 }}>
 *   {items.map((item, index) => (
 *     <Masonry.Item key={index}>
 *       <Card>{item.content}</Card>
 *     </Masonry.Item>
 *   ))}
 * </Masonry>
 *
 * @example
 * // Fixed number of columns with linear positioning
 * <Masonry columnCount={3} linear>
 *   {items.map((item, index) => (
 *     <Masonry.Item key={index}>
 *       {item.content}
 *     </Masonry.Item>
 *   ))}
 * </Masonry>
 *
 * @example
 * // With fallback content
 * <Masonry fallback={<Spinner />}>
 *   {items.map((item, index) => (
 *     <Masonry.Item key={index}>
 *       <LazyImage src={item.url} />
 *     </Masonry.Item>
 *   ))}
 * </Masonry>
 */
declare function Masonry(props: MasonryProps): React.JSX.Element;

type MasonryItemProps = React__default.ComponentProps<"div"> & {
    asChild?: boolean;
};
type MasonryItemElement = HTMLDivElement;
declare function MasonryItem({ asChild, ref, ...props }: MasonryItemProps): React__default.JSX.Element;

type NodeColor = 0 | 1 | 2;
type NodeOperation = 0 | 1;
type ItemElement = HTMLDivElement;
type MasonryListNode = {
    index: number;
    high: number;
    next: MasonryListNode | null;
};
type MasonryTreeNode = {
    max: number;
    low: number;
    high: number;
    color: NodeColor;
    parent: MasonryTreeNode;
    right: MasonryTreeNode;
    left: MasonryTreeNode;
    list: MasonryListNode;
};
type MasonryTree = {
    root: MasonryTreeNode;
    size: number;
};
type MasonryIntervalTree = {
    insert(low: number, high: number, index: number): void;
    remove(index: number): void;
    search(low: number, high: number, onCallback: (index: number, low: number) => void): void;
    size: number;
};
type MasonryCacheKey = string | number | symbol;
type MasonryCacheConstructor = (new () => MasonryCache) | Record<MasonryCacheKey, unknown>;
type MasonryCache<K = MasonryCacheKey, V = unknown> = {
    set: (k: K, v: V) => V;
    get: (k: K) => V | undefined;
};
type MasonryPositioner = {
    columnCount: number;
    columnWidth: number;
    set: (index: number, height: number) => void;
    get: (index: number) => MasonryPositionerItem | undefined;
    update: (updates: number[]) => void;
    range: (low: number, high: number, onItemRender: (index: number, left: number, top: number) => void) => void;
    size: () => number;
    estimateHeight: (itemCount: number, defaultItemHeight: number) => number;
    shortestColumn: () => number;
    all: () => Array<MasonryPositionerItem>;
};
type MasonryPositionerItem = {
    top: number;
    left: number;
    height: number;
    columnIndex: number;
};

export { type ItemElement, Masonry, type MasonryCache, type MasonryCacheConstructor, type MasonryCacheKey, type MasonryElement, type MasonryIntervalTree, MasonryItem, type MasonryItemElement, type MasonryItemProps, type MasonryListNode, type MasonryPositioner, type MasonryPositionerItem, type MasonryProps, type MasonryTree, type MasonryTreeNode, type NodeColor, type NodeOperation };
