lib.es2022.array.d.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*! *****************************************************************************
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  4. this file except in compliance with the License. You may obtain a copy of the
  5. License at http://www.apache.org/licenses/LICENSE-2.0
  6. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  8. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  9. MERCHANTABLITY OR NON-INFRINGEMENT.
  10. See the Apache Version 2.0 License for specific language governing permissions
  11. and limitations under the License.
  12. ***************************************************************************** */
  13. /// <reference no-default-lib="true"/>
  14. interface Array<T> {
  15. /**
  16. * Returns the item located at the specified index.
  17. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  18. */
  19. at(index: number): T | undefined;
  20. }
  21. interface ReadonlyArray<T> {
  22. /**
  23. * Returns the item located at the specified index.
  24. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  25. */
  26. at(index: number): T | undefined;
  27. }
  28. interface Int8Array {
  29. /**
  30. * Returns the item located at the specified index.
  31. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  32. */
  33. at(index: number): number | undefined;
  34. }
  35. interface Uint8Array {
  36. /**
  37. * Returns the item located at the specified index.
  38. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  39. */
  40. at(index: number): number | undefined;
  41. }
  42. interface Uint8ClampedArray {
  43. /**
  44. * Returns the item located at the specified index.
  45. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  46. */
  47. at(index: number): number | undefined;
  48. }
  49. interface Int16Array {
  50. /**
  51. * Returns the item located at the specified index.
  52. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  53. */
  54. at(index: number): number | undefined;
  55. }
  56. interface Uint16Array {
  57. /**
  58. * Returns the item located at the specified index.
  59. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  60. */
  61. at(index: number): number | undefined;
  62. }
  63. interface Int32Array {
  64. /**
  65. * Returns the item located at the specified index.
  66. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  67. */
  68. at(index: number): number | undefined;
  69. }
  70. interface Uint32Array {
  71. /**
  72. * Returns the item located at the specified index.
  73. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  74. */
  75. at(index: number): number | undefined;
  76. }
  77. interface Float32Array {
  78. /**
  79. * Returns the item located at the specified index.
  80. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  81. */
  82. at(index: number): number | undefined;
  83. }
  84. interface Float64Array {
  85. /**
  86. * Returns the item located at the specified index.
  87. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  88. */
  89. at(index: number): number | undefined;
  90. }
  91. interface BigInt64Array {
  92. /**
  93. * Returns the item located at the specified index.
  94. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  95. */
  96. at(index: number): bigint | undefined;
  97. }
  98. interface BigUint64Array {
  99. /**
  100. * Returns the item located at the specified index.
  101. * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
  102. */
  103. at(index: number): bigint | undefined;
  104. }