import { FdoDinero } from "@feedmepos/core/entity";
import { F_ADDON_GROUP_TYPE, F_ORDER_FROM } from "@feedmepos/menu/entity";
import { type FdoGroupOverriderV4, type FdoItemOverriderV4, FdoMenuV4Group, type FdoMenuV4Item } from "@feedmepos/menu/entity";
import { type DialogProvider } from "@feedmepos/ui-library";
import { useMenuLoader } from "@/helper/menu";
export interface GroupConfig {
    type: boolean;
    price: boolean;
    priceEdit: boolean;
    priceTier: boolean;
    orderFromActiveOnly: boolean;
    showOrderFrom: boolean;
    inventory: boolean;
    bindToVariant: boolean;
    link: (combinationKey?: string | null | undefined) => boolean;
    name: (combinationKey?: string | null | undefined) => boolean;
    isDefault: (combinationKey?: string | null | undefined) => boolean;
    orderFrom: (combinationKey?: string | null | undefined) => boolean;
    isOverride: boolean;
    isItemGroup: boolean;
    isV4: boolean;
}
export type MenuGroup = Omit<FdoMenuV4Group, "items"> & {
    type: F_ADDON_GROUP_TYPE;
    items: {
        [itemId: string]: GroupItem;
    };
    itemsLinked: string[];
};
export type MenuGroupItem = FdoItemOverriderV4 & {
    fallbackName?: string | null;
    fallbackPrice?: FdoDinero | null;
    fallbackOrder?: F_ORDER_FROM | null;
};
export type GroupItem = MenuGroupItem & {
    items?: MenuGroupItem[];
    code?: MenuGroupItem["code"];
    name?: MenuGroupItem["name"];
    price?: MenuGroupItem["price"];
    isDefault?: MenuGroupItem["isDefault"];
};
export declare function getAddonGroupType(menuItems: FdoMenuV4Item[], groupItems: FdoItemOverriderV4[]): any;
export declare function extractGroup(group: MenuGroup): FdoMenuV4Group;
export declare function extractLinkItem(group: MenuGroup): {
    group: FdoMenuV4Group;
    linkItems: FdoMenuV4Item[];
};
export declare class MenuGroupManager {
    private menuStore;
    private updateMenu;
    private dialog;
    constructor(menuStore: any, updateMenu: ReturnType<typeof useMenuLoader>["updateMenu"], dialog: DialogProvider);
    getFallbackPrices(groups: FdoMenuV4Group[]): {
        [key: string]: FdoGroupOverriderV4;
    };
    mapGroups(groups: FdoMenuV4Group[], isOverride: boolean): MenuGroup[];
    sortGroups(groups: MenuGroup[]): Promise<void>;
    duplicateGroup(group: MenuGroup): Promise<void>;
    deleteGroup(group: MenuGroup): Promise<void>;
    applyItems(group: MenuGroup, overrideIds: string[]): Promise<void>;
    private isOverride;
}
export declare function mapGroupConfigToImmutableFields(groupConfig: GroupConfig | null | undefined): Array<keyof MenuGroup>;
export declare function mapGroupConfigToImmutableItemsFields(groupConfig: GroupConfig | null | undefined, combinationKey?: string | null | undefined): (string | number | symbol)[];
/**
 * Currently, there are many fields under group that are immutable. Such as name, type, min, max, etc.
 * If we don't remove these fields, the group will be saved with these fields. Which will cause these
 * immutable fields to be overridden accidentally.
 */
export declare function removeImmutableFieldsByGroup<T extends FdoGroupOverriderV4 | FdoMenuV4Group>(group: T, groupConfig: GroupConfig): T;
