declare module "react-grid-layout" {
  import * as React from "react";

  export interface LayoutItem {
    i: string;
    x: number;
    y: number;
    w: number;
    h: number;
    minW?: number;
    minH?: number;
    maxW?: number;
    maxH?: number;
    static?: boolean;
    isDraggable?: boolean;
    isResizable?: boolean;
  }

  export interface ReactGridLayoutProps {
    className?: string;
    layout?: LayoutItem[];
    cols?: number;
    rowHeight?: number;
    width?: number;
    isDraggable?: boolean;
    isResizable?: boolean;
    compactType?: "vertical" | "horizontal" | null;
    margin?: [number, number];
    draggableHandle?: string;
    onLayoutChange?: (layout: LayoutItem[]) => void;
    children?: React.ReactNode;
  }

  export interface ResponsiveProps extends Omit<ReactGridLayoutProps, "cols" | "layout"> {
    layouts?: Record<string, LayoutItem[]>;
    breakpoints?: Record<string, number>;
    cols?: Record<string, number>;
    onLayoutChange?: (layout: LayoutItem[], layouts: Record<string, LayoutItem[]>) => void;
  }

  export const Responsive: React.ComponentType<ResponsiveProps>;

  export function WidthProvider<P extends object>(
    component: React.ComponentType<P>
  ): React.ComponentType<Omit<P, "width">>;

  const ReactGridLayout: React.ComponentType<ReactGridLayoutProps>;
  export default ReactGridLayout;
}
