Table of Contents

Documentation / commands/ICommand

commands/ICommand

Interfaces

ICommand<TCommandContent, TCommandResponse>

Defines the base of a command.

Extends

Type Parameters

TCommandContent = object

TCommandResponse = object

Properties

hasChanges

readonly hasChanges: boolean

Gets whether or not there are changes to any properties.

Defined in

commands/ICommand.ts:53

route

readonly route: string

Gets the route information for the command.

Defined in

commands/ICommand.ts:19

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

Defined in

commands/ICommand.ts:32

execute()

execute(): Promise<CommandResult<TCommandResponse>>

Execute the ICommand.

Returns

Promise<CommandResult<TCommandResponse>>

for the execution.

Defined in

commands/ICommand.ts:26

onPropertyChanged()

onPropertyChanged(callback, thisArg): void

Register callback that gets called when a property changes.

Parameters
callback

PropertyChanged

Callback to register.

thisArg

object

The this arg to use when calling.

Returns

void

Defined in

commands/ICommand.ts:66

propertyChanged()

propertyChanged(property): void

Notify about a property that has had its value changed.

Parameters
property

string

Name of property that changes.

Returns

void

Defined in

commands/ICommand.ts:59

revertChanges()

revertChanges(): void

Revert any changes on the command.

Returns

void

Defined in

commands/ICommand.ts:48

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

Inherited from

ICanBeConfigured.setApiBasePath

Defined in

ICanBeConfigured.ts:18

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

Defined in

commands/ICommand.ts:38

setInitialValuesFromCurrentValues()

setInitialValuesFromCurrentValues(): void

Set the initial values for the command to be the current value of the properties.

Returns

void

Defined in

commands/ICommand.ts:43

setMicroservice()

setMicroservice(microservice): any

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

any

Inherited from

ICanBeConfigured.setMicroservice

Defined in

ICanBeConfigured.ts:12

Type Aliases

PropertyChanged()

PropertyChanged: (property) => void

Callback for when a property changes.

Parameters

property

string

Returns

void

Defined in

commands/ICommand.ts:10