import type { FdoDecimal } from '@feedmepos/core/entity'; export interface RecipeBreakdownNode { key: string; name: string; /** configured amount, already compounded through the parent recipes above it */ amount: FdoDecimal; /** unit the amount is keyed in, empty for a recipe or an unresolved binding */ unit: string; depth: number; isRecipe: boolean; } /** what a recipe contains, and how to label a binding — supplied by the store in the composable */ export interface RecipeBreakdownSource { contentsOf: (recipeId: string) => FdoInventoryBinding[]; bindingName: (binding: FdoInventoryBinding) => string; bindingUnit: (binding: FdoInventoryBinding) => string; } /** exact decimal multiply: integer amounts multiply, precisions add — no float drift */ export declare function multiplyDecimal(a: FdoDecimal, b: FdoDecimal): FdoDecimal; /** * What a contained amount works out to for the amount keyed in on the row: * configured × input. Takes the raw text, so a row cleared mid-typing previews * unscaled rather than flashing zeros — `+''` would read as 0. */ export declare function previewAmount(amount: FdoDecimal, multiplier: string): string; /** the keyed-in text as a decimal; unscaled while it is blank or not yet a number */ export declare function parseMultiplier(multiplier: string): FdoDecimal; /** * Flattens a recipe's binding tree depth-first, descending into nested recipes and * multiplying each amount by the chain of recipe amounts above it. * `visited` keeps a recipe that (transitively) contains itself from recursing forever — * the form reports that separately as a circular-dependency error. */ export declare function flattenRecipeTree(recipeId: string, source: RecipeBreakdownSource, depth?: number, visited?: Set, factor?: FdoDecimal): RecipeBreakdownNode[];