<?php

declare(strict_types=1);

namespace Intervention\Image\Interfaces;

interface AnimationFactoryInterface
{
    /**
     * Create the animation of the factory statically by calling given callable.
     */
    public static function build(int $width, int $height, callable $animation, DriverInterface $driver): ImageInterface;

    /**
     * Resolve image or color from given source and add it as new animation frame with specific delay in seconds.
     */
    public function add(mixed $source, float $delay = 1): self;

    /**
     * Build ready-made animation as end product.
     */
    public function image(DriverInterface $driver): ImageInterface;
}
