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

2
package-lock.json generated
View File

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

View File

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

View File

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

View File

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