import typing
from ebookwords.core import book_manager as bm
from ebookwords.adapter import db

__all__ = ["BookManager", "get_book_manager"]


class BookManager(typing.Protocol):
    db_client: db.DatabaseClient

    def store_ebook(self, file: typing.BinaryIO) -> None: ...


def get_book_manager() -> BookManager:
    from ebookwords.adapter.db import sql

    return bm.BookManager(db_client=db.get_database_client())
