Constructors

Properties

Methods

Constructors

Properties

client: HttpClient
docId: string

Methods

  • Returns an entire document, represented as a Yjs update byte string.

    This can be turned back into a Yjs document as follows:

    import * as Y from 'yjs'

    let update = await manager.getDocAsUpdate(docId)
    let doc = new Y.Doc()
    doc.transact(() => {
    Y.applyUpdate(doc, update)
    })

    Returns Promise<Uint8Array>

  • Updates a document with the given Yjs update byte string.

    This can be generated from a Yjs document as follows:

    import * as Y from 'yjs'

    let doc = new Y.Doc()
    // Modify the document...
    let update = Y.encodeStateAsUpdate(doc)
    await manager.updateDoc(docId, update)

    Parameters

    • update: Uint8Array

    Returns Promise<void>