@@ -307,7 +307,7 @@ interface JSON {
307
307
stringify < T > (
308
308
value : T ,
309
309
replacer ?: ( this : unknown , key : string , value : unknown ) => any ,
310
- space ?: string | number
310
+ space ?: string | number | null
311
311
) : T extends unknown
312
312
? T extends
313
313
| undefined
@@ -328,18 +328,39 @@ interface JSON {
328
328
stringify (
329
329
value : unknown ,
330
330
replacer ?: ( this : unknown , key : string , value : unknown ) => any ,
331
- space ?: string | number
331
+ space ?: string | number | null
332
332
) : string | undefined ;
333
333
/**
334
334
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
335
335
* @param value A JavaScript value, usually an object or array, to be converted.
336
- * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.
336
+ * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
337
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
338
+ */
339
+ stringify < T > (
340
+ value : T ,
341
+ replacer ?: ( number | string ) [ ] | null ,
342
+ space ?: string | number | null
343
+ ) : T extends unknown
344
+ ? T extends
345
+ | undefined
346
+ | ( ( ...args : any ) => any )
347
+ | ( new ( ...args : any ) => any )
348
+ | symbol
349
+ ? undefined
350
+ : object extends T
351
+ ? string | undefined
352
+ : string
353
+ : never ;
354
+ /**
355
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
356
+ * @param value A JavaScript value, usually an object or array, to be converted.
357
+ * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
337
358
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
338
359
*/
339
360
stringify (
340
361
value : unknown ,
341
362
replacer ?: ( number | string ) [ ] | null ,
342
- space ?: string | number
363
+ space ?: string | number | null
343
364
) : string | undefined ;
344
365
}
345
366
0 commit comments