feat: implement download

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-05-23 20:18:58 -04:00
parent 640e3aa811
commit 9cdebd82b8
15 changed files with 336 additions and 172 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace KTXM\ProviderImap\Client;
use KTXM\ProviderImap\Client\Command\CommandInterface;
use KTXM\ProviderImap\Client\FetchTarget;
interface ClientInterface
{
@@ -21,4 +22,11 @@ interface ClientInterface
* @return TResult
*/
public function perform(CommandInterface $command): mixed;
/**
* Stream the raw bytes of a single IMAP BODY section without buffering.
*
* @return \Generator<string> raw (transfer-encoded) bytes from the socket
*/
public function download(FetchTarget $target, string $section, int $chunkSize = 8192): \Generator;
}