Skip to content

@sebasoft/neuron-js


Defined in: index.ts:65

The Neuron class serves as the central component registry for the rules engine. It manages the availability and instantiation of Parameters, Conditions, Actions, and Rules.

Constructors ​

Constructor ​

new Neuron(): Neuron

Defined in: index.ts:76

Creates a new Neuron instance and registers the default built-in plugins.

Returns ​

Neuron

Methods ​

createParameterMap() ​

createParameterMap(params): Map<string, IElementInstance & object>

Defined in: index.ts:120

Converts serializable parameter definitions into a name-keyed Map of parameter instances.

Plugin authors still receive JSON-friendly arrays at the script boundary, but base classes can expose a Map for ergonomic this.params.get("name") access.

Parameters ​

params ​

ParameterInterface<any, any>[]

Returns ​

Map<string, IElementInstance & object>


getAction() ​

getAction(type): ActionConstructor | undefined

Defined in: index.ts:169

Retrieves an action constructor by type.

Parameters ​

type ​

string

Returns ​

ActionConstructor | undefined


getCondition() ​

getCondition(type): ConditionConstructor | undefined

Defined in: index.ts:159

Retrieves a condition constructor by type.

Parameters ​

type ​

string

Returns ​

ConditionConstructor | undefined


getParameter() ​

getParameter(type): ParameterConstructor<any> | undefined

Defined in: index.ts:110

Retrieves a parameter constructor by type.

Parameters ​

type ​

string

Returns ​

ParameterConstructor<any> | undefined


getRule() ​

getRule(type): RuleConstructor | undefined

Defined in: index.ts:179

Retrieves a rule constructor by type.

Parameters ​

type ​

string

Returns ​

RuleConstructor | undefined


registerAction() ​

registerAction(type, ctor): void

Defined in: index.ts:164

Registers a custom action type.

Parameters ​

type ​

string

ctor ​

ActionConstructor

Returns ​

void


registerCondition() ​

registerCondition(type, ctor): void

Defined in: index.ts:154

Registers a custom condition type.

Parameters ​

type ​

string

ctor ​

ConditionConstructor

Returns ​

void


registerParameter() ​

registerParameter(type, ctor): void

Defined in: index.ts:105

Registers a custom parameter type.

Parameters ​

type ​

string

ctor ​

ParameterConstructor

Returns ​

void


registerRule() ​

registerRule(type, ctor): void

Defined in: index.ts:174

Registers a custom rule type.

Parameters ​

type ​

string

ctor ​

RuleConstructor

Returns ​

void