diff --git a/jupyter_ydoc/ybasedoc.py b/jupyter_ydoc/ybasedoc.py index aaebe40..cf3a2cb 100644 --- a/jupyter_ydoc/ybasedoc.py +++ b/jupyter_ydoc/ybasedoc.py @@ -114,6 +114,26 @@ def dirty(self, value: bool) -> None: """ self._ystate["dirty"] = value + @property + def hash(self) -> Optional[str]: + """ + Returns the document hash as computed by contents manager. + + :return: The document hash. + :rtype: Optional[str] + """ + return self._ystate.get("hash") + + @hash.setter + def hash(self, value: str) -> None: + """ + Sets the document hash. + + :param value: The document hash. + :type value: str + """ + self._ystate["hash"] = value + @property def path(self) -> Optional[str]: """