⚠️ This is pre-release documentation for v3. For stable docs, visit v2.
Skip to content

@tmlmt/cooklang-parser / RecipeAlternatives

Interface: RecipeAlternatives

Represents the choices one can make in a recipe

Properties

ingredientGroups

ingredientGroups: Map<string, IngredientAlternative[][]>

Map of choices that can be made for Grouped Ingredient StepItem's

  • Keys are the Group IDs (e.g. "eggs" for @|eggs|...)
  • Values are arrays of subgroups, where each subgroup is an array of bound IngredientAlternative objects that are selected together. Items sharing the same subgroup key (e.g., @|group/1|...) are in the same inner array. Items without a subgroup key each form their own single-element subgroup.

ingredientItems

ingredientItems: Map<string, IngredientAlternative[]>

Map of choices that can be made at Ingredient StepItem level

  • Keys are the Ingredient StepItem IDs (e.g. "ingredient-item-2")
  • Values are arrays of IngredientAlternative objects representing the choices available for that item

variants

variants: string[]

All variant names discovered in the recipe (from metadata, step tags, and section tags). Includes * if any step/section uses the default tag.