1import threading
2from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union
3
4from django.db.models.base import Model
5
6from .config import AppConfig
7
8class Apps:
9    all_models: Dict[str, Dict[str, Type[Model]]] = ...
10    app_configs: Dict[str, AppConfig] = ...
11    stored_app_configs: List[Any] = ...
12    apps_ready: bool = ...
13    ready_event: threading.Event = ...
14    loading: bool = ...
15    _pending_operations: Dict[Tuple[str, str], List]
16    models_ready: bool = ...
17    ready: bool = ...
18    def __init__(self, installed_apps: Optional[Iterable[Union[AppConfig, str]]] = ...) -> None: ...
19    def populate(self, installed_apps: Iterable[Union[AppConfig, str]] = ...) -> None: ...
20    def check_apps_ready(self) -> None: ...
21    def check_models_ready(self) -> None: ...
22    def get_app_configs(self) -> Iterable[AppConfig]: ...
23    def get_app_config(self, app_label: str) -> AppConfig: ...
24    # it's not possible to support it in plugin properly now
25    def get_models(self, include_auto_created: bool = ..., include_swapped: bool = ...) -> List[Type[Model]]: ...
26    def get_model(self, app_label: str, model_name: Optional[str] = ..., require_ready: bool = ...) -> Type[Any]: ...
27    def register_model(self, app_label: str, model: Type[Model]) -> None: ...
28    def is_installed(self, app_name: str) -> bool: ...
29    def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ...
30    def get_registered_model(self, app_label: str, model_name: str) -> Type[Model]: ...
31    def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
32    def set_available_apps(self, available: Iterable[str]) -> None: ...
33    def unset_available_apps(self) -> None: ...
34    def set_installed_apps(self, installed: Iterable[str]) -> None: ...
35    def unset_installed_apps(self) -> None: ...
36    def clear_cache(self) -> None: ...
37    def lazy_model_operation(self, function: Callable, *model_keys: Any) -> None: ...
38    def do_pending_operations(self, model: Type[Model]) -> None: ...
39
40apps: Apps
41