glendix/js/object
Creates and manipulates typed JavaScript object handles.
Types
Represents a JavaScript boolean value.
pub type JsBoolean {
TrueValue
FalseValue
}
Constructors
-
TrueValueJavaScript
true. -
FalseValueJavaScript
false.
Represents a JavaScript constructor handle.
pub type JsConstructor
Values
pub fn bool(value value: JsBoolean) -> JsValue
Converts a typed JavaScript boolean into a JavaScript value.
pub fn call_method(
on object: JsObject,
named method: String,
with arguments: List(JsValue),
) -> JsValue
Calls an object method with a list of arguments.
pub fn call_method_without_arguments(
on object: JsObject,
named method: String,
) -> JsValue
Calls an object method without arguments.
pub fn delete(from object: JsObject, key key: String) -> JsObject
Deletes an object property and returns the same object handle.
pub fn from_entries(
entries entries: List(#(String, JsValue)),
) -> JsObject
Creates an object from key-value entries.
pub fn from_object(object object: JsObject) -> JsValue
Converts an object handle into a JavaScript value.
pub fn has(in object: JsObject, key key: String) -> Bool
Reports whether an object has the given property.
pub fn new_instance(
using constructor: JsConstructor,
with arguments: List(JsValue),
) -> JsObject
Creates an object with JavaScript’s new operator.