@loro-extended/change 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -103,6 +103,11 @@ declare abstract class TypedRef<Shape extends DocShape | ContainerShape> {
103
103
  protected get shape(): Shape;
104
104
  protected get placeholder(): Infer<Shape> | undefined;
105
105
  protected get readonly(): boolean;
106
+ /**
107
+ * Throws an error if this ref is in readonly mode.
108
+ * Call this at the start of any mutating method.
109
+ */
110
+ protected assertMutable(): void;
106
111
  protected get container(): ShapeToContainer<Shape>;
107
112
  }
108
113
 
@@ -160,7 +165,7 @@ declare class MapRef<NestedShapes extends Record<string, ContainerOrValueShape>>
160
165
  protected get container(): LoroMap;
161
166
  absorbPlainValues(): void;
162
167
  getTypedRefParams<S extends ContainerShape>(key: string, shape: S): TypedRefParams<ContainerShape>;
163
- getOrCreateNode<Shape extends ContainerShape | ValueShape>(key: string, shape: Shape): any;
168
+ getOrCreateRef<Shape extends ContainerShape | ValueShape>(key: string, shape: Shape): any;
164
169
  private createLazyProperties;
165
170
  toJSON(): any;
166
171
  get(key: string): any;
@@ -183,13 +188,13 @@ declare class MovableListRef<NestedShape extends ContainerOrValueShape, Item = N
183
188
 
184
189
  declare class RecordRef<NestedShape extends ContainerOrValueShape> extends TypedRef<any> {
185
190
  [key: string]: Infer<NestedShape> | any;
186
- private nodeCache;
191
+ private refCache;
187
192
  protected get shape(): RecordContainerShape<NestedShape>;
188
193
  protected get container(): LoroMap;
189
194
  absorbPlainValues(): void;
190
195
  getTypedRefParams<S extends ContainerShape>(key: string, shape: S): TypedRefParams<ContainerShape>;
191
- getOrCreateNode(key: string): any;
192
- get(key: string): InferDraftType<NestedShape>;
196
+ getOrCreateRef(key: string): any;
197
+ get(key: string): InferMutableType<NestedShape>;
193
198
  set(key: string, value: any): void;
194
199
  setContainer<C extends Container>(key: string, container: C): C;
195
200
  delete(key: string): void;