@@ -900,13 +900,7 @@ export class ModelApi<N extends JsonNode = JsonNode> extends ValApi<RootNode<N>>
900900 } else throw new Error ( 'UNKNOWN_NODE' ) ;
901901 }
902902
903- /**
904- * Local changes API for the root node.
905- */
906- public get r ( ) {
907- return new ValApi ( this . model . root , this ) ;
908- }
909-
903+ // TODO: Move to node.
910904 public get $ ( ) : JsonNodeToProxyPathNode < N > {
911905 return proxy$ ( ( path ) => {
912906 try {
@@ -917,17 +911,6 @@ export class ModelApi<N extends JsonNode = JsonNode> extends ValApi<RootNode<N>>
917911 } , '$' ) as any ;
918912 }
919913
920- /**
921- * Traverses the model starting from the root node and returns a local
922- * changes API for a node at the given path.
923- *
924- * @param path Path at which to locate a node.
925- * @returns A local changes API for a node at the given path.
926- */
927- public in ( path ?: ApiPath ) {
928- return this . r . in ( path ) ;
929- }
930-
931914 /**
932915 * Given a JSON/CBOR value, constructs CRDT nodes recursively out of it and
933916 * sets the root node of the model to the constructed nodes.
@@ -977,34 +960,6 @@ export class ModelApi<N extends JsonNode = JsonNode> extends ValApi<RootNode<N>>
977960 this . onLocalChange . emit ( from ) ;
978961 }
979962
980- public select ( path ?: ApiPath , leaf ?: boolean ) {
981- return this . r . select ( path , leaf ) ;
982- }
983-
984- /**
985- * Reads the value at the given path in the model. If no path is provided,
986- * returns the root node's view.
987- *
988- * @param path Path at which to read the value.
989- * @returns The value at the given path, or the root node's view if no path
990- * is provided.
991- */
992- public read ( path ?: ApiPath ) : unknown {
993- return this . r . read ( path ) ;
994- }
995-
996- public add ( path : ApiPath , value : unknown ) : boolean {
997- return this . r . add ( path , value ) ;
998- }
999-
1000- public replace ( path : ApiPath , value : unknown ) : boolean {
1001- return this . r . replace ( path , value ) ;
1002- }
1003-
1004- public remove ( path : ApiPath , length ?: number ) : boolean {
1005- return this . r . remove ( path , length ) ;
1006- }
1007-
1008963 private inTx = false ;
1009964 public transaction ( callback : ( ) => void ) {
1010965 if ( this . inTx ) callback ( ) ;
0 commit comments