diff --git a/src/lib/es2015.collection.d.ts b/src/lib/es2015.collection.d.ts index 81613800d50..717c9bb9c04 100644 --- a/src/lib/es2015.collection.d.ts +++ b/src/lib/es2015.collection.d.ts @@ -2,7 +2,7 @@ interface Map { clear(): void; delete(key: K): boolean; forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; + get(key: K): V | undefined; has(key: K): boolean; set(key: K, value?: V): Map; readonly size: number; @@ -18,7 +18,7 @@ declare var Map: MapConstructor; interface WeakMap { clear(): void; delete(key: K): boolean; - get(key: K): V; + get(key: K): V | undefined; has(key: K): boolean; set(key: K, value?: V): WeakMap; diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index 23f341a3c4f..fc93847f8af 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -10,7 +10,7 @@ interface Array { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T | undefined; /** * Returns the index of the first element in the array where predicate is true, and undefined @@ -21,7 +21,7 @@ interface Array { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; + findIndex(predicate: (value: T) => boolean, thisArg?: any): number | undefined; /** * Returns the this object after filling the section identified by start and end with value @@ -379,7 +379,7 @@ interface String { * If there is no element at that position, the result is undefined. * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. */ - codePointAt(pos: number): number; + codePointAt(pos: number): number | undefined; /** * Returns true if searchString appears as a substring of the result of converting this diff --git a/src/lib/es2015.symbol.d.ts b/src/lib/es2015.symbol.d.ts index 783a6b2acf0..cd7e45595f0 100644 --- a/src/lib/es2015.symbol.d.ts +++ b/src/lib/es2015.symbol.d.ts @@ -30,7 +30,7 @@ interface SymbolConstructor { * Otherwise, returns a undefined. * @param sym Symbol to find the key for. */ - keyFor(sym: symbol): string; + keyFor(sym: symbol): string | undefined; } declare var Symbol: SymbolConstructor; \ No newline at end of file diff --git a/src/lib/es2015.symbol.wellknown.d.ts b/src/lib/es2015.symbol.wellknown.d.ts index 8e229bf2687..110657e78b1 100644 --- a/src/lib/es2015.symbol.wellknown.d.ts +++ b/src/lib/es2015.symbol.wellknown.d.ts @@ -176,7 +176,7 @@ interface RegExp { * that search. * @param string A string to search within. */ - [Symbol.match](string: string): RegExpMatchArray; + [Symbol.match](string: string): RegExpMatchArray | null; /** * Replaces text in a string, using this regular expression. @@ -230,7 +230,7 @@ interface String { * Matches a string an object that supports being matched against, and returns an array containing the results of that search. * @param matcher An object that supports being matched against. */ - match(matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray; + match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; /** * Replaces text in a string, using an object that supports replacement within a string.