diff --git a/type-definitions/Immutable.d.ts b/type-definitions/Immutable.d.ts index baae41d011..05f572b4d8 100644 --- a/type-definitions/Immutable.d.ts +++ b/type-definitions/Immutable.d.ts @@ -3878,7 +3878,8 @@ declare module Immutable { * In case the `Collection` is empty returns the optional default * value if provided, if no default value is provided returns undefined. */ - first(notSetValue?: NSV): V | NSV; + first(): V | undefined; + first(notSetValue: NSV): V | NSV; /** * In case the `Collection` is not empty returns the last element of the @@ -3886,7 +3887,8 @@ declare module Immutable { * In case the `Collection` is empty returns the optional default * value if provided, if no default value is provided returns undefined. */ - last(notSetValue?: NSV): V | NSV; + last(): V | undefined; + last(notSetValue: NSV): V | NSV; // Reading deep values diff --git a/type-definitions/immutable.js.flow b/type-definitions/immutable.js.flow index 2b37f41437..c4aa6d191a 100644 --- a/type-definitions/immutable.js.flow +++ b/type-definitions/immutable.js.flow @@ -63,8 +63,10 @@ declare class _Collection implements ValueObject { has(key: K): boolean; includes(value: V): boolean; contains(value: V): boolean; - first(notSetValue?: NSV): V | NSV; - last(notSetValue?: NSV): V | NSV; + first(): V | undefined; + first(notSetValue: NSV): V | NSV; + last(): V | undefined; + last(notSetValue: NSV): V | NSV; hasIn(keyPath: Iterable): boolean;