Task Description: Implement a Todo List Management System
You are required to implement a Todo List management system with the following functionality in the /app/ directory.
Requirements:
Todo Item Structure:
Each todo item should consist of the following attributes:
id: A unique identifier (integer) for each todo item.
title: A string representing the title of the todo item.
completed: A boolean indicating whether the todo item is completed or not.
Functionality:
Implement a class named TodoList which should have the following methods:
add_todo(title: str) -> int: Accepts a title for the todo item, adds it to the list, and returns the id of the new todo.
remove_todo(id: int) -> bool: Accepts an id of a todo item, removes it from the list if it exists, and returns True. If the todo with the given id does not exist, it returns False.
mark_completed(id: int) -> bool: Accepts an id of a todo item and marks it as completed if it exists, returning True. If it does not exist, return False.
get_all_todos() -> List[Dict[str, Union[int, str, bool]]]: Returns a list of all todo items. Each item in the list should be a dictionary containing the id, title, and completed status.
Error Handling:
Ensure that appropriate error handling is in place for invalid operations (e.g., trying to remove or mark as completed a todo that does not exist).
Implementation Notes:
Use Python typing for better clarity and type safety.
Ensure that the implementation passes the provided test cases by matching the expected behavior as described above.
Output:
Your implementation should reside in a file named todo_list.py within the /app/ directory.