From f053285c288b819c71ed56b9b2b55e52fa6b9e99 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Mon, 18 Mar 2024 10:57:37 +0100 Subject: [PATCH] Rename connectFork to connect --- javascript/src/api.ts | 4 ++-- javascript/src/ydocument.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/javascript/src/api.ts b/javascript/src/api.ts index 7ce28a8..26fafd1 100644 --- a/javascript/src/api.ts +++ b/javascript/src/api.ts @@ -95,9 +95,9 @@ export interface IDocumentProvider extends IDisposable { fork(): Promise; /** - * Connect the shared document to a forked room with forkId (disconnect from previous room). + * Connect the shared document to a room with given ID (disconnect from previous room). */ - connectFork(forkId: string): void; + connect(roomId: string): void; } /** diff --git a/javascript/src/ydocument.ts b/javascript/src/ydocument.ts index 77aab77..8c31d61 100644 --- a/javascript/src/ydocument.ts +++ b/javascript/src/ydocument.ts @@ -7,7 +7,12 @@ import { JSONExt, JSONObject, JSONValue } from '@lumino/coreutils'; import { ISignal, Signal } from '@lumino/signaling'; import { Awareness } from 'y-protocols/awareness'; import * as Y from 'yjs'; -import type { DocumentChange, IDocumentProvider, ISharedDocument, StateChange } from './api'; +import type { + DocumentChange, + IDocumentProvider, + ISharedDocument, + StateChange +} from './api.js'; /** * Generic shareable document. @@ -18,7 +23,7 @@ export abstract class YDocument constructor(options?: YDocument.IOptions) { this._ydoc = options?.ydoc ?? new Y.Doc(); this.rootRoomId = options?.rootRoomId ?? ''; - this.currentRoomId = options?.currentRoomId ?? '' + this.currentRoomId = options?.currentRoomId ?? ''; this._ystate = this._ydoc.getMap('state');