import { DataCacher, IDataHook, IDataRetriever } from "model-react"; import { ICategory } from "../../actions/types/category/_types/ICategory"; import { IMenuItem } from "../items/_types/IMenuItem"; import { ICategorizerConfig } from "./_types/ICategorizerConfig"; import { IMenuCategoryData } from "./_types/IMenuCategoryData"; /** * A class that can be used to categorize a list of menu items */ export declare class MenuItemCategorizer { protected itemsGetter: IDataRetriever; protected config: Required>; /** * Creates a new categorizer * @param items The items getter * @param config The config to customize the categories */ constructor(items: IDataRetriever, config: ICategorizerConfig); /** * The items together with a function to retrieve their category, caching the category for future use */ protected itemsWithCategories: DataCacher<{ items: { item: T; categoryGetter: DataCacher; }[]; categories: Map>; }>; /** * The categories data */ protected categories: DataCacher; /** * The menu items */ protected items: DataCacher; /** * Retrieves the item categories of the menu * @param hook The hook to subscribe to changes * @returns The categories and their items */ getCategories(hook?: IDataHook): IMenuCategoryData[]; /** * Retrieves the items including categories * @param hook The hook to subscribe to changes * @returns The menu items */ getItems(hook?: IDataHook): IMenuItem[]; } //# sourceMappingURL=MenuItemCategorizer.d.ts.map