Skip to content

Commit 5847c75

Browse files
committed
refactor(json-crdt-extensions): 💡 rename MarkerOverlayPoint
1 parent b3d4cee commit 5847c75

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/json-crdt-extensions/peritext/overlay/OverlayPointMarker.ts renamed to src/json-crdt-extensions/peritext/overlay/MarkerOverlayPoint.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@ import {SliceType} from '../types';
33
import type {Anchor} from '../rga/constants';
44
import type {AbstractRga} from '../../../json-crdt/nodes/rga';
55
import 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

Comments
 (0)