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

@tmlmt/cooklang-parser / IngredientAlternativeBase

Type Alias: IngredientAlternativeBase

IngredientAlternativeBase = object

Represents a single ingredient choice within a single or a group of IngredientItems. It points to a specific ingredient and its corresponding quantity information.

Properties

displayName

displayName: string

The alias/name of the ingredient as it should be displayed for this occurrence.


index

index: number

The index of the ingredient within the Recipe.ingredients array.


itemId?

optional itemId: string

When Recipe.choices is populated for alternatives ingredients with group keys: the id of the corresponding ingredient item (e.g. "ingredient-item-2"). Can be useful for creating alternative selection UI elements with anchor links


note?

optional note: string

An optional note for this specific choice (e.g., "for a vegan version").