Skip to content

Commit 468e565

Browse files
author
Travis CI
committed
Deploy 4585b0d to NPM branch
1 parent 3da44c4 commit 468e565

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

dist/immutable.js.flow

+22-12
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ type $ValOf<C, K = $KeyOf<C>> = $Call<
4949
K
5050
>;
5151

52+
type $IterableOf<C> = $Call<
53+
& (<V: Array<any> | IndexedCollection<any> | SetCollection<any>>(V) => Iterable<$ValOf<V>>)
54+
& (<V: KeyedCollection<any, any> | RecordInstance<any> | PlainObjInput<any, any>>(V) => Iterable<[$KeyOf<V>, $ValOf<V>]>),
55+
C
56+
>;
57+
5258
declare class _Collection<K, +V> /*implements ValueObject*/ {
5359
equals(other: mixed): boolean;
5460
hashCode(): number;
@@ -1372,6 +1378,10 @@ type RecordFactory<Values: Object> = Class<RecordInstance<Values>>;
13721378
// The type of runtime Record instances.
13731379
type RecordOf<Values: Object> = RecordInstance<Values> & Values;
13741380

1381+
// The values of a Record instance.
1382+
type _RecordValues<T, R: RecordInstance<T> | T> = R;
1383+
type RecordValues<R> = _RecordValues<*, R>;
1384+
13751385
declare function isRecord(maybeRecord: any): boolean %checks(maybeRecord instanceof RecordInstance);
13761386
declare class Record {
13771387
static <Values: Object>(spec: Values, name?: string): RecordFactory<Values>;
@@ -1383,10 +1393,10 @@ declare class Record {
13831393
}
13841394

13851395
declare class RecordInstance<T: Object> {
1386-
static (values?: $Shape<T> | Iterable<[$Keys<T>, any]>): RecordOf<T>;
1396+
static (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): RecordOf<T>;
13871397
// Note: a constructor can only create an instance of RecordInstance<T>,
13881398
// it's encouraged to not use `new` when creating Records.
1389-
constructor (values?: $Shape<T> | Iterable<[$Keys<T>, any]>): void;
1399+
constructor (values?: Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>): void;
13901400

13911401
size: number;
13921402

@@ -1407,16 +1417,16 @@ declare class RecordInstance<T: Object> {
14071417

14081418
set<K: $Keys<T>>(key: K, value: $ElementType<T, K>): this & T;
14091419
update<K: $Keys<T>>(key: K, updater: (value: $ElementType<T, K>) => $ElementType<T, K>): this & T;
1410-
merge(...collections: Array<$Shape<T> | Iterable<[$Keys<T>, any]>>): this & T;
1411-
mergeDeep(...collections: Array<$Shape<T> | Iterable<[$Keys<T>, any]>>): this & T;
1420+
merge(...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>): this & T;
1421+
mergeDeep(...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>): this & T;
14121422

14131423
mergeWith(
1414-
merger: (oldVal: any, newVal: any, key: $Keys<T>) => any,
1415-
...collections: Array<$Shape<T> | Iterable<[$Keys<T>, any]>>
1424+
merger: (oldVal: $ValOf<T>, newVal: $ValOf<T>, key: $Keys<T>) => $ValOf<T>,
1425+
...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
14161426
): this & T;
14171427
mergeDeepWith(
14181428
merger: (oldVal: any, newVal: any, key: any) => any,
1419-
...collections: Array<$Shape<T> | Iterable<[$Keys<T>, any]>>
1429+
...collections: Array<Iterable<[$Keys<T>, $ValOf<T>]> | $Shape<T>>
14201430
): this & T;
14211431

14221432
delete<K: $Keys<T>>(key: K): this & T;
@@ -1471,7 +1481,7 @@ declare class RecordInstance<T: Object> {
14711481
wasAltered(): boolean;
14721482
asImmutable(): this & T;
14731483

1474-
@@iterator(): Iterator<[$Keys<T>, any]>;
1484+
@@iterator(): Iterator<[$Keys<T>, $ValOf<T>]>;
14751485
}
14761486

14771487
declare function fromJS(
@@ -1533,21 +1543,21 @@ declare function updateIn<C, K: $KeyOf<C>, K2: $KeyOf<$ValOf<C, K>>, K3: $KeyOf<
15331543

15341544
declare function merge<C>(
15351545
collection: C,
1536-
...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
1546+
...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
15371547
): C;
15381548
declare function mergeWith<C>(
15391549
merger: (oldVal: $ValOf<C>, newVal: $ValOf<C>, key: $KeyOf<C>) => $ValOf<C>,
15401550
collection: C,
1541-
...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
1551+
...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
15421552
): C;
15431553
declare function mergeDeep<C>(
15441554
collection: C,
1545-
...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
1555+
...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
15461556
): C;
15471557
declare function mergeDeepWith<C>(
15481558
merger: (oldVal: any, newVal: any, key: any) => mixed,
15491559
collection: C,
1550-
...collections: Array<Iterable<$ValOf<C>> | Iterable<[$KeyOf<C>, $ValOf<C>]> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
1560+
...collections: Array<$IterableOf<C> | $Shape<RecordValues<C>> | PlainObjInput<$KeyOf<C>, $ValOf<C>>>
15511561
): C;
15521562

15531563
export {

0 commit comments

Comments
 (0)