@mitcsutt/kiln-dnd
Version:
Kiln drag and drop: sortable lists, boards, drop zones and grid layouts with one keyboard model and one announcer, rendered through kiln-ui
33 lines (32 loc) • 1.6 kB
TypeScript
/*! @license
* Vendored from react-grid-layout 2.3.0 (src/core/responsive.ts), MIT licence.
* Copyright (c) 2016 Samuel Reed. See ./LICENSE.
* https://github.com/react-grid-layout/react-grid-layout/tree/2.3.0/src/core
*/
import type { Breakpoint, Breakpoints, Compactor, CompactType, Layout, ResponsiveLayouts } from './types.js';
/**
* Sort breakpoints by width (ascending).
*
* Returns an array of breakpoint names sorted from smallest to largest.
*/
export declare function sortBreakpoints<B extends Breakpoint>(breakpoints: Breakpoints<B>): B[];
/**
* Get the active breakpoint for a given width.
*
* Returns the highest breakpoint that is valid for the width (width > breakpoint).
*/
export declare function getBreakpointFromWidth<B extends Breakpoint>(breakpoints: Breakpoints<B>, width: number): B;
/**
* Find or generate a layout for a breakpoint.
*
* If a layout exists for the breakpoint, returns a clone.
* Otherwise, generates a new layout from the nearest larger breakpoint.
*
* @param layouts - Existing layouts by breakpoint
* @param breakpoints - Breakpoint definitions
* @param breakpoint - Target breakpoint
* @param lastBreakpoint - Previous breakpoint (for fallback)
* @param cols - Column count for the target breakpoint
* @param compactTypeOrCompactor - Compaction type string (legacy) or Compactor object
*/
export declare function findOrGenerateResponsiveLayout<B extends Breakpoint>(layouts: ResponsiveLayouts<B>, breakpoints: Breakpoints<B>, breakpoint: B, lastBreakpoint: B, cols: number, compactTypeOrCompactor: CompactType | Compactor): Layout;