generated from Nodarx/template
1ce2013c07
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KTXM\ProviderImap\Client;
|
|
|
|
use KTXM\ProviderImap\Client\Protocol\Command\CommandInterface;
|
|
use KTXM\ProviderImap\Client\Protocol\Command\Argument\MessageTarget;
|
|
|
|
interface ClientInterface
|
|
{
|
|
public function connect(ConnectionConfig $config): void;
|
|
|
|
/**
|
|
* @return list<string>
|
|
*/
|
|
public function capabilities(): array;
|
|
|
|
/**
|
|
* Unsuccessful command completion throws ImapException. For streamed
|
|
* results, completion is checked as the returned generator is consumed.
|
|
*
|
|
* @throws ImapException
|
|
* @template TResult
|
|
* @param CommandInterface<TResult> $command
|
|
* @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(MessageTarget $target, string $section, int $chunkSize = 8192): \Generator;
|
|
} |