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

@tmlmt/cooklang-parser / GetIngredientQuantitiesOptions

Interface: GetIngredientQuantitiesOptions

Options for the getIngredientQuantities() method.

Properties

choices?

optional choices: RecipeChoices

The choices to apply when computing quantities. If not provided, uses primary alternatives (index 0 for all).


section?

optional section: number | Section

Filter ingredients to only those appearing in a specific section. Can be a Section object or section index (0-based).


step?

optional step: number | Step

Filter ingredients to only those appearing in a specific step. Can be a Step object or step index (0-based within the section, or global if no section specified).


variant?

optional variant: string

When step is a number, interpret it as a 0-based index into the steps that are active for this variant (i.e., the steps that would be visible when rendering with this variant), rather than into all steps in the section.

Has no effect when step is a Step object or when step is undefined.

Use "*" to refer to the default variant (steps tagged [*] and untagged steps).