Skip to content

Commit

Permalink
chore(json-crdt-extensions): 🤖 cleanup marker overlay code
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed May 9, 2024
1 parent eb7fc09 commit 975c95f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
10 changes: 1 addition & 9 deletions src/json-crdt-extensions/peritext/overlay/MarkerOverlayPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ export class MarkerOverlayPoint<T = string> extends OverlayPoint<T> implements H
super(rga, id, anchor);
}

/**
* @todo Rename or access it directly.
* @deprecated
*/
public markerHash(): number {
return this.marker ? this.marker.hash : 0;
}

public type(): SliceType {
return this.marker && this.marker.type;
}
Expand Down Expand Up @@ -59,7 +51,7 @@ export class MarkerOverlayPoint<T = string> extends OverlayPoint<T> implements H
);
}

// ---------------------------------------------------------------- Printable
// ------------------------------------------------------------ HeadlessNode2

public p2: MarkerOverlayPoint<T> | undefined;
public l2: MarkerOverlayPoint<T> | undefined;
Expand Down
5 changes: 0 additions & 5 deletions src/json-crdt-extensions/peritext/overlay/OverlayPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export class OverlayPoint<T = string> extends Point<T> implements Printable, Hea
/**
* Collapsed slices - markers (block splits), which represent a single point
* in the text, even if the start and end of the slice are different.
* @deprecated This field might happen to be not necessary.
*/
public readonly markers: Slice<T>[] = [];

Expand All @@ -96,10 +95,8 @@ export class OverlayPoint<T = string> extends Point<T> implements Printable, Hea
* the state of the point. The markers are sorted by the slice ID.
*
* @param slice Slice to add to the marker list.
* @deprecated This method might happen to be not necessary.
*/
public addMarker(slice: Slice<T>): void {
/** @deprecated */
const markers = this.markers;
const length = markers.length;
if (!length) {
Expand Down Expand Up @@ -131,10 +128,8 @@ export class OverlayPoint<T = string> extends Point<T> implements Printable, Hea
* the text, even if the start and end of the slice are different.
*
* @param slice Slice to remove from the marker list.
* @deprecated This method might happen to be not necessary.
*/
public removeMarker(slice: Slice<T>): void {
/** @deprecated */
const markers = this.markers;
const length = markers.length;
for (let i = 0; i < length; i++) {
Expand Down

0 comments on commit 975c95f

Please sign in to comment.