Class: ActionDefinition
@react-form-builder/core.ActionDefinition
Represents the definition of an action.
Constructors
constructor
• new ActionDefinition(func
, body?
, params?
)
Creates a new instance of the ActionDefinition class.
Parameters
Name | Type | Description |
---|---|---|
func | Func | the function of an action. |
body? | string | the source code of the Action. |
params | ActionParameters | the parameters of the Action. |
Properties
body
• Optional
Readonly
body: string
the source code of the Action.
func
• Readonly
func: Func
the function of an action.
params
• Readonly
params: ActionParameters
= {}
the parameters of the Action.
Methods
createFromObject
▸ Static
createFromObject(value
): ActionDefinition
Correctly creates the ActionDefinition from deserialized data.
Parameters
Name | Type | Description |
---|---|---|
value | any | the deserialized data. |
Returns
the ActionDefinition instance.
functionalAction
▸ Static
functionalAction(func
, params?
): ActionDefinition
Creates an action from the function.
Parameters
Name | Type | Description |
---|---|---|
func | Func | the function of an action. |
params | ActionParameters | the parameters of the Action. |
Returns
the new instance of the ActionDefinition class.
sourceAction
▸ Static
sourceAction(body
, params?
): ActionDefinition
Creates an action from the source code.
Parameters
Name | Type | Description |
---|---|---|
body | string | the source code of the Action. |
params | ActionParameters | the parameters of the Action. |
Returns
the new instance of the ActionDefinition class.