1+ /**
2+ * Local ambient module for react-grid-layout@1.4.x.
3+ * @types /react-grid-layout@2.x is a deprecated stub ("package provides its own types")
4+ * but 1.4.4 does not ship types — without this file, named imports fail typecheck in CI.
5+ */
16declare module 'react-grid-layout' {
2- import { ComponentType , CSSProperties , ReactNode } from 'react' ;
7+ import * as React from 'react' ;
38
49 export interface Layout {
510 i : string ;
@@ -14,27 +19,57 @@ declare module 'react-grid-layout' {
1419 static ?: boolean ;
1520 isDraggable ?: boolean ;
1621 isResizable ?: boolean ;
22+ resizeHandles ?: Array < 's' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne' > ;
23+ isBounded ?: boolean ;
1724 }
1825
19- export interface ReactGridLayoutProps {
26+ export type Layouts = Record < string , Layout [ ] > ;
27+
28+ export interface CoreProps {
2029 className ?: string ;
21- style ?: CSSProperties ;
22- layout ?: Layout [ ] ;
23- cols ?: number ;
24- rowHeight ?: number ;
30+ style ?: React . CSSProperties ;
2531 width ?: number ;
26- onLayoutChange ?: ( layout : Layout [ ] ) => void ;
32+ autoSize ?: boolean ;
33+ draggableCancel ?: string ;
34+ draggableHandle ?: string ;
35+ compactType ?: 'vertical' | 'horizontal' | null ;
36+ rowHeight ?: number ;
37+ maxRows ?: number ;
2738 isDraggable ?: boolean ;
2839 isResizable ?: boolean ;
40+ isBounded ?: boolean ;
41+ preventCollision ?: boolean ;
42+ useCSSTransforms ?: boolean ;
43+ transformScale ?: number ;
2944 margin ?: [ number , number ] ;
3045 containerPadding ?: [ number , number ] | null ;
31- children ?: ReactNode ;
32- [ key : string ] : unknown ;
46+ resizeHandles ?: Array < 's' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne' > ;
47+ onLayoutChange ?: ( layout : Layout [ ] ) => void ;
48+ children ?: React . ReactNode ;
49+ }
50+
51+ export interface ReactGridLayoutProps extends CoreProps {
52+ layout ?: Layout [ ] ;
53+ cols ?: number ;
54+ }
55+
56+ export interface ResponsiveProps extends CoreProps {
57+ breakpoints ?: Record < string , number > ;
58+ cols ?: Record < string , number > ;
59+ layouts ?: Layouts ;
60+ onLayoutChange ?: ( layout : Layout [ ] , layouts : Layouts ) => void ;
61+ onBreakpointChange ?: ( newBreakpoint : string , cols : number ) => void ;
62+ }
63+
64+ export interface WidthProviderProps {
65+ measureBeforeMount ?: boolean ;
3366 }
3467
35- const ReactGridLayout : ComponentType < ReactGridLayoutProps > & {
36- WidthProvider : < P > ( component : ComponentType < P > ) => ComponentType < Omit < P , 'width' > > ;
37- } ;
68+ export class Responsive extends React . Component < ResponsiveProps > { }
69+
70+ export function WidthProvider < P > (
71+ component : React . ComponentType < P >
72+ ) : React . ComponentClass < P & WidthProviderProps > ;
3873
39- export default ReactGridLayout ;
74+ export default class ReactGridLayout extends React . Component < ReactGridLayoutProps > { }
4075}
0 commit comments