Skip to content

Commit 65fdfd2

Browse files
committed
Merge pull request #7835 from Microsoft/fix7810
Add nullability into signature
2 parents 988063e + 71994dd commit 65fdfd2

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/lib/es2015.collection.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ interface Map<K, V> {
22
clear(): void;
33
delete(key: K): boolean;
44
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
5-
get(key: K): V;
5+
get(key: K): V | undefined;
66
has(key: K): boolean;
77
set(key: K, value?: V): Map<K, V>;
88
readonly size: number;
@@ -18,7 +18,7 @@ declare var Map: MapConstructor;
1818
interface WeakMap<K, V> {
1919
clear(): void;
2020
delete(key: K): boolean;
21-
get(key: K): V;
21+
get(key: K): V | undefined;
2222
has(key: K): boolean;
2323
set(key: K, value?: V): WeakMap<K, V>;
2424

src/lib/es2015.core.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface Array<T> {
1010
* @param thisArg If provided, it will be used as the this value for each invocation of
1111
* predicate. If it is not provided, undefined is used instead.
1212
*/
13-
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
13+
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T | undefined;
1414

1515
/**
1616
* Returns the index of the first element in the array where predicate is true, and undefined
@@ -21,7 +21,7 @@ interface Array<T> {
2121
* @param thisArg If provided, it will be used as the this value for each invocation of
2222
* predicate. If it is not provided, undefined is used instead.
2323
*/
24-
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
24+
findIndex(predicate: (value: T) => boolean, thisArg?: any): number | undefined;
2525

2626
/**
2727
* Returns the this object after filling the section identified by start and end with value
@@ -379,7 +379,7 @@ interface String {
379379
* If there is no element at that position, the result is undefined.
380380
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
381381
*/
382-
codePointAt(pos: number): number;
382+
codePointAt(pos: number): number | undefined;
383383

384384
/**
385385
* Returns true if searchString appears as a substring of the result of converting this

src/lib/es2015.symbol.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface SymbolConstructor {
3030
* Otherwise, returns a undefined.
3131
* @param sym Symbol to find the key for.
3232
*/
33-
keyFor(sym: symbol): string;
33+
keyFor(sym: symbol): string | undefined;
3434
}
3535

3636
declare var Symbol: SymbolConstructor;

src/lib/es2015.symbol.wellknown.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ interface RegExp {
176176
* that search.
177177
* @param string A string to search within.
178178
*/
179-
[Symbol.match](string: string): RegExpMatchArray;
179+
[Symbol.match](string: string): RegExpMatchArray | null;
180180

181181
/**
182182
* Replaces text in a string, using this regular expression.
@@ -230,7 +230,7 @@ interface String {
230230
* Matches a string an object that supports being matched against, and returns an array containing the results of that search.
231231
* @param matcher An object that supports being matched against.
232232
*/
233-
match(matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray;
233+
match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
234234

235235
/**
236236
* Replaces text in a string, using an object that supports replacement within a string.

0 commit comments

Comments
 (0)