Table of Contents

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

commands/Command.ts:37

Properties

_isResponseTypeEnumerable

readonly _isResponseTypeEnumerable: boolean

Whether or not the response type is enumerable.

Defined in

commands/Command.ts:37

_responseType

readonly _responseType: Constructor = Object

Type of response.

Defined in

commands/Command.ts:37

route

abstract readonly route: string

Gets the route information for the command.

Implementation of

ICommand.route

Defined in

commands/Command.ts:22

routeTemplate

abstract readonly routeTemplate: TemplateDelegate

Defined in

commands/Command.ts:23

validation

abstract readonly validation: CommandValidator

Defined in

commands/Command.ts:24

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

ICommand.hasChanges

Defined in

commands/Command.ts:132

properties
Get Signature

get abstract properties(): string[]

Returns

string[]

Defined in

commands/Command.ts:26

requestArguments
Get Signature

get abstract requestArguments(): string[]

Returns

string[]

Defined in

commands/Command.ts:25

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

ICommand.clear

Defined in

commands/Command.ts:95

execute()

execute(): Promise<CommandResult<TCommandResponse>>

Execute the ICommand.

Returns

Promise<CommandResult<TCommandResponse>>

for the execution.

Implementation of

ICommand.execute

Defined in

commands/Command.ts:53

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

Implementation of

ICommand.onPropertyChanged

Defined in

commands/Command.ts:152

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

ICommand.propertyChanged

Defined in

commands/Command.ts:137

revertChanges()

revertChanges(): void

Revert any changes on the command.

Returns

void

Implementation of

ICommand.revertChanges

Defined in

commands/Command.ts:125

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

ICommand.setApiBasePath

Defined in

commands/Command.ts:48

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

ICommand.setInitialValues

Defined in

commands/Command.ts:104

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

commands/Command.ts:115

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

Implementation of

ICommand.setMicroservice

Defined in

commands/Command.ts:43