This is the generic type of the class, used to keep intellisense valid for the proxy instance, even though it is only a proxy that only contains the functions
Returns whether the value is included in the array
The array of values
The value
Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :-
import dynamicProto from "@microsoft/dynamicproto-js";
class ExampleClass extends BaseClass {
constructor() {
dynamicProto(ExampleClass, this, (_self, base) => {
// This will define a function that will be converted to a prototype function
_self.newFunc = () => {
// Access any "this" instance property
if (_self.someProperty) {
...
}
}
// This will define a function that will be converted to a prototype function
_self.myFunction = () => {
// Access any "this" instance property
if (_self.someProperty) {
// Call the base version of the function that we are overriding
base.myFunction();
}
...
}
_self.initialize = () => {
...
}
// Warnings: While the following will work as _self is simply a reference to
// this, if anyone overrides myFunction() the overridden will be called first
// as the normal JavaScript method resolution will occur and the defined
// _self.initialize() function is actually gets removed from the instance and
// a proxy prototype version is created to reference the created method.
_self.initialize();
});
}
}
This is the generic type of the class, used to keep intellisense valid
The type that contains the prototype of the current class
This is the current class instance which contains the prototype for the current class
The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value.
The callback function (closure) that will create the dynamic function
Generated using TypeDoc
The delegate signature for the function used as the callback for dynamicProto()
This is the real "this" of the current target object
The is a proxy object which ONLY contains this function that existed on the "this" instance before calling dynamicProto, it does NOT contain properties of this. This is basically equivalent to using the "super" keyword.