Merge ".mailmap: Correct two contributor names"
[mediawiki.git] / includes / edit / ParsoidOutputStash.php
blob5ac48a7db2ff8be98f329587a88f34041a5a1881
1 <?php
3 namespace MediaWiki\Edit;
5 use Wikimedia\Parsoid\Core\SelserData;
7 /**
8 * Stash for Parsoid output and associated data as needed to perform selective serialization (aka "selser")
9 * of modified HTML.
11 * @see SelserData
13 * @internal
14 * @since 1.39
16 interface ParsoidOutputStash {
18 /**
19 * Stash a SelserContext representing a rendering of a revision at a given point in time,
20 * along with information about the content the rendering was based on.
22 * A SelserContext stashed by calling this method can for some time be retrieved by
23 * calling the get() method.
25 * @param ParsoidRenderID $renderId Combination of revision ID and revision's time ID
26 * @param SelserContext $selserContext
28 * @return bool True on success
30 public function set( ParsoidRenderID $renderId, SelserContext $selserContext ): bool;
32 /**
33 * Retrieve a SelserContext representing a rendering of a revision at a given point in time,
34 * along with information about the content the rendering was based on.
36 * If a SelserContext was stahed using the set() method not too long ago, it can be expected
37 * to be returned from this method.
39 * @param ParsoidRenderID $renderId
41 * @return ?SelserContext
43 public function get( ParsoidRenderID $renderId ): ?SelserContext;