-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(json-crdt-extensions): 馃幐 implement overlay "ref" concept
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type {SplitSlice} from '../slice/SplitSlice'; | ||
import type {Slice} from '../slice/types'; | ||
|
||
/** | ||
* On overlay "ref" is a reference from the {@link Overlay} to a {@link Slice}. | ||
* In case of a *marker* slice, the reference is to the slice itself. In case of | ||
* a regular annotation slice, two references are needed: one to the start slice | ||
* and one to the end slice. | ||
*/ | ||
export type OverlayRef = | ||
| SplitSlice // Ref to a *marker* slice | ||
| OverlayRefSliceStart // Ref to the start of an annotation slice | ||
| OverlayRefSliceEnd; // Ref to the end of an annotation slice | ||
|
||
export class OverlayRefSliceStart { | ||
constructor(public readonly slice: Slice) {} | ||
} | ||
|
||
export class OverlayRefSliceEnd { | ||
constructor(public readonly slice: Slice) {} | ||
} |