@@ -4,7 +4,8 @@ import {encoder, decoder} from '../codec/structural/binary/shared';
44import { ModelApi } from './api' ;
55import { ORIGIN , SESSION , SYSTEM_SESSION_TIME } from '../../json-crdt-patch/constants' ;
66import { randomSessionId } from './util' ;
7- import { ConNode , RootNode , ValNode , VecNode , ObjNode , StrNode , BinNode , ArrNode } from '../nodes' ;
7+ import { RootNode , ValNode , VecNode , ObjNode , StrNode , BinNode , ArrNode } from '../nodes' ;
8+ import { ConNode } from '../nodes/const/ConNode' ;
89import { printTree } from 'tree-dump/lib/printTree' ;
910import { Extensions } from '../extensions/Extensions' ;
1011import { AvlMap } from 'sonic-forest/lib/avl/AvlMap' ;
@@ -132,8 +133,8 @@ export class Model<N extends JsonNode = JsonNode<any>> implements Printable {
132133 ? new clock . ServerClockVector ( SESSION . SERVER , 1 )
133134 : new clock . ClockVector ( sidOrClock , 1 )
134135 : sidOrClock ;
135- type Node = S extends undefined ? JsonNode : S extends NodeBuilder ? SchemaToJsonNode < S > : SchemaToJsonNode < nodes . json < S > > ;
136- const model = new Model < Node > ( cl ) ;
136+ type Node = undefined extends S ? JsonNode : S extends NodeBuilder ? SchemaToJsonNode < S > : SchemaToJsonNode < nodes . json < S > > ;
137+ const model : Model < Node > = new Model < Node > ( cl ) ;
137138 if ( schema !== void 0 ) model . setSchema ( schema instanceof NodeBuilder ? schema : s . json ( schema ) , true ) ;
138139 return model ;
139140 } ;
0 commit comments