From baa727de93db009f90d70a80a9861758a24eae77 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 5 Nov 2019 10:27:59 +0100 Subject: docs: rename documentation folder to docs Signed-off-by: Jo-Philipp Wich --- docs/jsapi/LuCI.Class.html | 2322 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2322 insertions(+) create mode 100644 docs/jsapi/LuCI.Class.html (limited to 'docs/jsapi/LuCI.Class.html') diff --git a/docs/jsapi/LuCI.Class.html b/docs/jsapi/LuCI.Class.html new file mode 100644 index 0000000000..28916f113e --- /dev/null +++ b/docs/jsapi/LuCI.Class.html @@ -0,0 +1,2322 @@ + + + + + Class: Class + + + + + + + + + + + + + + + + + +
+ + +
+

Class: Class

+ + + + +
+ +
+

+ LuCI. + + Class +

+ +

LuCI.Class is the abstract base class all LuCI classes inherit from.

+

It provides simple means to create subclasses of given classes and +implements prototypal inheritance.

+ +
+ +
+
+ + + + +
+
+

+ + new LuCI.Class() +

+ + +
+ luci.js, line 59 +
+ +
+ + +
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

+ + staticLuCI.Class.extend(properties){LuCI.Class} +

+ + +
+ luci.js, line 87 +
+ +
+ + +
+
+ + +
+

Extends this base class with the properties described in +properties and returns a new subclassed Class instance

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +Object.<string, *> + + + + + +

An object describing the properties to add to the new +subclass.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.Class + + + Returns a new LuCI.Class sublassed from this class, extended +by the given properties and with its prototype set to this base +class to enable inheritance. The resulting value represents a +class constructor and can be instantiated with new.
+ + + + +
+ + + +
+
+

+ + staticLuCI.Class.instantiate(params, new_args){LuCI.Class} +

+ + +
+ luci.js, line 169 +
+ +
+ + +
+
+ + +
+

Calls the class constructor using new with the given argument +array being passed as variadic parameters to the constructor.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params + + +Array.<*> + + + + + + + + + + +

An array of arbitrary values which will be passed as arguments +to the constructor function.

new_args + + +* + + + + + + + optional + + + + + repeatable + + +

Specifies arguments to be passed to the subclass constructor +as-is in order to instantiate the new subclass.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.Class + + + Returns a new LuCI.Class instance extended by the given +properties with its prototype set to this base class to +enable inheritance.
+ + + + +
+ + + +
+
+

+ + staticLuCI.Class.isSubclass(classValue){boolean} +

+ + +
+ luci.js, line 195 +
+ +
+ + +
+
+ + +
+

Checks whether the given class value is a subclass of this class.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
classValue + + +LuCI.Class + + + + + +

The class object to test.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + boolean + + + Returns true when the given classValue is a subclass of this +class or false if the given value is not a valid class or not +a subclass of this class'.
+ + + + +
+ + + +
+
+

+ + staticLuCI.Class.singleton(properties, new_args){LuCI.Class} +

+ + +
+ luci.js, line 145 +
+ +
+ + +
+
+ + +
+

Extends this base class with the properties described in +properties, instantiates the resulting subclass using +the additional optional arguments passed to this function +and returns the resulting subclassed Class instance.

+

This function serves as a convenience shortcut for +Class.extend() and subsequent +new.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +Object.<string, *> + + + + + + + + + + +

An object describing the properties to add to the new +subclass.

new_args + + +* + + + + + + + optional + + + + + repeatable + + +

Specifies arguments to be passed to the subclass constructor +as-is in order to instantiate the new subclass.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + LuCI.Class + + + Returns a new LuCI.Class instance extended by the given +properties with its prototype set to this base class to +enable inheritance.
+ + + + +
+ + + +
+
+

+ + super(key, callArgs){*|null} +

+ + +
+ luci.js, line 267 +
+ +
+ + +
+
+ + +
+

Walks up the parent class chain and looks for a class member +called key in any of the parent classes this class inherits +from. Returns the member value of the superclass or calls the +member as function and returns its return value when the +optional callArgs array is given.

+

This function has two signatures and is sensitive to the +amount of arguments passed to it:

+
    +
  • super('key') - +Returns the value of key when found within one of the +parent classes.
  • +
  • super('key', ['arg1', 'arg2']) - +Calls the key() method with parameters arg1 and arg2 +when found within one of the parent classes.
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + + + + + + +

The name of the superclass member to retrieve.

callArgs + + +Array.<*> + + + + + + + optional + + + + + +

An optional array of function call parameters to use. When +this parameter is specified, the found member value is called +as function using the values of this array as arguments.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Throws:
+ + + +
+
+
+

Throws a ReferenceError when callArgs are specified and +the found member named by key is not a function value.

+
+
+
+
+
+ Type +
+
+ +ReferenceError + + +
+
+
+
+ + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + * + | + + null + + + Returns the value of the found member or the return value of +the call to the found method. Returns null when no member +was found in the parent class chain or when the call to the +superclass method returned null.
+ + + + +
+ + + +
+
+

+ + varargs(args, offset, extra_args){Array.<*>} +

+ + +
+ luci.js, line 225 +
+ +
+ + +
+
+ + +
+

Extract all values from the given argument array beginning from +offset and prepend any further given optional parameters to +the beginning of the resulting array copy.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
args + + +Array.<*> + + + + + + + + + + +

The array to extract the values from.

offset + + +number + + + + + + + + + + +

The offset from which to extract the values. An offset of 0 +would copy all values till the end.

extra_args + + +* + + + + + + + optional + + + + + repeatable + + +

Extra arguments to add to prepend to the resultung array.

+ + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + + + + + + + + + + + + + + + + + + + +
TypeDescription
+ + Array.<*> + + + Returns a new array consisting of the optional extra arguments +and the values extracted from the args array beginning with +offset.
+ + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + +
+ Documentation generated by JSDoc 3.6.3 on Tue Nov 05 2019 10:17:12 GMT+0100 (Central European Standard Time) +
+
+
+ + + + \ No newline at end of file -- cgit v1.2.3