From 2fba694cd4c605812914082a27b0bcfa1011dca0 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Thu, 14 Mar 2024 20:33:34 +0100 Subject: [PATCH] Add documentation & clarification to clone method #622 --- src/types/AbstractType.js | 4 ++++ src/types/YArray.js | 4 ++++ src/types/YMap.js | 4 ++++ src/types/YText.js | 4 ++++ src/types/YXmlElement.js | 4 ++++ src/types/YXmlFragment.js | 4 ++++ src/types/YXmlHook.js | 4 ++++ src/types/YXmlText.js | 4 ++++ 8 files changed, 32 insertions(+) diff --git a/src/types/AbstractType.js b/src/types/AbstractType.js index 4cc1bf8a..8927548e 100644 --- a/src/types/AbstractType.js +++ b/src/types/AbstractType.js @@ -316,6 +316,10 @@ export class AbstractType { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {AbstractType} */ clone () { diff --git a/src/types/YArray.js b/src/types/YArray.js index a895274e..54a20c19 100644 --- a/src/types/YArray.js +++ b/src/types/YArray.js @@ -95,6 +95,10 @@ export class YArray extends AbstractType { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {YArray} */ clone () { diff --git a/src/types/YMap.js b/src/types/YMap.js index 855ccb4f..974e7316 100644 --- a/src/types/YMap.js +++ b/src/types/YMap.js @@ -88,6 +88,10 @@ export class YMap extends AbstractType { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {YMap} */ clone () { diff --git a/src/types/YText.js b/src/types/YText.js index 8de9260e..8919b009 100644 --- a/src/types/YText.js +++ b/src/types/YText.js @@ -897,6 +897,10 @@ export class YText extends AbstractType { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {YText} */ clone () { diff --git a/src/types/YXmlElement.js b/src/types/YXmlElement.js index 1c1f3190..48029f69 100644 --- a/src/types/YXmlElement.js +++ b/src/types/YXmlElement.js @@ -81,6 +81,10 @@ export class YXmlElement extends YXmlFragment { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {YXmlElement} */ clone () { diff --git a/src/types/YXmlFragment.js b/src/types/YXmlFragment.js index b229a4ac..496c5ab6 100644 --- a/src/types/YXmlFragment.js +++ b/src/types/YXmlFragment.js @@ -163,6 +163,10 @@ export class YXmlFragment extends AbstractType { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {YXmlFragment} */ clone () { diff --git a/src/types/YXmlHook.js b/src/types/YXmlHook.js index c5b5ed6d..1bf24846 100644 --- a/src/types/YXmlHook.js +++ b/src/types/YXmlHook.js @@ -29,6 +29,10 @@ export class YXmlHook extends YMap { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {YXmlHook} */ clone () { diff --git a/src/types/YXmlText.js b/src/types/YXmlText.js index 413b247c..ab02dbf3 100644 --- a/src/types/YXmlText.js +++ b/src/types/YXmlText.js @@ -30,6 +30,10 @@ export class YXmlText extends YText { } /** + * Makes a copy of this data type that can be included somewhere else. + * + * Note that the content is only readable _after_ it has been included somewhere in the Ydoc. + * * @return {YXmlText} */ clone () {