import type { WorkSheet } from 'xlsx'; export type ObjectWithIndex = { index: number; data: T; }; export interface RecipeRow { recipeName: string; type: 'RECIPE' | 'INGREDIENT'; code: string; name: string; amount: string; unit: string; baseUnit: string; measurementName: string; customAttributes?: string; rules?: string; } export interface RecipeContainsRow { type: 'RECIPE' | 'SKU'; id: string; amount: { amount: number; precision: number; }; } export interface ImportRecipeCreateResult { type: 'create'; recipe: FdoInventoryRecipe; excelRowNumber: number; errors: string[]; warnings: string[]; changes: RecipeChangeLine[]; } export interface ImportRecipeUpdateResult { type: 'update'; original: FdoInventoryRecipe; recipe: FdoInventoryRecipe; excelRowNumber: number; errors: string[]; warnings: string[]; changes: RecipeChangeLine[]; } export interface RecipeChangeLine { status: 'added' | 'changed' | 'same'; item: string; qtyBefore?: string; qtyAfter: string; extraBefore?: string; extraAfter: string; } export interface RecipeImportResult { invalidExcel: boolean; invalidExcelMessage?: string; importCreateResult?: ImportRecipeCreateResult[]; importUpdateResult?: ImportRecipeUpdateResult[]; } export declare function newRecipeId(): string; /** * Reads a Rules cell: `outlet in MY001, MY002; state not in Sabah` (conditions * joined by `;` must all hold), or the raw Mongo-style rule as JSON. */ export declare function parseRules(value: string): Record; /** Writes rules in the Rules cell syntax, falling back to JSON for shapes it cannot express. */ export declare function formatRules(rules: Record | null | undefined): string; /** * Per-binding before/after lines for the import detail view. Bindings pair up by * position: mergeBindings keeps every live binding at its index and appends new ones. */ export declare function recipeChanges(before: FdoInventoryRecipe | undefined, after: FdoInventoryRecipe): RecipeChangeLine[]; /** * Mirrors POS's MongoQueryEvaluator (custom_attributes_dart): a key missing from * the outlet's attributes fails $in/$eq but passes $nin/$ne. */ export declare function matchesRule(rule: Record, attributes: Record): boolean; export declare function importExcelToCreateRecipes(rows: ObjectWithIndex[], { ignoreErrors }?: { ignoreErrors?: boolean; }): RecipeImportResult; export declare function worksheetToRecipeRow(sheet: WorkSheet): ObjectWithIndex[];