modules.InjectableNopeBaseModule - ZeMA-gGmbH/NoPE-JS GitHub Wiki
modules.InjectableNopeBaseModule
Base Implementation of a Module.
The Module is used to share information and data. Although it implements the the Basic behavior to fullfill a given traget.
Export
Implements
-
↳
InjectableNopeBaseModule
new InjectableNopeBaseModule(_core)
Creates an instance of BaseModule.
Memberof
InjectableNopeBaseModule
| Name | Type |
|---|---|
_core |
INopeCore |
_markedElements: { accessor: string ; options: IEventOptions | IServiceOptions<any> ; type: "event" | "method" | "prop" }[]
Internal Element, which is used to store elements, that should be added automaticallay.
Memberof
INopeModule
NopeBaseModule._markedElements
author: IAuthor
A Description of the Author. Use to Mail etc.
Memberof
BaseModule
description: string
A Description of the Module. This is used to Describe roughly what the module is capable of doing.
Memberof
BaseModule
identifier: string
The Identifier of the Module.
Memberof
BaseModule
uiLinks: { description: string ; link: string ; name: string }[]
version: IVersion
Description of the provided Version of the Module.
Memberof
BaseModule
get events(): Object
Public get to receive a Description of the Properties
Memberof
BaseModule
Object
NopeBaseModule.events
get methods(): Object
Public getter for the functions
Memberof
BaseModule
Object
NopeBaseModule.methods
get properties(): Object
Public get to receive a Description of the Properties
Memberof
BaseModule
Object
NopeBaseModule.properties
get type(): string
Return the Class Identifier.
string
NopeBaseModule.type
dispose(): Promise<void>
Function, which is used to unregister the element.
Memberof
NopeBaseModule
Promise<void>
getIdentifierOf(prop_event_or_func, type?): string
Helper Function to extract the used identifiert of Property
Memberof
NopeBaseModule
| Name | Type | Default value | Description |
|---|---|---|---|
prop_event_or_func |
INopeObservable<any, any, any, IEventAdditionalData> | (...args: any[]) => Promise<any> |
undefined |
The Property or the Function to receive the Name. |
type |
"topicToPublish" | "topicToSubscribe"
|
null |
- |
string
{string}
NopeBaseModule.getIdentifierOf
init(...args): Promise<void>
An init Function. Used to initialize the Element.
Memberof
NopeBaseModule
| Name | Type |
|---|---|
...args |
any[] |
Promise<void>
{Promise}
listEvents(): Promise<{ emitter: INopeEventEmitter<any, any, any, IEventAdditionalData> ; options: IEventOptions }[]>
Function used to list all available Properties.
Memberof
NopeBaseModule
Promise<{ emitter: INopeEventEmitter<any, any, any, IEventAdditionalData> ; options: IEventOptions }[]>
{Promise<Array<{ observable: INopeObservable, options: IPropertyOptions }>>}
listMethods(): Promise<{ method: (...args: any[]) => Promise<any> ; options: IServiceOptions<any> }[]>
Function to return all available Methods.
Memberof
NopeBaseModule
Promise<{ method: (...args: any[]) => Promise<any> ; options: IServiceOptions<any> }[]>
{Promise<{ func: (...args: any[]) => Promise; options: IServiceOptions; }[]>}
listProperties(): Promise<{ observable: INopeObservable<any, any, any, IEventAdditionalData> ; options: IEventOptions }[]>
Function used to list all available Properties.
Memberof
NopeBaseModule
Promise<{ observable: INopeObservable<any, any, any, IEventAdditionalData> ; options: IEventOptions }[]>
{Promise<Array<{ observable: INopeObservable, options: IPropertyOptions }>>}
registerEvent<T, S, G>(name, emitter, options): Promise<void>
Helper Function to register an Event(Emitter) (a Property.)
Memberof
NopeBaseModule
| Name | Type | Description |
|---|---|---|
T |
T |
Type of the Event(Emitter) |
S |
T |
Setter Type of the Event(Emitter) |
G |
T |
Getter Type of the Event(Emitter) |
| Name | Type | Description |
|---|---|---|
name |
string |
Name, which should be used to register the element. The Name will ALLWAYS (automatically) be assembled using the modules identifier an then the name. |
emitter |
INopeObservable<T, S, G, IEventAdditionalData> |
The Event(Emitter) representing the Property |
options |
IEventOptions |
The Options used to define the registration. |
Promise<void>
{Promise}
registerMethod(name, method, options): Promise<void>
Function used to register a Method. This Method will be available in the shared network.
Memberof
NopeBaseModule
| Name | Type | Description |
|---|---|---|
name |
string |
Name of the Method, which is used during registration at the dispatcher |
method |
(...args: any[]) => Promise<any> |
The function itself. It must be async. |
options |
IServiceOptions<any> |
The Options, used for registering. |
Promise<void>
{Promise}
registerProperty<T, S, G>(name, observable, options): Promise<void>
Helper Function to register an Observable (a Property.)
Memberof
NopeBaseModule
| Name | Type | Description |
|---|---|---|
T |
T |
Type of the Property |
S |
T |
Setter Type of the Property |
G |
T |
Getter Type of the Property |
| Name | Type | Description |
|---|---|---|
name |
string |
Name, which should be used to register the element. The Name will ALLWAYS (automatically) be assembled using the modules identifier an then the name. |
observable |
INopeObservable<T, S, G, IEventAdditionalData> |
The Observable representing the Property |
options |
IEventOptions |
The Options used to define the registration. |
Promise<void>
{Promise}
NopeBaseModule.registerProperty
toDescription(): INopeModuleDescription
Helper function to extract an description of the Module.
Memberof
NopeBaseModule
a parsed description
unregisterEvent(name): Promise<void>
Helper Function to unregister an Eventbased Property
Memberof
NopeBaseModule
| Name | Type | Description |
|---|---|---|
name |
string |
Name of the Property, that has been used to register. |
Promise<void>
{Promise}
NopeBaseModule.unregisterEvent
unregisterFunction(name): Promise<void>
Unregister a Function
Memberof
NopeBaseModule
| Name | Type | Description |
|---|---|---|
name |
string |
Name of the function used during registering. |
Promise<void>
{Promise}
NopeBaseModule.unregisterFunction
unregisterProperty(name): Promise<void>
Helper Function to unregister an Observable (a Property.)
Memberof
NopeBaseModule
| Name | Type | Description |
|---|---|---|
name |
string |
Name of the Property, that has been used to register. |
Promise<void>
{Promise}