IntegrationInterface.php
43 lines
| 1 | <?php |
| 2 | namespace Automattic\WooCommerce\Blocks\Integrations; |
| 3 | |
| 4 | /** |
| 5 | * Integration.Interface |
| 6 | * |
| 7 | * Integrations must use this interface when registering themselves with blocks, |
| 8 | */ |
| 9 | interface IntegrationInterface { |
| 10 | /** |
| 11 | * The name of the integration. |
| 12 | * |
| 13 | * @return string |
| 14 | */ |
| 15 | public function get_name(); |
| 16 | |
| 17 | /** |
| 18 | * When called invokes any initialization/setup for the integration. |
| 19 | */ |
| 20 | public function initialize(); |
| 21 | |
| 22 | /** |
| 23 | * Returns an array of script handles to enqueue in the frontend context. |
| 24 | * |
| 25 | * @return string[] |
| 26 | */ |
| 27 | public function get_script_handles(); |
| 28 | |
| 29 | /** |
| 30 | * Returns an array of script handles to enqueue in the editor context. |
| 31 | * |
| 32 | * @return string[] |
| 33 | */ |
| 34 | public function get_editor_script_handles(); |
| 35 | |
| 36 | /** |
| 37 | * An array of key, value pairs of data made available to the block on the client side. |
| 38 | * |
| 39 | * @return array |
| 40 | */ |
| 41 | public function get_script_data(); |
| 42 | } |
| 43 |