You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the yorkie documentation includes information on TypeScript, it would be helpful to provide an explanation on the usage of JSONElement types. Yorkie-js-sdk uses a proxy, and to use methods like array.insertAfter and array.insertBefore that are not available in the native JS type, specifying the type as JSONElement is necessary.
typeDocType={list: JSONArray<number>;};constdoc=newyorkie.Document<DocType>('sample-doc');doc.update((root)=>{root.list=[0,1];root.list.push(2);});doc.update((root)=>{// to use methods like `getElementByIndex` and `moveAfter`, the type should be specified as `JSONArray`constprev=root.list.getElementByIndex(0);constitem=root.list.getElementByIndex(1);root.list.moveAfter(prev.getID(),item.getID());});
The text was updated successfully, but these errors were encountered:
Description:
While the yorkie documentation includes information on TypeScript, it would be helpful to provide an explanation on the usage of JSONElement types. Yorkie-js-sdk uses a proxy, and to use methods like
array.insertAfter
andarray.insertBefore
that are not available in the native JS type, specifying the type as JSONElement is necessary.The text was updated successfully, but these errors were encountered: