<?php

declare(strict_types=1);

namespace apexl\Io\interfaces;

interface OutputManagerInterface
{
    public const string HOOK__ADD_RESPONSE = 'output_manager.add_response';
    public const string HOOK__ADD_MESSAGE = 'output_manager.add_message';
    public const string HOOK__ADD_METADATA = 'output_manager.add_metadata';

    public function addMessage(
        string $name,
        string $type,
        string $content,
        string $icon = '',
        ?int $timeout = null,
        ?string $id = null
    ): void;

    /**
     * Empty everything accumulated for the response being assembled.
     *
     * An implementation of this interface is a per-process store that merges into
     * what it already holds, which is the point within a request and a liability
     * across a test suite: without a reset between tests, one test's response is
     * still there for the next one to read. Declared here rather than left to the
     * implementation so test infrastructure can rely on it.
     */
    public function reset(): void;
}
