from django.utils.functional import cached_property as cached_property
from wagtail.admin.compare import BlockComparison as BlockComparison
from wagtail.admin.compare import StructBlockComparison as StructBlockComparison
from wagtail.blocks import (
    BooleanBlock as BooleanBlock,
)
from wagtail.blocks import (
    CharBlock as CharBlock,
)
from wagtail.blocks import (
    ChooserBlock as ChooserBlock,
)
from wagtail.blocks import (
    StructBlock as StructBlock,
)
from wagtail.blocks.struct_block import (
    StructBlockAdapter as StructBlockAdapter,
)
from wagtail.blocks.struct_block import (
    StructBlockValidationError as StructBlockValidationError,
)
from wagtail.images.models import AbstractImage as AbstractImage
from wagtail.telepath import register as register

from .shortcuts import get_rendition_or_not_found as get_rendition_or_not_found

class ImageChooserBlock(ChooserBlock):
    @cached_property
    def target_model(self): ...
    @cached_property
    def widget(self): ...
    def render_basic(self, value, context=None): ...
    def get_comparison_class(self): ...
    class Meta:
        icon: str

class ImageChooserBlockComparison(BlockComparison):
    def htmlvalue(self, val): ...
    def htmldiff(self): ...

class ImageBlock(StructBlock):
    image: ImageChooserBlock
    decorative: BooleanBlock
    alt_text: CharBlock
    def __init__(self, required: bool = True, **kwargs) -> None: ...
    def deconstruct(self): ...
    def deconstruct_with_lookup(self, lookup): ...
    @classmethod
    def construct_from_lookup(cls, lookup, *args, **kwargs): ...
    def get_searchable_content(self, value): ...
    def to_python(self, value): ...
    def bulk_to_python(self, values): ...
    def value_from_datadict(self, data, files, prefix): ...
    def clean(self, value): ...
    def normalize(self, value): ...
    def get_form_context(self, value, prefix: str = "", errors=None): ...
    def get_form_state(self, value): ...
    def get_prep_value(self, value): ...
    def extract_references(self, value): ...
    def get_comparison_class(self): ...
    def get_api_representation(self, value, context=None): ...
    def render_basic(self, value, context=None): ...
    def get_block_by_content_path(self, value, path_elements): ...
    class Meta:
        icon: str
        template: str

class ImageBlockAdapter(StructBlockAdapter):
    js_constructor: str
    @cached_property
    def media(self): ...

class ImageBlockComparison(StructBlockComparison):
    def __init__(self, block, exists_a, exists_b, val_a, val_b) -> None: ...
    def htmlvalue(self, val): ...
