WIP - Complete App refactoring

This commit is contained in:
VincentMeilinger
2025-05-26 15:52:24 +02:00
parent 29fd3c668b
commit 5acf3b9c4f
49 changed files with 1996 additions and 543 deletions

View File

@@ -9,7 +9,7 @@ import Foundation
import SwiftUI
import KeychainSwift
/*
protocol CookbookInterface {
/// A unique id of the interface. Used to associate recipes to their respective accounts.
var id: String { get }
@@ -24,12 +24,12 @@ protocol ReadInterface {
func getImage(
id: String,
size: RecipeImage.RecipeImageSize
) async -> (UIImage?, UserAlert?)
) async -> UIImage?
/// Get all recipe stubs.
/// - Returns: A list of all recipes.
func getRecipeStubs(
) async -> ([RecipeStub]?, UserAlert?)
) async -> [RecipeStub]?
/// Get the recipe with the specified id.
/// - Parameters:
@@ -37,12 +37,12 @@ protocol ReadInterface {
/// - Returns: The recipe if it exists. A UserAlert if the request fails.
func getRecipe(
id: String
) async -> (Recipe?, UserAlert?)
) async -> Recipe?
/// Get all categories.
/// - Returns: A list of categories. A UserAlert if the request fails.
func getCategories(
) async -> ([Category]?, UserAlert?)
) async -> [Category]?
/// Get all recipes of a specified category.
/// - Parameters:
@@ -50,12 +50,12 @@ protocol ReadInterface {
/// - Returns: A list of recipes. A UserAlert if the request fails.
func getRecipeStubsForCategory(
named categoryName: String
) async -> ([RecipeStub]?, UserAlert?)
) async -> [RecipeStub]?
/// Get all keywords/tags.
/// - Returns: A list of tag strings. A UserAlert if the request fails.
func getTags(
) async -> ([RecipeKeyword]?, UserAlert?)
) async -> [RecipeKeyword]?
/// Get all recipes tagged with the specified keyword.
/// - Parameters:
@@ -63,7 +63,7 @@ protocol ReadInterface {
/// - Returns: A list of recipes tagged with the specified keyword. A UserAlert if the request fails.
func getRecipesTagged(
keyword: String
) async -> ([RecipeStub]?, UserAlert?)
) async -> [RecipeStub]?
}
protocol WriteInterface {
@@ -111,3 +111,4 @@ protocol WriteInterface {
newName: String
) async -> (UserAlert?)
}
*/