| 1 |
<?php |
| 2 |
/** |
| 3 |
* Cloud-print provider adapter interface. |
| 4 |
* |
| 5 |
* @package WCPOS\WooCommercePOS\Interfaces |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WCPOS\WooCommercePOS\Interfaces; |
| 9 |
|
| 10 |
/** |
| 11 |
* Provider_Adapter_Interface interface. |
| 12 |
*/ |
| 13 |
interface Provider_Adapter_Interface { |
| 14 |
/** |
| 15 |
* Return the provider's default job content type. |
| 16 |
* |
| 17 |
* @return string |
| 18 |
*/ |
| 19 |
public function content_type(): string; |
| 20 |
|
| 21 |
/** |
| 22 |
* Resolve a template to the provider's wire format and content type. |
| 23 |
* |
| 24 |
* @param array $printer Printer configuration. |
| 25 |
* @param array $template Template configuration. |
| 26 |
* |
| 27 |
* @return array{kind:string, content_type:string} |
| 28 |
*/ |
| 29 |
public function format( array $printer, array $template ): array; |
| 30 |
|
| 31 |
/** |
| 32 |
* Build a base64-encoded provider diagnostic. |
| 33 |
* |
| 34 |
* @param string $printer_name Printer display name. |
| 35 |
* |
| 36 |
* @return array{content_type:string, payload:string} |
| 37 |
*/ |
| 38 |
public function diagnostic( string $printer_name ): array; |
| 39 |
|
| 40 |
/** |
| 41 |
* Resolve provider status from printer data and plain runtime context. |
| 42 |
* |
| 43 |
* @param array $printer Printer configuration. |
| 44 |
* @param array $context Runtime status context. |
| 45 |
* |
| 46 |
* @return string |
| 47 |
*/ |
| 48 |
public function status( array $printer, array $context ): string; |
| 49 |
} |
| 50 |
|