Documentation / commands/Command
commands/Command
Classes
abstract
Command<TCommandContent, TCommandResponse>
Represents an implementation of ICommand that works with HTTP fetch.
Type Parameters
• TCommandContent = object
• TCommandResponse = object
Implements
ICommand
<TCommandContent
,TCommandResponse
>
Constructors
new Command()
new Command<
TCommandContent
,TCommandResponse
>(_responseType
,_isResponseTypeEnumerable
):Command
<TCommandContent
,TCommandResponse
>
Initializes a new instance of the <,> class.
Parameters
_responseType
Constructor
= Object
Type of response.
_isResponseTypeEnumerable
boolean
Whether or not the response type is enumerable.
Returns
Command
<TCommandContent
, TCommandResponse
>
Defined in
Properties
_isResponseTypeEnumerable
readonly
_isResponseTypeEnumerable:boolean
Whether or not the response type is enumerable.
Defined in
_responseType
readonly
_responseType:Constructor
=Object
Type of response.
Defined in
route
abstract
readonly
route:string
Gets the route information for the command.
Implementation of
Defined in
routeTemplate
abstract
readonly
routeTemplate:TemplateDelegate
Defined in
validation
abstract
readonly
validation:CommandValidator
Defined in
Accessors
hasChanges
Get Signature
get hasChanges():
boolean
Gets whether or not there are changes to any properties.
Returns
boolean
Gets whether or not there are changes to any properties.
Implementation of
Defined in
properties
Get Signature
get
abstract
properties():string
[]
Returns
string
[]
Defined in
requestArguments
Get Signature
get
abstract
requestArguments():string
[]
Returns
string
[]
Defined in
Methods
clear()
clear():
void
Clear the command properties and reset them to their default values. This will also clear the initial values. This is used when the command is not needed anymore and should be cleared.
Returns
void
Implementation of
Defined in
execute()
execute():
Promise
<CommandResult
<TCommandResponse
>>
Execute the ICommand.
Returns
Promise
<CommandResult
<TCommandResponse
>>
for the execution.
Implementation of
Defined in
onPropertyChanged()
onPropertyChanged(
callback
,thisArg
):void
Register callback that gets called when a property changes.
Parameters
callback
Callback to register.
thisArg
object
The this arg to use when calling.
Returns
void
Implementation of
Defined in
propertyChanged()
propertyChanged(
property
):void
Notify about a property that has had its value changed.
Parameters
property
string
Name of property that changes.
Returns
void
Implementation of
Defined in
revertChanges()
revertChanges():
void
Revert any changes on the command.
Returns
void
Implementation of
Defined in
setApiBasePath()
setApiBasePath(
apiBasePath
):void
Set the base path for the API to use for the query. This is used to prepend to the path to any fetch operation.
Parameters
apiBasePath
string
Base path for the API
Returns
void
Implementation of
Defined in
setInitialValues()
setInitialValues(
values
):void
Set the initial values for the command. This is used for tracking if there are changes to a command or not.
Parameters
values
TCommandContent
Values to set.
Returns
void
Implementation of
Defined in
setInitialValuesFromCurrentValues()
setInitialValuesFromCurrentValues():
void
Set the initial values for the command to be the current value of the properties.
Returns
void
Implementation of
ICommand
.setInitialValuesFromCurrentValues
Defined in
setMicroservice()
setMicroservice(
microservice
):void
Set the microservice to be used for the query. This is passed along to the server to identify the microservice.
Parameters
microservice
string
Name of microservice
Returns
void