lib.es2016.array.include.d.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. * Determines whether an array includes a certain element, returning true or false as appropriate.
  17. * @param searchElement The element to search for.
  18. * @param fromIndex The position in this array at which to begin searching for searchElement.
  19. */
  20. includes(searchElement: T, fromIndex?: number): boolean;
  21. }
  22. interface ReadonlyArray<T> {
  23. /**
  24. * Determines whether an array includes a certain element, returning true or false as appropriate.
  25. * @param searchElement The element to search for.
  26. * @param fromIndex The position in this array at which to begin searching for searchElement.
  27. */
  28. includes(searchElement: T, fromIndex?: number): boolean;
  29. }
  30. interface Int8Array {
  31. /**
  32. * Determines whether an array includes a certain element, returning true or false as appropriate.
  33. * @param searchElement The element to search for.
  34. * @param fromIndex The position in this array at which to begin searching for searchElement.
  35. */
  36. includes(searchElement: number, fromIndex?: number): boolean;
  37. }
  38. interface Uint8Array {
  39. /**
  40. * Determines whether an array includes a certain element, returning true or false as appropriate.
  41. * @param searchElement The element to search for.
  42. * @param fromIndex The position in this array at which to begin searching for searchElement.
  43. */
  44. includes(searchElement: number, fromIndex?: number): boolean;
  45. }
  46. interface Uint8ClampedArray {
  47. /**
  48. * Determines whether an array includes a certain element, returning true or false as appropriate.
  49. * @param searchElement The element to search for.
  50. * @param fromIndex The position in this array at which to begin searching for searchElement.
  51. */
  52. includes(searchElement: number, fromIndex?: number): boolean;
  53. }
  54. interface Int16Array {
  55. /**
  56. * Determines whether an array includes a certain element, returning true or false as appropriate.
  57. * @param searchElement The element to search for.
  58. * @param fromIndex The position in this array at which to begin searching for searchElement.
  59. */
  60. includes(searchElement: number, fromIndex?: number): boolean;
  61. }
  62. interface Uint16Array {
  63. /**
  64. * Determines whether an array includes a certain element, returning true or false as appropriate.
  65. * @param searchElement The element to search for.
  66. * @param fromIndex The position in this array at which to begin searching for searchElement.
  67. */
  68. includes(searchElement: number, fromIndex?: number): boolean;
  69. }
  70. interface Int32Array {
  71. /**
  72. * Determines whether an array includes a certain element, returning true or false as appropriate.
  73. * @param searchElement The element to search for.
  74. * @param fromIndex The position in this array at which to begin searching for searchElement.
  75. */
  76. includes(searchElement: number, fromIndex?: number): boolean;
  77. }
  78. interface Uint32Array {
  79. /**
  80. * Determines whether an array includes a certain element, returning true or false as appropriate.
  81. * @param searchElement The element to search for.
  82. * @param fromIndex The position in this array at which to begin searching for searchElement.
  83. */
  84. includes(searchElement: number, fromIndex?: number): boolean;
  85. }
  86. interface Float32Array {
  87. /**
  88. * Determines whether an array includes a certain element, returning true or false as appropriate.
  89. * @param searchElement The element to search for.
  90. * @param fromIndex The position in this array at which to begin searching for searchElement.
  91. */
  92. includes(searchElement: number, fromIndex?: number): boolean;
  93. }
  94. interface Float64Array {
  95. /**
  96. * Determines whether an array includes a certain element, returning true or false as appropriate.
  97. * @param searchElement The element to search for.
  98. * @param fromIndex The position in this array at which to begin searching for searchElement.
  99. */
  100. includes(searchElement: number, fromIndex?: number): boolean;
  101. }