from typing import Any, TypeVar, overload

from django.contrib.auth.models import AbstractUser
from django.db import models

_T = TypeVar("_T")

SNIPPET_MODELS: list[type[models.Model]]
DEFER_REGISTRATION: bool
DEFERRED_REGISTRATIONS: list[tuple[Any, Any]]

def get_snippet_models() -> list[type[models.Model]]: ...
def get_workflow_enabled_models() -> list[type[models.Model]]: ...
def get_editable_models(user: AbstractUser) -> list[type[models.Model]]: ...

class SnippetAdminURLFinder:
    user_can_edit: bool
    model: type[models.Model]
    def __init__(self, user: AbstractUser | None = None) -> None: ...
    def get_edit_url(self, instance: models.Model) -> str | None: ...

@overload
def register_snippet[T](registerable: type[_T]) -> type[_T]: ...
@overload
def register_snippet[T](registerable: type[_T], viewset: type | None) -> type[_T]: ...
@overload
def register_snippet(registerable: Any, viewset: Any = None) -> Any: ...
def register_deferred_snippets() -> None: ...
def create_extra_permissions(app_config: Any, *args: Any, using: str = ..., apps: Any = ..., **kwargs: Any) -> None: ...
