import { ReactNode } from "react";
import { MenuItemNode, MenuItemRow, MenuItemRow as MenuItemRow$1, MenuRow, MenuRow as MenuRow$1, MenuTarget, MenuTarget as MenuTarget$1, MenuTree, MenuTree as MenuTree$1 } from "@platform-modules/menus";
//#region src/client.d.ts
type EntityTarget = {
  entityType: string;
  entityId: string;
  label: string;
};
interface MenuClient {
  listMenus(): Promise<MenuRow$1[]>;
  getMenuTree(key: string): Promise<MenuTree$1 | null>;
  createMenu(input: {
    key: string;
    label: string;
  }): Promise<MenuRow$1>;
  updateMenu(menuId: string, patch: {
    label?: string;
  }): Promise<MenuRow$1>;
  deleteMenu(menuId: string): Promise<void>;
  addItem(menuId: string, input: {
    label: string;
    target: MenuTarget$1;
    parentId?: string | null;
  }): Promise<MenuItemRow$1>;
  updateItem(itemId: string, patch: {
    label?: string;
    target?: MenuTarget$1;
    openInNew?: boolean;
  }): Promise<MenuItemRow$1>;
  removeItem(itemId: string): Promise<void>;
  moveItem(itemId: string, input: {
    newParentId: string | null;
    newPosition: number;
  }): Promise<MenuItemRow$1>;
  reorder(menuId: string, parentId: string | null, orderedIds: string[]): Promise<void>;
}
//#endregion
//#region src/provider.d.ts
declare function MenuProvider({ client, children }: {
  client: MenuClient;
  children: ReactNode;
}): import("react").JSX.Element;
declare function useMenuClient(): MenuClient;
//#endregion
//#region src/hooks.d.ts
declare function useMenus(opts?: {
  initialData?: MenuRow[];
}): {
  menus: MenuRow[];
  loading: boolean;
  error: Error | null;
  reload: () => void;
  createMenu: (input: {
    key: string;
    label: string;
  }) => Promise<MenuRow>;
  updateMenu: (menuId: string, patch: {
    label?: string;
  }) => Promise<MenuRow>;
  deleteMenu: (menuId: string) => Promise<void>;
};
declare function useMenuTree(key: string, opts?: {
  initialData?: MenuTree | null;
}): {
  tree: MenuTree | null;
  loading: boolean;
  error: Error | null;
  reload: () => void;
  addItem: (menuId: string, input: {
    label: string;
    target: MenuTarget;
    parentId?: string | null;
  }) => Promise<import("@platform-modules/menus").MenuItemRow>;
  updateItem: (itemId: string, patch: {
    label?: string;
    target?: MenuTarget;
    openInNew?: boolean;
  }) => Promise<import("@platform-modules/menus").MenuItemRow>;
  removeItem: (itemId: string) => Promise<void>;
  moveItem: (itemId: string, input: {
    newParentId: string | null;
    newPosition: number;
  }) => Promise<import("@platform-modules/menus").MenuItemRow>;
  reorder: (menuId: string, parentId: string | null, orderedIds: string[]) => Promise<void>;
};
//#endregion
//#region src/editor.d.ts
interface MenuEditorProps {
  menuKey: string;
  availableTargets: EntityTarget[];
}
declare function MenuEditor({ menuKey, availableTargets }: MenuEditorProps): import("react").JSX.Element;
//#endregion
export { type EntityTarget, type MenuClient, MenuEditor, type MenuEditorProps, type MenuItemNode, type MenuItemRow, MenuProvider, type MenuRow, type MenuTarget, type MenuTree, useMenuClient, useMenuTree, useMenus };