CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
lib.es2015.reflect.d.ts143 linesDownload Raw Back to lib
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABILITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17declare namespace Reflect {18    /**19     * Calls the function with the specified object as the this value20     * and the elements of specified array as the arguments.21     * @param target The function to call.22     * @param thisArgument The object to be used as the this object.23     * @param argumentsList An array of argument values to be passed to the function.24     */25    function apply<T, A extends readonly any[], R>(26        target: (this: T, ...args: A) => R,27        thisArgument: T,28        argumentsList: Readonly<A>,29    ): R;30    function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;31 32    /**33     * Constructs the target with the elements of specified array as the arguments34     * and the specified constructor as the `new.target` value.35     * @param target The constructor to invoke.36     * @param argumentsList An array of argument values to be passed to the constructor.37     * @param newTarget The constructor to be used as the `new.target` object.38     */39    function construct<A extends readonly any[], R>(40        target: new (...args: A) => R,41        argumentsList: Readonly<A>,42        newTarget?: new (...args: any) => any,43    ): R;44    function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any;45 46    /**47     * Adds a property to an object, or modifies attributes of an existing property.48     * @param target Object on which to add or modify the property. This can be a native JavaScript object49     *        (that is, a user-defined object or a built in object) or a DOM object.50     * @param propertyKey The property name.51     * @param attributes Descriptor for the property. It can be for a data property or an accessor property.52     */53    function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): boolean;54 55    /**56     * Removes a property from an object, equivalent to `delete target[propertyKey]`,57     * except it won't throw if `target[propertyKey]` is non-configurable.58     * @param target Object from which to remove the own property.59     * @param propertyKey The property name.60     */61    function deleteProperty(target: object, propertyKey: PropertyKey): boolean;62 63    /**64     * Gets the property of target, equivalent to `target[propertyKey]` when `receiver === target`.65     * @param target Object that contains the property on itself or in its prototype chain.66     * @param propertyKey The property name.67     * @param receiver The reference to use as the `this` value in the getter function,68     *        if `target[propertyKey]` is an accessor property.69     */70    function get<T extends object, P extends PropertyKey>(71        target: T,72        propertyKey: P,73        receiver?: unknown,74    ): P extends keyof T ? T[P] : any;75 76    /**77     * Gets the own property descriptor of the specified object.78     * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.79     * @param target Object that contains the property.80     * @param propertyKey The property name.81     */82    function getOwnPropertyDescriptor<T extends object, P extends PropertyKey>(83        target: T,84        propertyKey: P,85    ): TypedPropertyDescriptor<P extends keyof T ? T[P] : any> | undefined;86 87    /**88     * Returns the prototype of an object.89     * @param target The object that references the prototype.90     */91    function getPrototypeOf(target: object): object | null;92 93    /**94     * Equivalent to `propertyKey in target`.95     * @param target Object that contains the property on itself or in its prototype chain.96     * @param propertyKey Name of the property.97     */98    function has(target: object, propertyKey: PropertyKey): boolean;99 100    /**101     * Returns a value that indicates whether new properties can be added to an object.102     * @param target Object to test.103     */104    function isExtensible(target: object): boolean;105 106    /**107     * Returns the string and symbol keys of the own properties of an object. The own properties of an object108     * are those that are defined directly on that object, and are not inherited from the object's prototype.109     * @param target Object that contains the own properties.110     */111    function ownKeys(target: object): (string | symbol)[];112 113    /**114     * Prevents the addition of new properties to an object.115     * @param target Object to make non-extensible.116     * @return Whether the object has been made non-extensible.117     */118    function preventExtensions(target: object): boolean;119 120    /**121     * Sets the property of target, equivalent to `target[propertyKey] = value` when `receiver === target`.122     * @param target Object that contains the property on itself or in its prototype chain.123     * @param propertyKey Name of the property.124     * @param receiver The reference to use as the `this` value in the setter function,125     *        if `target[propertyKey]` is an accessor property.126     */127    function set<T extends object, P extends PropertyKey>(128        target: T,129        propertyKey: P,130        value: P extends keyof T ? T[P] : any,131        receiver?: any,132    ): boolean;133    function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;134 135    /**136     * Sets the prototype of a specified object o to object proto or null.137     * @param target The object to change its prototype.138     * @param proto The value of the new prototype or null.139     * @return Whether setting the prototype was successful.140     */141    function setPrototypeOf(target: object, proto: object | null): boolean;142}143