PointRef API
3 min
pointref objects keep a specific point in a document synced over time as new operations are applied to the editor it is created using the editor pointref method 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 the affinity refers to the direction the pointref will go when a user inserts content at the current position of the point interface pointref { current point | null affinity 'forward' | 'backward' | null unref() point | null } instance methods docid 6baes6i qxcsx9yuq4fm0static methods docid 6baes6i qxcsx9yuq4fm0transform methods docid 6baes6i qxcsx9yuq4fm0 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