PointRef
PointRef objects keep a specific point in a document synced over time as new operations are applied to the editor. You can access their property current at any time for the up-to-date Point value. When you no longer need to track this location, call unref() to free the resources.
1
interface PointRef {
2
current: Point | null
3
affinity: 'forward' | 'backward' | null
4
unref(): Point | null
5
}
Copied!

Instance methods

unRef() => Point

Call this when you no longer need to sync this point. It also returns the current value.

Static methods

Transform methods

PointRef.transform(ref: PointRef, op: Operation)

Transform the point refs current value by an op. The editor calls this as needed, so normally you won't need to.
Last modified 1mo ago