lib.es2015.reflect.d.ts 5.7 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. declare namespace Reflect {
  15. /**
  16. * Calls the function with the specified object as the this value
  17. * and the elements of specified array as the arguments.
  18. * @param target The function to call.
  19. * @param thisArgument The object to be used as the this object.
  20. * @param argumentsList An array of argument values to be passed to the function.
  21. */
  22. function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
  23. /**
  24. * Constructs the target with the elements of specified array as the arguments
  25. * and the specified constructor as the `new.target` value.
  26. * @param target The constructor to invoke.
  27. * @param argumentsList An array of argument values to be passed to the constructor.
  28. * @param newTarget The constructor to be used as the `new.target` object.
  29. */
  30. function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any;
  31. /**
  32. * Adds a property to an object, or modifies attributes of an existing property.
  33. * @param target Object on which to add or modify the property. This can be a native JavaScript object
  34. * (that is, a user-defined object or a built in object) or a DOM object.
  35. * @param propertyKey The property name.
  36. * @param attributes Descriptor for the property. It can be for a data property or an accessor property.
  37. */
  38. function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): boolean;
  39. /**
  40. * Removes a property from an object, equivalent to `delete target[propertyKey]`,
  41. * except it won't throw if `target[propertyKey]` is non-configurable.
  42. * @param target Object from which to remove the own property.
  43. * @param propertyKey The property name.
  44. */
  45. function deleteProperty(target: object, propertyKey: PropertyKey): boolean;
  46. /**
  47. * Gets the property of target, equivalent to `target[propertyKey]` when `receiver === target`.
  48. * @param target Object that contains the property on itself or in its prototype chain.
  49. * @param propertyKey The property name.
  50. * @param receiver The reference to use as the `this` value in the getter function,
  51. * if `target[propertyKey]` is an accessor property.
  52. */
  53. function get(target: object, propertyKey: PropertyKey, receiver?: any): any;
  54. /**
  55. * Gets the own property descriptor of the specified object.
  56. * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
  57. * @param target Object that contains the property.
  58. * @param propertyKey The property name.
  59. */
  60. function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;
  61. /**
  62. * Returns the prototype of an object.
  63. * @param target The object that references the prototype.
  64. */
  65. function getPrototypeOf(target: object): object | null;
  66. /**
  67. * Equivalent to `propertyKey in target`.
  68. * @param target Object that contains the property on itself or in its prototype chain.
  69. * @param propertyKey Name of the property.
  70. */
  71. function has(target: object, propertyKey: PropertyKey): boolean;
  72. /**
  73. * Returns a value that indicates whether new properties can be added to an object.
  74. * @param target Object to test.
  75. */
  76. function isExtensible(target: object): boolean;
  77. /**
  78. * Returns the string and symbol keys of the own properties of an object. The own properties of an object
  79. * are those that are defined directly on that object, and are not inherited from the object's prototype.
  80. * @param target Object that contains the own properties.
  81. */
  82. function ownKeys(target: object): (string | symbol)[];
  83. /**
  84. * Prevents the addition of new properties to an object.
  85. * @param target Object to make non-extensible.
  86. * @return Whether the object has been made non-extensible.
  87. */
  88. function preventExtensions(target: object): boolean;
  89. /**
  90. * Sets the property of target, equivalent to `target[propertyKey] = value` when `receiver === target`.
  91. * @param target Object that contains the property on itself or in its prototype chain.
  92. * @param propertyKey Name of the property.
  93. * @param receiver The reference to use as the `this` value in the setter function,
  94. * if `target[propertyKey]` is an accessor property.
  95. */
  96. function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
  97. /**
  98. * Sets the prototype of a specified object o to object proto or null.
  99. * @param target The object to change its prototype.
  100. * @param proto The value of the new prototype or null.
  101. * @return Whether setting the prototype was successful.
  102. */
  103. function setPrototypeOf(target: object, proto: object | null): boolean;
  104. }