Skip to content

Commit 04227ec

Browse files
committed
Make YDocument an abstract class with abstract version member, remove YDocument.create()
1 parent 3902151 commit 04227ec

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

javascript/src/ydocument.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { DocumentChange, ISharedDocument, StateChange } from './api.js';
1212
/**
1313
* Generic shareable document.
1414
*/
15-
export class YDocument<T extends DocumentChange> implements Omit<ISharedDocument, 'version'> {
15+
export abstract class YDocument<T extends DocumentChange> implements ISharedDocument {
1616
constructor(options?: YDocument.IOptions) {
1717
this._ydoc = options?.ydoc ?? new Y.Doc();
1818

@@ -29,11 +29,9 @@ export class YDocument<T extends DocumentChange> implements Omit<ISharedDocument
2929
}
3030

3131
/**
32-
* Creates a standalone YDocument
32+
* Document version
3333
*/
34-
static create(): YDocument<DocumentChange> {
35-
return new YDocument();
36-
}
34+
abstract readonly version: string;
3735

3836
/**
3937
* YJS document.

0 commit comments

Comments
 (0)