@@ -99,10 +99,10 @@ declare module 'immutable/contrib/cursor' {
99
99
* point in the new data.
100
100
*
101
101
* Note: `delete` cannot be safely used in IE8
102
- * @alias delete
102
+ * @alias remove
103
103
*/
104
- remove ( key : any ) : Cursor ;
105
104
delete ( key : any ) : Cursor ;
105
+ remove ( key : any ) : Cursor ;
106
106
107
107
/**
108
108
* Clears the value at this cursor, returning a new cursor to the same
@@ -119,6 +119,138 @@ declare module 'immutable/contrib/cursor' {
119
119
update ( key : any , updater : ( value : any ) => any ) : Cursor ;
120
120
update ( key : any , notSetValue : any , updater : ( value : any ) => any ) : Cursor ;
121
121
122
+ /**
123
+ * @see `Map#merge`
124
+ */
125
+ merge ( ...iterables : Immutable . Iterable < any , any > [ ] ) : Cursor ;
126
+ merge ( ...iterables : { [ key : string ] : any } [ ] ) : Cursor ;
127
+
128
+ /**
129
+ * @see `Map#mergeWith`
130
+ */
131
+ mergeWith (
132
+ merger : ( previous ?: any , next ?: any ) => any ,
133
+ ...iterables : Immutable . Iterable < any , any > [ ]
134
+ ) : Cursor ;
135
+ mergeWith (
136
+ merger : ( previous ?: any , next ?: any ) => any ,
137
+ ...iterables : { [ key : string ] : any } [ ]
138
+ ) : Cursor ;
139
+
140
+ /**
141
+ * @see `Map#mergeDeep`
142
+ */
143
+ mergeDeep ( ...iterables : Immutable . Iterable < any , any > [ ] ) : Cursor ;
144
+ mergeDeep ( ...iterables : { [ key : string ] : any } [ ] ) : Cursor ;
145
+
146
+ /**
147
+ * @see `Map#mergeDeepWith`
148
+ */
149
+ mergeDeepWith (
150
+ merger : ( previous ?: any , next ?: any ) => any ,
151
+ ...iterables : Immutable . Iterable < any , any > [ ]
152
+ ) : Cursor ;
153
+ mergeDeepWith (
154
+ merger : ( previous ?: any , next ?: any ) => any ,
155
+ ...iterables : { [ key : string ] : any } [ ]
156
+ ) : Cursor ;
157
+
158
+ // Deep persistent changes
159
+
160
+ /**
161
+ * Returns a new Cursor having set `value` at this `keyPath`. If any keys in
162
+ * `keyPath` do not exist, a new immutable Map will be created at that key.
163
+ */
164
+ setIn ( keyPath : Array < any > , value : any ) : Cursor ;
165
+ setIn ( keyPath : Immutable . Iterable < any , any > , value : any ) : Cursor ;
166
+
167
+ /**
168
+ * Returns a new Cursor having removed the value at this `keyPath`.
169
+ *
170
+ * @alias removeIn
171
+ */
172
+ deleteIn ( keyPath : Array < any > ) : Cursor ;
173
+ deleteIn ( keyPath : Immutable . Iterable < any , any > ) : Cursor ;
174
+ removeIn ( keyPath : Array < any > ) : Cursor ;
175
+ removeIn ( keyPath : Immutable . Iterable < any , any > ) : Cursor ;
176
+
177
+ /**
178
+ * Returns a new Cursor having applied the `updater` to the value found at
179
+ * the keyPath.
180
+ *
181
+ * If any keys in `keyPath` do not exist, new Immutable `Map`s will
182
+ * be created at those keys. If the `keyPath` does not already contain a
183
+ * value, the `updater` function will be called with `notSetValue`, if
184
+ * provided, otherwise `undefined`.
185
+ *
186
+ * If the `updater` function returns the same value it was called with, then
187
+ * no change will occur. This is still true if `notSetValue` is provided.
188
+ */
189
+ updateIn (
190
+ keyPath : Array < any > ,
191
+ updater : ( value : any ) => any
192
+ ) : Cursor ;
193
+ updateIn (
194
+ keyPath : Array < any > ,
195
+ notSetValue : any ,
196
+ updater : ( value : any ) => any
197
+ ) : Cursor ;
198
+ updateIn (
199
+ keyPath : Immutable . Iterable < any , any > ,
200
+ updater : ( value : any ) => any
201
+ ) : Cursor ;
202
+ updateIn (
203
+ keyPath : Immutable . Iterable < any , any > ,
204
+ notSetValue : any ,
205
+ updater : ( value : any ) => any
206
+ ) : Cursor ;
207
+
208
+ /**
209
+ * A combination of `updateIn` and `merge`, returning a new Cursor, but
210
+ * performing the merge at a point arrived at by following the keyPath.
211
+ * In other words, these two lines are equivalent:
212
+ *
213
+ * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y));
214
+ * x.mergeIn(['a', 'b', 'c'], y);
215
+ *
216
+ */
217
+ mergeIn (
218
+ keyPath : Immutable . Iterable < any , any > ,
219
+ ...iterables : Immutable . Iterable < any , any > [ ]
220
+ ) : Cursor ;
221
+ mergeIn (
222
+ keyPath : Array < any > ,
223
+ ...iterables : Immutable . Iterable < any , any > [ ]
224
+ ) : Cursor ;
225
+ mergeIn (
226
+ keyPath : Array < any > ,
227
+ ...iterables : { [ key : string ] : any } [ ]
228
+ ) : Cursor ;
229
+
230
+ /**
231
+ * A combination of `updateIn` and `mergeDeep`, returning a new Cursor, but
232
+ * performing the deep merge at a point arrived at by following the keyPath.
233
+ * In other words, these two lines are equivalent:
234
+ *
235
+ * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y));
236
+ * x.mergeDeepIn(['a', 'b', 'c'], y);
237
+ *
238
+ */
239
+ mergeDeepIn (
240
+ keyPath : Immutable . Iterable < any , any > ,
241
+ ...iterables : Immutable . Iterable < any , any > [ ]
242
+ ) : Cursor ;
243
+ mergeDeepIn (
244
+ keyPath : Array < any > ,
245
+ ...iterables : Immutable . Iterable < any , any > [ ]
246
+ ) : Cursor ;
247
+ mergeDeepIn (
248
+ keyPath : Array < any > ,
249
+ ...iterables : { [ key : string ] : any } [ ]
250
+ ) : Cursor ;
251
+
252
+ // Transient changes
253
+
122
254
/**
123
255
* Every time you call one of the above functions, a new immutable value is
124
256
* created and the callback is triggered. If you need to apply a series of
0 commit comments