recipes.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. export interface IIngredient {
  2. name: string,
  3. quantity: number,
  4. unit: string,
  5. _original: string,
  6. }
  7. export interface ISubRecipe {
  8. name: string,
  9. ingredients: IIngredient[]
  10. }
  11. export interface IAuthor {
  12. name: string,
  13. website: string,
  14. }
  15. export interface IDetails {
  16. url?: string,
  17. preparationTime: string,
  18. cookingTime: string,
  19. servings: number
  20. }
  21. export const _ingredient: IIngredient = {
  22. name: '',
  23. quantity: 0,
  24. unit: '',
  25. _original: ''
  26. };
  27. export const _subRecipe: ISubRecipe = {
  28. name: '',
  29. ingredients: [_ingredient]
  30. };
  31. export const _recipe: IRecipe = {
  32. _id: '',
  33. author: {
  34. name: '',
  35. website: '',
  36. },
  37. details: {
  38. url: '',
  39. preparationTime: '',
  40. cookingTime: '',
  41. servings: 0
  42. },
  43. ingredients: [_subRecipe],
  44. instructions: [],
  45. name: '',
  46. summary: '',
  47. tags: []
  48. }
  49. export default interface IRecipe {
  50. _id: string,
  51. author: IAuthor,
  52. details: IDetails,
  53. ingredients: ISubRecipe[],
  54. instructions: string[],
  55. name: string,
  56. summary: string,
  57. tags: string[],
  58. }