2022-05-16 16:56:20 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Edit;
|
|
|
|
|
|
2022-10-29 18:52:23 +00:00
|
|
|
use Wikimedia\Parsoid\Core\SelserData;
|
2022-05-16 16:56:20 +00:00
|
|
|
|
|
|
|
|
/**
|
2022-10-29 18:52:23 +00:00
|
|
|
* Stash for Parsoid output and associated data as needed to perform selective serialization (aka "selser")
|
|
|
|
|
* of modified HTML.
|
2022-05-16 16:56:20 +00:00
|
|
|
*
|
2022-10-29 18:52:23 +00:00
|
|
|
* @see SelserData
|
|
|
|
|
*
|
|
|
|
|
* @internal
|
2022-05-16 16:56:20 +00:00
|
|
|
* @since 1.39
|
|
|
|
|
*/
|
|
|
|
|
interface ParsoidOutputStash {
|
|
|
|
|
|
|
|
|
|
/**
|
2022-10-29 18:52:23 +00:00
|
|
|
* Stash a SelserContext representing a rendering of a revision at a given point in time,
|
|
|
|
|
* along with information about the content the rendering was based on.
|
2022-05-16 16:56:20 +00:00
|
|
|
*
|
2022-10-29 18:52:23 +00:00
|
|
|
* A SelserContext stashed by calling this method can for some time be retrieved by
|
|
|
|
|
* calling the get() method.
|
2022-05-16 16:56:20 +00:00
|
|
|
*
|
|
|
|
|
* @param ParsoidRenderID $renderId Combination of revision ID and revision's time ID
|
2022-10-29 18:52:23 +00:00
|
|
|
* @param SelserContext $selserContext
|
2022-05-16 16:56:20 +00:00
|
|
|
*
|
|
|
|
|
* @return bool True on success
|
|
|
|
|
*/
|
2022-10-29 18:52:23 +00:00
|
|
|
public function set( ParsoidRenderID $renderId, SelserContext $selserContext ): bool;
|
2022-05-16 16:56:20 +00:00
|
|
|
|
|
|
|
|
/**
|
2022-10-29 18:52:23 +00:00
|
|
|
* Retrieve a SelserContext representing a rendering of a revision at a given point in time,
|
|
|
|
|
* along with information about the content the rendering was based on.
|
2022-05-16 16:56:20 +00:00
|
|
|
*
|
2022-10-29 18:52:23 +00:00
|
|
|
* If a SelserContext was stahed using the set() method not too long ago, it can be expected
|
|
|
|
|
* to be returned from this method.
|
2022-05-16 16:56:20 +00:00
|
|
|
*
|
|
|
|
|
* @param ParsoidRenderID $renderId
|
|
|
|
|
*
|
2022-10-29 18:52:23 +00:00
|
|
|
* @return ?SelserContext
|
2022-05-16 16:56:20 +00:00
|
|
|
*/
|
2022-10-29 18:52:23 +00:00
|
|
|
public function get( ParsoidRenderID $renderId ): ?SelserContext;
|
2022-05-16 16:56:20 +00:00
|
|
|
|
|
|
|
|
}
|