| 1 |
<?php |
| 2 |
/** |
| 3 |
* Gutenberg_Sync_Storage interface |
| 4 |
* |
| 5 |
* @package Gutenberg |
| 6 |
*/ |
| 7 |
|
| 8 |
interface Gutenberg_Sync_Storage { |
| 9 |
/** |
| 10 |
* Initialize the storage mechanism. |
| 11 |
*/ |
| 12 |
public function init(): void; |
| 13 |
|
| 14 |
/** |
| 15 |
* Add a sync update to a given room. |
| 16 |
* |
| 17 |
* @param string $room Room identifier. |
| 18 |
* @param array $update Sync update. |
| 19 |
*/ |
| 20 |
public function add_update( string $room, array $update ): void; |
| 21 |
|
| 22 |
/** |
| 23 |
* Retrieve sync updates for a given room. |
| 24 |
* |
| 25 |
* @param string $room Room identifier. |
| 26 |
* @return array Array of sync updates. |
| 27 |
*/ |
| 28 |
public function get_all_updates( string $room ): array; |
| 29 |
|
| 30 |
/** |
| 31 |
* Get awareness state for a given room. |
| 32 |
* |
| 33 |
* @param string $room Room identifier. |
| 34 |
* @return array Merged awarenessstate. |
| 35 |
*/ |
| 36 |
public function get_awareness_state( string $room ): array; |
| 37 |
|
| 38 |
/** |
| 39 |
* Remove all updates for a given room. |
| 40 |
* |
| 41 |
* @param string $room Room identifier. |
| 42 |
*/ |
| 43 |
public function remove_all_updates( string $room ): void; |
| 44 |
|
| 45 |
/** |
| 46 |
* Set awareness state for a given room. |
| 47 |
* |
| 48 |
* @param string $room Room identifier. |
| 49 |
* @param array $awareness Merged awareness state. |
| 50 |
*/ |
| 51 |
public function set_awareness_state( string $room, array $awareness ): void; |
| 52 |
} |
| 53 |
|