@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
26 lines • 930 B
TypeScript
import type { DashboardWidget } from '../../types';
interface WidgetSettingsToggle {
/**
* Whether this instance's settings surface is the open one.
*/
isOpen: boolean;
/**
* Opens the settings surface for this instance.
*/
open: () => void;
/**
* Closes the surface when this instance already owns it (discarding
* staged edits), opens it otherwise.
*/
toggle: () => void;
}
/**
* Shared open/close logic for an instance's settings surface. The surface is
* mounted once at the dashboard root and reacts to the `uuid` written into
* the UI context; controls drive it through this hook.
*
* @param {DashboardWidget< unknown >} widget The instance whose settings surface the control drives.
*/
export declare function useWidgetSettingsToggle(widget: DashboardWidget<unknown>): WidgetSettingsToggle;
export {};
//# sourceMappingURL=use-widget-settings-toggle.d.ts.map