/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ export type Ingredient = | string | { /** * The quantity of the specified item, in terms of the specified unit. */ quantity: Quantity; /** * The unit of measurement which the specified quantity uses (e.g. "cup"). */ unit?: string; /** * The item of which this ingredient consists (e.g. "apple"). */ item: string; /** * How the ingredient should be prepared prior to use (e.g. "chopped"). */ preparation?: string | string[]; }; export type Quantity = number | string; /** * A single step in the preparation of the recipe. */ export type Direction = string; /** * A schema for recipes. */ export interface JSONRecipe { /** * Meta information that does not relate directly to the recipe itself, such as the schema version used. */ meta?: { /** * The version of this schema under which the recipe was written. The schema follows semantic versioning, so recipes written under version 1.2.3 will be compatible with schema version 1.4.5, but not necessarily the other way around. */ schemaVersion?: string; [k: string]: any; }; /** * The title of the recipe. */ title: string; source?: Source; /** * The ingredients of the recipe. */ ingredients: (Ingredient | IngredientGroup)[]; /** * The instructions for preparing the finished product from the ingredients. */ directions: (Direction | DirectionGroup)[]; [k: string]: any; } /** * The source of the recipe (e.g. the person who wrote it and the book where it was found). */ export interface Source { /** * The full name of the author of the recipe. */ author: string; /** * The location from which the recipe was retrived (e.g. a website or a book). */ location?: WebLocation; [k: string]: any; } /** * A website or other source accessible online. */ export interface WebLocation { /** * The URL of the source material. */ url: string; /** * The date on which the recipe was retrieved from the source. */ retrievalDate?: string; [k: string]: any; } /** * A group of ingredients under a single heading. */ export interface IngredientGroup { /** * The heading for this group of ingredients. */ heading: string; /** * The ingredients under this heading. */ ingredients: Ingredient[]; } /** * A group of directions under a single heading. */ export interface DirectionGroup { /** * The heading for this group of directions. */ heading: string; /** * The directions under this heading. */ directions: Direction[]; }