Compare commits

...

3 Commits

Author SHA1 Message Date
Kevin Jahns
4a990963d9 13.0.0-88 2019-06-05 18:37:21 +02:00
Kevin Jahns
7e7c9d5b11 add relevant type information 2019-06-05 14:53:00 +02:00
Kevin Jahns
775f6eed1d fix websocket example 2019-06-02 15:16:14 +02:00
5 changed files with 9 additions and 5 deletions

View File

@@ -86,9 +86,7 @@ import { WebsocketProvider } from 'y-websocket'
import { TextareaBinding } from 'y-textarea'
const doc = Y.Doc()
const provider = new WebsocketProvider('http://localhost:1234', 'roomname')
// sync all document updates through the websocket connection
provider.sync('doc')
const provider = new WebsocketProvider('ws://localhost:1234', 'roomname', doc)
// Define a shared type on the document.
const ytext = doc.getText('my resume')

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.0.0-87",
"version": "13.0.0-88",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.0.0-87",
"version": "13.0.0-88",
"description": "Shared Editing Library",
"main": "./dist/yjs.js",
"module": "./dist/yjs.mjs",

View File

@@ -44,6 +44,9 @@ export class ContentType {
* @param {AbstractType<YEvent>} type
*/
constructor (type) {
/**
* @type {AbstractType<any>}
*/
this.type = type
}
/**

View File

@@ -138,6 +138,9 @@ export class Item extends AbstractStruct {
* @type {Item | null}
*/
this.redone = null
/**
* @type {AbstractContent}
*/
this.content = content
this.length = content.getLength()
this.countable = content.isCountable()