import re
from datetime import datetime
from types import ModuleType
from typing import Any

from celery.app.base import Celery

__all__ = ("BaseLoader",)

class BaseLoader:
    app: Celery
    builtin_modules: frozenset[str]
    configured: bool
    worker_initialized: bool
    override_backends: dict[str, str]

    def __init__(self, app: Celery, **kwargs: Any) -> None: ...
    def import_default_modules(self) -> list[Any]: ...
    def autodiscover_tasks(
        self, packages: list[str], related_name: str = "tasks"
    ) -> None: ...
    def cmdline_config_parser(
        self,
        args: list[str],
        namespace: str = "celery",
        re_type: re.Pattern[str] = ...,
        extra_types: dict[str, Any] | None = None,
        override_types: dict[str, Any] | None = None,
    ) -> dict[str, Any]: ...
    @property
    def conf(self) -> Any: ...
    def config_from_object(self, obj: Any, silent: bool = False) -> None: ...
    @property
    def default_modules(self) -> set[str]: ...
    def find_module(self, module: str) -> ModuleType | None: ...
    def import_from_cwd(
        self, module: str, imp: Any | None = None, package: str | None = None
    ) -> ModuleType: ...
    def import_module(self, module: str, package: str | None = None) -> ModuleType: ...
    def import_task_module(self, module: str) -> ModuleType: ...
    def init_worker(self) -> None: ...
    def init_worker_process(self) -> None: ...
    def now(self, utc: bool = True) -> datetime: ...
    def on_process_cleanup(self) -> None: ...
    def on_task_init(self, task_id: str, task: Any) -> None: ...
    def on_worker_init(self) -> None: ...
    def on_worker_process_init(self) -> None: ...
    def on_worker_shutdown(self) -> None: ...
    def read_configuration(
        self, env: str = "CELERY_CONFIG_MODULE"
    ) -> dict[str, Any]: ...
    def shutdown_worker(self) -> None: ...
