Reflect

Functions

Link copied to clipboard
external fun <T : JsAny, A : Tuple> construct(target: ConstructorFunction<A, T>, argumentsList: A): T

Constructs the target with the elements of specified array as the arguments and the specified constructor as the new.target value.

external fun <T : JsAny> construct(target: JsClass<T>, argumentsList: ReadonlyArray<JsAny?>): T
Link copied to clipboard
external fun defineProperty(target: JsAny, propertyKey: PropertyKey, attributes: TypedPropertyDescriptor<*>): Boolean

Adds a property to an object, or modifies attributes of an existing property.

external fun defineProperty(target: JsAny, propertyKey: String, attributes: TypedPropertyDescriptor<*>): Boolean
Link copied to clipboard
external fun deleteProperty(target: JsAny, propertyKey: PropertyKey): Boolean

Removes a property from an object, equivalent to delete target[propertyKey], except it won't throw if target[propertyKey] is non-configurable.

external fun deleteProperty(target: JsAny, propertyKey: String): Boolean
Link copied to clipboard
external fun get(target: JsAny, propertyKey: PropertyKey): JsAny?

Gets the property of target, equivalent to target[propertyKey] when receiver === target.

external fun get(target: JsAny, propertyKey: String): JsAny?
Link copied to clipboard
external fun getOwnPropertyDescriptor(target: JsAny, propertyKey: PropertyKey): TypedPropertyDescriptor<*>

Gets the own property descriptor of the specified object. An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.

external fun getOwnPropertyDescriptor(target: JsAny, propertyKey: String): TypedPropertyDescriptor<*>
Link copied to clipboard
external fun getPrototypeOf(target: JsAny): JsAny?

Returns the prototype of an object.

Link copied to clipboard
external fun has(target: JsAny, propertyKey: PropertyKey): Boolean

Equivalent to propertyKey in target.

external fun has(target: JsAny, propertyKey: String): Boolean
Link copied to clipboard
external fun isExtensible(target: JsAny): Boolean

Returns a value that indicates whether new properties can be added to an object.

Link copied to clipboard
external fun ownKeys(target: JsAny): ReadonlyArray<PropertyKey>

Returns the string and symbol keys of the own properties of an object. The own properties of an object are those that are defined directly on that object, and are not inherited from the object's prototype.

Link copied to clipboard
external fun preventExtensions(target: JsAny): Boolean

Prevents the addition of new properties to an object.

Link copied to clipboard
external fun set(target: JsAny, propertyKey: PropertyKey, value: JsAny?): Boolean

Sets the property of target, equivalent to target[propertyKey] = value when receiver === target.

external fun set(target: JsAny, propertyKey: String, value: JsAny?): Boolean
Link copied to clipboard
external fun setPrototypeOf(target: JsAny, proto: JsAny?): Boolean

Sets the prototype of a specified object o to object proto or null.