from wagtail.images.exceptions import InvalidFilterSpecError as InvalidFilterSpecError
from wagtail.images.rect import Rect as Rect
from wagtail.images.rect import Vector as Vector
from wagtail.images.utils import parse_color_string as parse_color_string

class Operation:
    method: str
    args: tuple[str, ...]
    def __init__(self, method, *args) -> None: ...
    def construct(self, *args) -> None: ...

class ImageTransform:
    image_is_svg: bool
    size: tuple[int, int]
    scale: tuple[float, float]
    offset: tuple[float, float]
    def __init__(self, size, image_is_svg: bool = False) -> None: ...
    def clone(self): ...
    def resize(self, size): ...
    def crop(self, rect): ...
    def transform_vector(self, vector): ...
    def untransform_vector(self, vector): ...
    def get_rect(self): ...

class TransformOperation(Operation):
    def run(self, image, transform) -> None: ...

class FillOperation(TransformOperation):
    vary_fields: tuple[str, ...]
    width: int
    height: int
    crop_closeness: int
    def construct(self, size, *extra) -> None: ...
    def run(self, transform, image): ...

class MinMaxOperation(TransformOperation):
    width: int
    height: int
    def construct(self, size) -> None: ...
    def run(self, transform, image): ...

class WidthHeightOperation(TransformOperation):
    size: int
    def construct(self, size) -> None: ...
    def run(self, transform, image): ...

class ScaleOperation(TransformOperation):
    percent: float
    def construct(self, percent) -> None: ...
    def run(self, transform, image): ...

class FilterOperation(Operation):
    def run(self, willow, image, env) -> None: ...

class DoNothingOperation(FilterOperation):
    def construct(self) -> None: ...
    def run(self, willow, image, env): ...

class JPEGQualityOperation(FilterOperation):
    quality: int
    def construct(self, quality) -> None: ...
    def run(self, willow, image, env) -> None: ...

class AvifQualityOperation(FilterOperation):
    quality: int
    def construct(self, quality) -> None: ...
    def run(self, willow, image, env) -> None: ...

class WebPQualityOperation(FilterOperation):
    quality: int
    def construct(self, quality) -> None: ...
    def run(self, willow, image, env) -> None: ...

class FormatOperation(FilterOperation):
    supported_formats: list[str]
    format: str
    options: tuple[str, ...]
    def construct(self, format, *options) -> None: ...
    def run(self, willow, image, env) -> None: ...

class BackgroundColorOperation(FilterOperation):
    color: tuple[int, int, int]
    def construct(self, color_string) -> None: ...
    def run(self, willow, image, env): ...
