javascriptcore.class_

Module for [Class] class

Module Initializers 1

shared static this()

Types 3

A JSSClass represents a custom JavaScript class registered by the user in a #JSCContext. It allows to create new JavaScripts objects whose instances are created by the user using this API. It's possible to add constructors, properties and methods for a JSSClass by providing #GCallback<!-- -->s to implement them.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
Class self() nothrowReturns `this`, for use in `with` statements.
ClassGidBuilder builder() static nothrowGet builder for [javascriptcore.class_.Class] Returns: New builder object
string name() @property nothrowGet `name` property. Returns: The name of the class.
javascriptcore.class_.Class parent() @property nothrowGet `parent` property. Returns: The parent class or null in case of final classes.
Value addConstructor(alias Ctor)(string name = null) if (isCallable!Ctor && is(ReturnType!Ctor : Object)) nothrowAdd a constructor to a Class. If name is empty (null), the class name will be used. After creating the constructor, it needs to be added to an object as a property to be able to use it. Use [Contex...
void addMethod(alias Method)(string name = null) if (isCallable!Method) nothrowAdd a method to a Class. Params: Method = The method name = The JSC name of the method or null to use the D method name (default)
void readOnlyProperty() nothrowUsed as a default value for addProperty template Setter argument which results in a read-only property
void addProperty(alias Getter, alias Setter = readOnlyProperty)(string name) if ((isCallable!Getter && !is(ReturnType!Getter == void) && Parameters!Getter.length == 0) && (__traits(isSame, Setter, readOnlyProperty) || (isCallable!Setter && is(ReturnType!Setter == void) && Parameters!Setter.length == 1))) nothrowAdd a property to a Class. Params: Getter = The getter method Setter = The setter method (optional) name = The property name
string getName() nothrowGet the class name of jsc_class Returns: the name of jsc_class
javascriptcore.class_.Class getParent() nothrowGet the parent class of jsc_class Returns: the parent class of jsc_class
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for javascriptcore.class_.Class

Methods
T context(javascriptcore.context.Context propval) nothrowSet `context` property. Params: propval = The #JSCContext in which the class was registered. Returns: Builder instance for fluent chaining
T name(string propval) nothrowSet `name` property. Params: propval = The name of the class. Returns: Builder instance for fluent chaining
T parent(javascriptcore.class_.Class propval) nothrowSet `parent` property. Params: propval = The parent class or null in case of final classes. Returns: Builder instance for fluent chaining

Fluent builder for javascriptcore.class_.Class

Methods
Class build() nothrowCreate object from builder. Returns: New object

Variables 1

varQuark jscObjectQuark