@@ -3,32 +3,34 @@ import {SliceType} from '../types';
33import type { Anchor } from '../rga/constants' ;
44import type { AbstractRga } from '../../../json-crdt/nodes/rga' ;
55import type { ITimestampStruct } from '../../../json-crdt-patch/clock' ;
6- import type { SplitSlice } from '../slice/SplitSlice ' ;
6+ import type { MarkerSlice } from '../slice/MarkerSlice ' ;
77
8- export class OverlayPointMarker extends OverlayPoint {
8+ export class MarkerOverlayPoint extends OverlayPoint {
99 /**
1010 * Hash value of the preceding text contents, up until the next marker.
1111 */
1212 public textHash : number = 0 ;
1313
14- /** @todo splice can always be set, maybe? */
15- constructor ( protected readonly rga : AbstractRga < string > , id : ITimestampStruct , anchor : Anchor , public readonly slice : SplitSlice | undefined ) {
14+ constructor ( protected readonly rga : AbstractRga < string > , id : ITimestampStruct , anchor : Anchor , public readonly marker : MarkerSlice ) {
1615 super ( rga , id , anchor ) ;
1716 }
1817
19- /** @todo Rename or access it directly. */
18+ /**
19+ * @todo Rename or access it directly.
20+ * @deprecated
21+ */
2022 public markerHash ( ) : number {
21- return this . slice ? this . slice . hash : 0 ;
23+ return this . marker ? this . marker . hash : 0 ;
2224 }
2325
2426 public tag ( ) : SliceType | 0 {
25- if ( ! this . slice ) return 0 ;
26- return this . slice . type ;
27+ if ( ! this . marker ) return 0 ;
28+ return this . marker . type ;
2729 }
2830
2931 public data ( ) : unknown {
30- if ( ! this . slice ) return undefined ;
31- return this . slice . data ( ) ;
32+ if ( ! this . marker ) return undefined ;
33+ return this . marker . data ( ) ;
3234 }
3335
3436 // ---------------------------------------------------------------- Printable
0 commit comments