UNPKG

@alexanderson1993/cooklang-ts

Version:

Cooklang-TS is a TypeScript library for parsing and manipulating Cooklang recipes.

22 lines (21 loc) 684 B
import { Ingredient, Cookware, Step, Metadata, ShoppingList } from "./cooklang"; export interface ParserOptions { defaultCookwareAmount?: string | number; defaultIngredientAmount?: string | number; includeStepNumber?: boolean; } export interface ParseResult { ingredients: Array<Ingredient>; cookwares: Array<Cookware>; metadata: Metadata; steps: Array<Step>; shoppingList: ShoppingList; } export default class Parser { defaultCookwareAmount: string | number; defaultIngredientAmount: string | number; includeStepNumber: boolean; defaultUnits: string; constructor(options?: ParserOptions); parse(source: string): ParseResult; }