typescript 5.7.0-dev.20240924 → 5.7.0-dev.20240926

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -163,7 +163,7 @@ interface ReadonlyArray<T> {
163
163
  with(index: number, value: T): T[];
164
164
  }
165
165
 
166
- interface Int8Array {
166
+ interface Int8Array<TArrayBuffer extends ArrayBufferLike> {
167
167
  /**
168
168
  * Returns the value of the last element in the array where predicate is true, and undefined
169
169
  * otherwise.
@@ -177,12 +177,12 @@ interface Int8Array {
177
177
  predicate: (
178
178
  value: number,
179
179
  index: number,
180
- array: Int8Array,
180
+ array: this,
181
181
  ) => value is S,
182
182
  thisArg?: any,
183
183
  ): S | undefined;
184
184
  findLast(
185
- predicate: (value: number, index: number, array: Int8Array) => unknown,
185
+ predicate: (value: number, index: number, array: this) => unknown,
186
186
  thisArg?: any,
187
187
  ): number | undefined;
188
188
 
@@ -196,14 +196,14 @@ interface Int8Array {
196
196
  * predicate. If it is not provided, undefined is used instead.
197
197
  */
198
198
  findLastIndex(
199
- predicate: (value: number, index: number, array: Int8Array) => unknown,
199
+ predicate: (value: number, index: number, array: this) => unknown,
200
200
  thisArg?: any,
201
201
  ): number;
202
202
 
203
203
  /**
204
204
  * Copies the array and returns the copy with the elements in reverse order.
205
205
  */
206
- toReversed(): Int8Array;
206
+ toReversed(): Int8Array<ArrayBuffer>;
207
207
 
208
208
  /**
209
209
  * Copies and sorts the array.
@@ -211,11 +211,11 @@ interface Int8Array {
211
211
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
212
212
  * value otherwise. If omitted, the elements are sorted in ascending order.
213
213
  * ```ts
214
- * const myNums = Int8Array.from([11, 2, 22, 1]);
215
- * myNums.toSorted((a, b) => a - b) // Int8Array(4) [1, 2, 11, 22]
214
+ * const myNums = Int8Array<Buffer>.from([11, 2, 22, 1]);
215
+ * myNums.toSorted((a, b) => a - b) // Int8Array<Buffer>(4) [1, 2, 11, 22]
216
216
  * ```
217
217
  */
218
- toSorted(compareFn?: (a: number, b: number) => number): Int8Array;
218
+ toSorted(compareFn?: (a: number, b: number) => number): Int8Array<ArrayBuffer>;
219
219
 
220
220
  /**
221
221
  * Copies the array and inserts the given number at the provided index.
@@ -224,10 +224,10 @@ interface Int8Array {
224
224
  * @param value The value to insert into the copied array.
225
225
  * @returns A copy of the original array with the inserted value.
226
226
  */
227
- with(index: number, value: number): Int8Array;
227
+ with(index: number, value: number): Int8Array<ArrayBuffer>;
228
228
  }
229
229
 
230
- interface Uint8Array {
230
+ interface Uint8Array<TArrayBuffer extends ArrayBufferLike> {
231
231
  /**
232
232
  * Returns the value of the last element in the array where predicate is true, and undefined
233
233
  * otherwise.
@@ -241,12 +241,12 @@ interface Uint8Array {
241
241
  predicate: (
242
242
  value: number,
243
243
  index: number,
244
- array: Uint8Array,
244
+ array: this,
245
245
  ) => value is S,
246
246
  thisArg?: any,
247
247
  ): S | undefined;
248
248
  findLast(
249
- predicate: (value: number, index: number, array: Uint8Array) => unknown,
249
+ predicate: (value: number, index: number, array: this) => unknown,
250
250
  thisArg?: any,
251
251
  ): number | undefined;
252
252
 
@@ -260,14 +260,14 @@ interface Uint8Array {
260
260
  * predicate. If it is not provided, undefined is used instead.
261
261
  */
262
262
  findLastIndex(
263
- predicate: (value: number, index: number, array: Uint8Array) => unknown,
263
+ predicate: (value: number, index: number, array: this) => unknown,
264
264
  thisArg?: any,
265
265
  ): number;
266
266
 
267
267
  /**
268
268
  * Copies the array and returns the copy with the elements in reverse order.
269
269
  */
270
- toReversed(): Uint8Array;
270
+ toReversed(): Uint8Array<ArrayBuffer>;
271
271
 
272
272
  /**
273
273
  * Copies and sorts the array.
@@ -275,11 +275,11 @@ interface Uint8Array {
275
275
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
276
276
  * value otherwise. If omitted, the elements are sorted in ascending order.
277
277
  * ```ts
278
- * const myNums = Uint8Array.from([11, 2, 22, 1]);
279
- * myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
278
+ * const myNums = Uint8Array<Buffer>.from([11, 2, 22, 1]);
279
+ * myNums.toSorted((a, b) => a - b) // Uint8Array<Buffer>(4) [1, 2, 11, 22]
280
280
  * ```
281
281
  */
282
- toSorted(compareFn?: (a: number, b: number) => number): Uint8Array;
282
+ toSorted(compareFn?: (a: number, b: number) => number): Uint8Array<ArrayBuffer>;
283
283
 
284
284
  /**
285
285
  * Copies the array and inserts the given number at the provided index.
@@ -288,10 +288,10 @@ interface Uint8Array {
288
288
  * @param value The value to insert into the copied array.
289
289
  * @returns A copy of the original array with the inserted value.
290
290
  */
291
- with(index: number, value: number): Uint8Array;
291
+ with(index: number, value: number): Uint8Array<ArrayBuffer>;
292
292
  }
293
293
 
294
- interface Uint8ClampedArray {
294
+ interface Uint8ClampedArray<TArrayBuffer extends ArrayBufferLike> {
295
295
  /**
296
296
  * Returns the value of the last element in the array where predicate is true, and undefined
297
297
  * otherwise.
@@ -305,7 +305,7 @@ interface Uint8ClampedArray {
305
305
  predicate: (
306
306
  value: number,
307
307
  index: number,
308
- array: Uint8ClampedArray,
308
+ array: this,
309
309
  ) => value is S,
310
310
  thisArg?: any,
311
311
  ): S | undefined;
@@ -313,7 +313,7 @@ interface Uint8ClampedArray {
313
313
  predicate: (
314
314
  value: number,
315
315
  index: number,
316
- array: Uint8ClampedArray,
316
+ array: this,
317
317
  ) => unknown,
318
318
  thisArg?: any,
319
319
  ): number | undefined;
@@ -331,7 +331,7 @@ interface Uint8ClampedArray {
331
331
  predicate: (
332
332
  value: number,
333
333
  index: number,
334
- array: Uint8ClampedArray,
334
+ array: this,
335
335
  ) => unknown,
336
336
  thisArg?: any,
337
337
  ): number;
@@ -339,7 +339,7 @@ interface Uint8ClampedArray {
339
339
  /**
340
340
  * Copies the array and returns the copy with the elements in reverse order.
341
341
  */
342
- toReversed(): Uint8ClampedArray;
342
+ toReversed(): Uint8ClampedArray<ArrayBuffer>;
343
343
 
344
344
  /**
345
345
  * Copies and sorts the array.
@@ -347,11 +347,11 @@ interface Uint8ClampedArray {
347
347
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
348
348
  * value otherwise. If omitted, the elements are sorted in ascending order.
349
349
  * ```ts
350
- * const myNums = Uint8ClampedArray.from([11, 2, 22, 1]);
351
- * myNums.toSorted((a, b) => a - b) // Uint8ClampedArray(4) [1, 2, 11, 22]
350
+ * const myNums = Uint8ClampedArray<Buffer>.from([11, 2, 22, 1]);
351
+ * myNums.toSorted((a, b) => a - b) // Uint8ClampedArray<Buffer>(4) [1, 2, 11, 22]
352
352
  * ```
353
353
  */
354
- toSorted(compareFn?: (a: number, b: number) => number): Uint8ClampedArray;
354
+ toSorted(compareFn?: (a: number, b: number) => number): Uint8ClampedArray<ArrayBuffer>;
355
355
 
356
356
  /**
357
357
  * Copies the array and inserts the given number at the provided index.
@@ -360,10 +360,10 @@ interface Uint8ClampedArray {
360
360
  * @param value The value to insert into the copied array.
361
361
  * @returns A copy of the original array with the inserted value.
362
362
  */
363
- with(index: number, value: number): Uint8ClampedArray;
363
+ with(index: number, value: number): Uint8ClampedArray<ArrayBuffer>;
364
364
  }
365
365
 
366
- interface Int16Array {
366
+ interface Int16Array<TArrayBuffer extends ArrayBufferLike> {
367
367
  /**
368
368
  * Returns the value of the last element in the array where predicate is true, and undefined
369
369
  * otherwise.
@@ -377,12 +377,12 @@ interface Int16Array {
377
377
  predicate: (
378
378
  value: number,
379
379
  index: number,
380
- array: Int16Array,
380
+ array: this,
381
381
  ) => value is S,
382
382
  thisArg?: any,
383
383
  ): S | undefined;
384
384
  findLast(
385
- predicate: (value: number, index: number, array: Int16Array) => unknown,
385
+ predicate: (value: number, index: number, array: this) => unknown,
386
386
  thisArg?: any,
387
387
  ): number | undefined;
388
388
 
@@ -396,14 +396,14 @@ interface Int16Array {
396
396
  * predicate. If it is not provided, undefined is used instead.
397
397
  */
398
398
  findLastIndex(
399
- predicate: (value: number, index: number, array: Int16Array) => unknown,
399
+ predicate: (value: number, index: number, array: this) => unknown,
400
400
  thisArg?: any,
401
401
  ): number;
402
402
 
403
403
  /**
404
404
  * Copies the array and returns the copy with the elements in reverse order.
405
405
  */
406
- toReversed(): Int16Array;
406
+ toReversed(): Int16Array<ArrayBuffer>;
407
407
 
408
408
  /**
409
409
  * Copies and sorts the array.
@@ -411,11 +411,11 @@ interface Int16Array {
411
411
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
412
412
  * value otherwise. If omitted, the elements are sorted in ascending order.
413
413
  * ```ts
414
- * const myNums = Int16Array.from([11, 2, -22, 1]);
415
- * myNums.toSorted((a, b) => a - b) // Int16Array(4) [-22, 1, 2, 11]
414
+ * const myNums = Int16Array<Buffer>.from([11, 2, -22, 1]);
415
+ * myNums.toSorted((a, b) => a - b) // Int16Array<Buffer>(4) [-22, 1, 2, 11]
416
416
  * ```
417
417
  */
418
- toSorted(compareFn?: (a: number, b: number) => number): Int16Array;
418
+ toSorted(compareFn?: (a: number, b: number) => number): Int16Array<ArrayBuffer>;
419
419
 
420
420
  /**
421
421
  * Copies the array and inserts the given number at the provided index.
@@ -424,10 +424,10 @@ interface Int16Array {
424
424
  * @param value The value to insert into the copied array.
425
425
  * @returns A copy of the original array with the inserted value.
426
426
  */
427
- with(index: number, value: number): Int16Array;
427
+ with(index: number, value: number): Int16Array<ArrayBuffer>;
428
428
  }
429
429
 
430
- interface Uint16Array {
430
+ interface Uint16Array<TArrayBuffer extends ArrayBufferLike> {
431
431
  /**
432
432
  * Returns the value of the last element in the array where predicate is true, and undefined
433
433
  * otherwise.
@@ -441,7 +441,7 @@ interface Uint16Array {
441
441
  predicate: (
442
442
  value: number,
443
443
  index: number,
444
- array: Uint16Array,
444
+ array: this,
445
445
  ) => value is S,
446
446
  thisArg?: any,
447
447
  ): S | undefined;
@@ -449,7 +449,7 @@ interface Uint16Array {
449
449
  predicate: (
450
450
  value: number,
451
451
  index: number,
452
- array: Uint16Array,
452
+ array: this,
453
453
  ) => unknown,
454
454
  thisArg?: any,
455
455
  ): number | undefined;
@@ -467,7 +467,7 @@ interface Uint16Array {
467
467
  predicate: (
468
468
  value: number,
469
469
  index: number,
470
- array: Uint16Array,
470
+ array: this,
471
471
  ) => unknown,
472
472
  thisArg?: any,
473
473
  ): number;
@@ -475,7 +475,7 @@ interface Uint16Array {
475
475
  /**
476
476
  * Copies the array and returns the copy with the elements in reverse order.
477
477
  */
478
- toReversed(): Uint16Array;
478
+ toReversed(): Uint16Array<ArrayBuffer>;
479
479
 
480
480
  /**
481
481
  * Copies and sorts the array.
@@ -483,11 +483,11 @@ interface Uint16Array {
483
483
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
484
484
  * value otherwise. If omitted, the elements are sorted in ascending order.
485
485
  * ```ts
486
- * const myNums = Uint16Array.from([11, 2, 22, 1]);
487
- * myNums.toSorted((a, b) => a - b) // Uint16Array(4) [1, 2, 11, 22]
486
+ * const myNums = Uint16Array<Buffer>.from([11, 2, 22, 1]);
487
+ * myNums.toSorted((a, b) => a - b) // Uint16Array<Buffer>(4) [1, 2, 11, 22]
488
488
  * ```
489
489
  */
490
- toSorted(compareFn?: (a: number, b: number) => number): Uint16Array;
490
+ toSorted(compareFn?: (a: number, b: number) => number): Uint16Array<ArrayBuffer>;
491
491
 
492
492
  /**
493
493
  * Copies the array and inserts the given number at the provided index.
@@ -496,10 +496,10 @@ interface Uint16Array {
496
496
  * @param value The value to insert into the copied array.
497
497
  * @returns A copy of the original array with the inserted value.
498
498
  */
499
- with(index: number, value: number): Uint16Array;
499
+ with(index: number, value: number): Uint16Array<ArrayBuffer>;
500
500
  }
501
501
 
502
- interface Int32Array {
502
+ interface Int32Array<TArrayBuffer extends ArrayBufferLike> {
503
503
  /**
504
504
  * Returns the value of the last element in the array where predicate is true, and undefined
505
505
  * otherwise.
@@ -513,12 +513,12 @@ interface Int32Array {
513
513
  predicate: (
514
514
  value: number,
515
515
  index: number,
516
- array: Int32Array,
516
+ array: this,
517
517
  ) => value is S,
518
518
  thisArg?: any,
519
519
  ): S | undefined;
520
520
  findLast(
521
- predicate: (value: number, index: number, array: Int32Array) => unknown,
521
+ predicate: (value: number, index: number, array: this) => unknown,
522
522
  thisArg?: any,
523
523
  ): number | undefined;
524
524
 
@@ -532,14 +532,14 @@ interface Int32Array {
532
532
  * predicate. If it is not provided, undefined is used instead.
533
533
  */
534
534
  findLastIndex(
535
- predicate: (value: number, index: number, array: Int32Array) => unknown,
535
+ predicate: (value: number, index: number, array: this) => unknown,
536
536
  thisArg?: any,
537
537
  ): number;
538
538
 
539
539
  /**
540
540
  * Copies the array and returns the copy with the elements in reverse order.
541
541
  */
542
- toReversed(): Int32Array;
542
+ toReversed(): Int32Array<ArrayBuffer>;
543
543
 
544
544
  /**
545
545
  * Copies and sorts the array.
@@ -547,11 +547,11 @@ interface Int32Array {
547
547
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
548
548
  * value otherwise. If omitted, the elements are sorted in ascending order.
549
549
  * ```ts
550
- * const myNums = Int32Array.from([11, 2, -22, 1]);
551
- * myNums.toSorted((a, b) => a - b) // Int32Array(4) [-22, 1, 2, 11]
550
+ * const myNums = Int32Array<Buffer>.from([11, 2, -22, 1]);
551
+ * myNums.toSorted((a, b) => a - b) // Int32Array<Buffer>(4) [-22, 1, 2, 11]
552
552
  * ```
553
553
  */
554
- toSorted(compareFn?: (a: number, b: number) => number): Int32Array;
554
+ toSorted(compareFn?: (a: number, b: number) => number): Int32Array<ArrayBuffer>;
555
555
 
556
556
  /**
557
557
  * Copies the array and inserts the given number at the provided index.
@@ -560,10 +560,10 @@ interface Int32Array {
560
560
  * @param value The value to insert into the copied array.
561
561
  * @returns A copy of the original array with the inserted value.
562
562
  */
563
- with(index: number, value: number): Int32Array;
563
+ with(index: number, value: number): Int32Array<ArrayBuffer>;
564
564
  }
565
565
 
566
- interface Uint32Array {
566
+ interface Uint32Array<TArrayBuffer extends ArrayBufferLike> {
567
567
  /**
568
568
  * Returns the value of the last element in the array where predicate is true, and undefined
569
569
  * otherwise.
@@ -577,7 +577,7 @@ interface Uint32Array {
577
577
  predicate: (
578
578
  value: number,
579
579
  index: number,
580
- array: Uint32Array,
580
+ array: this,
581
581
  ) => value is S,
582
582
  thisArg?: any,
583
583
  ): S | undefined;
@@ -585,7 +585,7 @@ interface Uint32Array {
585
585
  predicate: (
586
586
  value: number,
587
587
  index: number,
588
- array: Uint32Array,
588
+ array: this,
589
589
  ) => unknown,
590
590
  thisArg?: any,
591
591
  ): number | undefined;
@@ -603,7 +603,7 @@ interface Uint32Array {
603
603
  predicate: (
604
604
  value: number,
605
605
  index: number,
606
- array: Uint32Array,
606
+ array: this,
607
607
  ) => unknown,
608
608
  thisArg?: any,
609
609
  ): number;
@@ -611,7 +611,7 @@ interface Uint32Array {
611
611
  /**
612
612
  * Copies the array and returns the copy with the elements in reverse order.
613
613
  */
614
- toReversed(): Uint32Array;
614
+ toReversed(): Uint32Array<ArrayBuffer>;
615
615
 
616
616
  /**
617
617
  * Copies and sorts the array.
@@ -619,11 +619,11 @@ interface Uint32Array {
619
619
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
620
620
  * value otherwise. If omitted, the elements are sorted in ascending order.
621
621
  * ```ts
622
- * const myNums = Uint32Array.from([11, 2, 22, 1]);
623
- * myNums.toSorted((a, b) => a - b) // Uint32Array(4) [1, 2, 11, 22]
622
+ * const myNums = Uint32Array<Buffer>.from([11, 2, 22, 1]);
623
+ * myNums.toSorted((a, b) => a - b) // Uint32Array<Buffer>(4) [1, 2, 11, 22]
624
624
  * ```
625
625
  */
626
- toSorted(compareFn?: (a: number, b: number) => number): Uint32Array;
626
+ toSorted(compareFn?: (a: number, b: number) => number): Uint32Array<ArrayBuffer>;
627
627
 
628
628
  /**
629
629
  * Copies the array and inserts the given number at the provided index.
@@ -632,10 +632,10 @@ interface Uint32Array {
632
632
  * @param value The value to insert into the copied array.
633
633
  * @returns A copy of the original array with the inserted value.
634
634
  */
635
- with(index: number, value: number): Uint32Array;
635
+ with(index: number, value: number): Uint32Array<ArrayBuffer>;
636
636
  }
637
637
 
638
- interface Float32Array {
638
+ interface Float32Array<TArrayBuffer extends ArrayBufferLike> {
639
639
  /**
640
640
  * Returns the value of the last element in the array where predicate is true, and undefined
641
641
  * otherwise.
@@ -649,7 +649,7 @@ interface Float32Array {
649
649
  predicate: (
650
650
  value: number,
651
651
  index: number,
652
- array: Float32Array,
652
+ array: this,
653
653
  ) => value is S,
654
654
  thisArg?: any,
655
655
  ): S | undefined;
@@ -657,7 +657,7 @@ interface Float32Array {
657
657
  predicate: (
658
658
  value: number,
659
659
  index: number,
660
- array: Float32Array,
660
+ array: this,
661
661
  ) => unknown,
662
662
  thisArg?: any,
663
663
  ): number | undefined;
@@ -675,7 +675,7 @@ interface Float32Array {
675
675
  predicate: (
676
676
  value: number,
677
677
  index: number,
678
- array: Float32Array,
678
+ array: this,
679
679
  ) => unknown,
680
680
  thisArg?: any,
681
681
  ): number;
@@ -683,7 +683,7 @@ interface Float32Array {
683
683
  /**
684
684
  * Copies the array and returns the copy with the elements in reverse order.
685
685
  */
686
- toReversed(): Float32Array;
686
+ toReversed(): Float32Array<ArrayBuffer>;
687
687
 
688
688
  /**
689
689
  * Copies and sorts the array.
@@ -691,11 +691,11 @@ interface Float32Array {
691
691
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
692
692
  * value otherwise. If omitted, the elements are sorted in ascending order.
693
693
  * ```ts
694
- * const myNums = Float32Array.from([11.25, 2, -22.5, 1]);
695
- * myNums.toSorted((a, b) => a - b) // Float32Array(4) [-22.5, 1, 2, 11.5]
694
+ * const myNums = Float32Array<Buffer>.from([11.25, 2, -22.5, 1]);
695
+ * myNums.toSorted((a, b) => a - b) // Float32Array<Buffer>(4) [-22.5, 1, 2, 11.5]
696
696
  * ```
697
697
  */
698
- toSorted(compareFn?: (a: number, b: number) => number): Float32Array;
698
+ toSorted(compareFn?: (a: number, b: number) => number): Float32Array<ArrayBuffer>;
699
699
 
700
700
  /**
701
701
  * Copies the array and inserts the given number at the provided index.
@@ -704,10 +704,10 @@ interface Float32Array {
704
704
  * @param value The value to insert into the copied array.
705
705
  * @returns A copy of the original array with the inserted value.
706
706
  */
707
- with(index: number, value: number): Float32Array;
707
+ with(index: number, value: number): Float32Array<ArrayBuffer>;
708
708
  }
709
709
 
710
- interface Float64Array {
710
+ interface Float64Array<TArrayBuffer extends ArrayBufferLike> {
711
711
  /**
712
712
  * Returns the value of the last element in the array where predicate is true, and undefined
713
713
  * otherwise.
@@ -721,7 +721,7 @@ interface Float64Array {
721
721
  predicate: (
722
722
  value: number,
723
723
  index: number,
724
- array: Float64Array,
724
+ array: this,
725
725
  ) => value is S,
726
726
  thisArg?: any,
727
727
  ): S | undefined;
@@ -729,7 +729,7 @@ interface Float64Array {
729
729
  predicate: (
730
730
  value: number,
731
731
  index: number,
732
- array: Float64Array,
732
+ array: this,
733
733
  ) => unknown,
734
734
  thisArg?: any,
735
735
  ): number | undefined;
@@ -747,7 +747,7 @@ interface Float64Array {
747
747
  predicate: (
748
748
  value: number,
749
749
  index: number,
750
- array: Float64Array,
750
+ array: this,
751
751
  ) => unknown,
752
752
  thisArg?: any,
753
753
  ): number;
@@ -755,7 +755,7 @@ interface Float64Array {
755
755
  /**
756
756
  * Copies the array and returns the copy with the elements in reverse order.
757
757
  */
758
- toReversed(): Float64Array;
758
+ toReversed(): Float64Array<ArrayBuffer>;
759
759
 
760
760
  /**
761
761
  * Copies and sorts the array.
@@ -763,11 +763,11 @@ interface Float64Array {
763
763
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
764
764
  * value otherwise. If omitted, the elements are sorted in ascending order.
765
765
  * ```ts
766
- * const myNums = Float64Array.from([11.25, 2, -22.5, 1]);
767
- * myNums.toSorted((a, b) => a - b) // Float64Array(4) [-22.5, 1, 2, 11.5]
766
+ * const myNums = Float64Array<Buffer>.from([11.25, 2, -22.5, 1]);
767
+ * myNums.toSorted((a, b) => a - b) // Float64Array<Buffer>(4) [-22.5, 1, 2, 11.5]
768
768
  * ```
769
769
  */
770
- toSorted(compareFn?: (a: number, b: number) => number): Float64Array;
770
+ toSorted(compareFn?: (a: number, b: number) => number): Float64Array<ArrayBuffer>;
771
771
 
772
772
  /**
773
773
  * Copies the array and inserts the given number at the provided index.
@@ -776,10 +776,10 @@ interface Float64Array {
776
776
  * @param value The value to insert into the copied array.
777
777
  * @returns A copy of the original array with the inserted value.
778
778
  */
779
- with(index: number, value: number): Float64Array;
779
+ with(index: number, value: number): Float64Array<ArrayBuffer>;
780
780
  }
781
781
 
782
- interface BigInt64Array {
782
+ interface BigInt64Array<TArrayBuffer extends ArrayBufferLike> {
783
783
  /**
784
784
  * Returns the value of the last element in the array where predicate is true, and undefined
785
785
  * otherwise.
@@ -793,7 +793,7 @@ interface BigInt64Array {
793
793
  predicate: (
794
794
  value: bigint,
795
795
  index: number,
796
- array: BigInt64Array,
796
+ array: this,
797
797
  ) => value is S,
798
798
  thisArg?: any,
799
799
  ): S | undefined;
@@ -801,7 +801,7 @@ interface BigInt64Array {
801
801
  predicate: (
802
802
  value: bigint,
803
803
  index: number,
804
- array: BigInt64Array,
804
+ array: this,
805
805
  ) => unknown,
806
806
  thisArg?: any,
807
807
  ): bigint | undefined;
@@ -819,7 +819,7 @@ interface BigInt64Array {
819
819
  predicate: (
820
820
  value: bigint,
821
821
  index: number,
822
- array: BigInt64Array,
822
+ array: this,
823
823
  ) => unknown,
824
824
  thisArg?: any,
825
825
  ): number;
@@ -827,7 +827,7 @@ interface BigInt64Array {
827
827
  /**
828
828
  * Copies the array and returns the copy with the elements in reverse order.
829
829
  */
830
- toReversed(): BigInt64Array;
830
+ toReversed(): BigInt64Array<ArrayBuffer>;
831
831
 
832
832
  /**
833
833
  * Copies and sorts the array.
@@ -835,11 +835,11 @@ interface BigInt64Array {
835
835
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
836
836
  * value otherwise. If omitted, the elements are sorted in ascending order.
837
837
  * ```ts
838
- * const myNums = BigInt64Array.from([11n, 2n, -22n, 1n]);
839
- * myNums.toSorted((a, b) => Number(a - b)) // BigInt64Array(4) [-22n, 1n, 2n, 11n]
838
+ * const myNums = BigInt64Array<Buffer>.from([11n, 2n, -22n, 1n]);
839
+ * myNums.toSorted((a, b) => Number(a - b)) // BigInt64Array<Buffer>(4) [-22n, 1n, 2n, 11n]
840
840
  * ```
841
841
  */
842
- toSorted(compareFn?: (a: bigint, b: bigint) => number): BigInt64Array;
842
+ toSorted(compareFn?: (a: bigint, b: bigint) => number): BigInt64Array<ArrayBuffer>;
843
843
 
844
844
  /**
845
845
  * Copies the array and inserts the given bigint at the provided index.
@@ -848,10 +848,10 @@ interface BigInt64Array {
848
848
  * @param value The value to insert into the copied array.
849
849
  * @returns A copy of the original array with the inserted value.
850
850
  */
851
- with(index: number, value: bigint): BigInt64Array;
851
+ with(index: number, value: bigint): BigInt64Array<ArrayBuffer>;
852
852
  }
853
853
 
854
- interface BigUint64Array {
854
+ interface BigUint64Array<TArrayBuffer extends ArrayBufferLike> {
855
855
  /**
856
856
  * Returns the value of the last element in the array where predicate is true, and undefined
857
857
  * otherwise.
@@ -865,7 +865,7 @@ interface BigUint64Array {
865
865
  predicate: (
866
866
  value: bigint,
867
867
  index: number,
868
- array: BigUint64Array,
868
+ array: this,
869
869
  ) => value is S,
870
870
  thisArg?: any,
871
871
  ): S | undefined;
@@ -873,7 +873,7 @@ interface BigUint64Array {
873
873
  predicate: (
874
874
  value: bigint,
875
875
  index: number,
876
- array: BigUint64Array,
876
+ array: this,
877
877
  ) => unknown,
878
878
  thisArg?: any,
879
879
  ): bigint | undefined;
@@ -891,7 +891,7 @@ interface BigUint64Array {
891
891
  predicate: (
892
892
  value: bigint,
893
893
  index: number,
894
- array: BigUint64Array,
894
+ array: this,
895
895
  ) => unknown,
896
896
  thisArg?: any,
897
897
  ): number;
@@ -899,7 +899,7 @@ interface BigUint64Array {
899
899
  /**
900
900
  * Copies the array and returns the copy with the elements in reverse order.
901
901
  */
902
- toReversed(): BigUint64Array;
902
+ toReversed(): BigUint64Array<ArrayBuffer>;
903
903
 
904
904
  /**
905
905
  * Copies and sorts the array.
@@ -907,11 +907,11 @@ interface BigUint64Array {
907
907
  * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
908
908
  * value otherwise. If omitted, the elements are sorted in ascending order.
909
909
  * ```ts
910
- * const myNums = BigUint64Array.from([11n, 2n, 22n, 1n]);
911
- * myNums.toSorted((a, b) => Number(a - b)) // BigUint64Array(4) [1n, 2n, 11n, 22n]
910
+ * const myNums = BigUint64Array<Buffer>.from([11n, 2n, 22n, 1n]);
911
+ * myNums.toSorted((a, b) => Number(a - b)) // BigUint64Array<Buffer>(4) [1n, 2n, 11n, 22n]
912
912
  * ```
913
913
  */
914
- toSorted(compareFn?: (a: bigint, b: bigint) => number): BigUint64Array;
914
+ toSorted(compareFn?: (a: bigint, b: bigint) => number): BigUint64Array<ArrayBuffer>;
915
915
 
916
916
  /**
917
917
  * Copies the array and inserts the given bigint at the provided index.
@@ -920,5 +920,5 @@ interface BigUint64Array {
920
920
  * @param value The value to insert into the copied array.
921
921
  * @returns A copy of the original array with the inserted value.
922
922
  */
923
- with(index: number, value: bigint): BigUint64Array;
923
+ with(index: number, value: bigint): BigUint64Array<ArrayBuffer>;
924
924
  }