@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
16 lines • 759 B
TypeScript
import type { DashboardWidget } from '../types';
/**
* Canonical form of a layout: widgets sorted by `placement.order` (falling
* back to array index), then `order` stripped since position now implies
* it. The single positional encoding shared by the renderer, the commit
* payload, and the staging enforcement.
*
* Returns `layout` itself when it is already canonical, and keeps the
* reference of every widget without an `order` to strip, so untouched
* layouts stay identity-comparable.
*
* @param {DashboardWidget[]} layout Layout to canonicalize.
* @return {DashboardWidget[]} The canonical layout.
*/
export declare function canonicalizeLayout(layout: DashboardWidget[]): DashboardWidget[];
//# sourceMappingURL=canonicalize-layout.d.ts.map