@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
35 lines • 1.65 kB
TypeScript
import type { Ref } from 'react';
export declare const WidgetHeaderAvailableSizeProvider: import("react").Provider<number | null>;
/**
* Inline size (px) the header row can still grant its toolbar, or `null`
* while unmeasured or outside a header. Toolbar controls compare their
* natural width against it to pick a presentation that fits.
*/
export declare function useWidgetHeaderAvailableSize(): number | null;
interface WidgetHeaderReserve {
registerReserved: (id: string, width: number) => void;
unregisterReserved: (id: string) => void;
}
export declare const WidgetHeaderReserveProvider: import("react").Provider<WidgetHeaderReserve>;
/**
* Reserves a trailing section's footprint from the header's fit budget.
*
* A section that sits beside the collapsible controls (the actions menu, and
* whatever the header gains next) attaches the returned ref to its root. Its
* measured width, plus the gap before it, is discounted from the space the
* collapsible controls plan for, so no section overflows onto another.
*
* @param {string} id Stable identifier for the reserving section.
*/
export declare function useReserveHeaderSpace<T extends HTMLElement = HTMLElement>(id: string): Ref<T>;
/**
* Reserves a container's own padding and border from the header's fit budget.
*
* Observing the border box is what makes a padding change notify: it leaves
* the content box untouched.
*
* @param {string} id Stable identifier for the reserving container.
*/
export declare function useReserveHeaderPadding<T extends HTMLElement = HTMLElement>(id: string): Ref<T>;
export {};
//# sourceMappingURL=widget-header-fit.d.ts.map