PathRef API
2 min
pathref objects keep a specific path in a document synced over time as new operations are applied to the editor it is created using the editor pathref method you can access their property current at any time for the up to date path value when you no longer need to track this location, call unref() to free the resources the affinity refers to the direction the pathref will go when a user inserts content at the current position of the path interface pathref { current path | null affinity 'forward' | 'backward' | null unref() path | null } static methods docid\ hgghaz9gtugb 9kubcny transform methods docid\ hgghaz9gtugb 9kubcny static methods transform methods pathref transform(ref pathref, op operation) transform the path refs current value by an op the editor calls this as needed, so normally you won't need to