Add documentation & clarification to clone method #622

This commit is contained in:
Kevin Jahns 2024-03-14 20:33:34 +01:00
parent b235c57d76
commit 2fba694cd4
8 changed files with 32 additions and 0 deletions

View File

@ -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<EventType>}
*/
clone () {

View File

@ -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<T>}
*/
clone () {

View File

@ -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<MapType>}
*/
clone () {

View File

@ -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 () {

View File

@ -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<KV>}
*/
clone () {

View File

@ -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 () {

View File

@ -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 () {

View File

@ -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 () {