inheritdoc

  Off switch listener implementation.

  The textbox and the invoker will be disabled when the incoming message doesn't contain a NER strategy.

### Hierarchy

- OffSwitchListener

### Implements

- IListener

## Index

### Constructors

- constructor

### Properties

- btn
- txt

### Methods

- onConnected
- onConnectionLost
- onDisconnected
- onError
- onMessage
- onPacketSend
- switchOff

## Constructors

### constructor

- new OffSwitchListener(txt?: HTMLTextAreaElement, btn?: HTMLButtonElement): OffSwitchListener

- - Defined in lib/listener/OffSwitchListener.ts:15

  #### Parameters

  - ##### Optional txt: HTMLTextAreaElement

  - ##### Optional btn: HTMLButtonElement

  #### Returns OffSwitchListener

## Properties

### Private btn

btn: HTMLButtonElement

- Defined in lib/listener/OffSwitchListener.ts:15

### Private txt

txt: HTMLTextAreaElement

- Defined in lib/listener/OffSwitchListener.ts:14

## Methods

### onConnected

- onConnected(): void

- Implementation of IListener.onConnected

  - Defined in lib/listener/OffSwitchListener.ts:25

  Is called when the client is connected to the server

  #### Returns void

### onConnectionLost

- onConnectionLost(): void

- Implementation of IListener.onConnectionLost

  - Defined in lib/listener/OffSwitchListener.ts:32

  Is called when the client lost the connection

  #### Returns void

### onDisconnected

- onDisconnected(): void

- Implementation of IListener.onDisconnected

  - Defined in lib/listener/OffSwitchListener.ts:39

  Is called when the client is disconnected

  #### Returns void

### onError

- onError(error: string): void

- Implementation of IListener.onError

  - Defined in lib/listener/OffSwitchListener.ts:46

  Is called when an error occurred

  #### Parameters

  - ##### error: string

  #### Returns void

### onMessage

- onMessage(data: ISpecification): void

- - Defined in lib/listener/OffSwitchListener.ts:60
  inheritdoc

  #### Parameters

  - ##### data: ISpecification

  #### Returns void

### onPacketSend

- onPacketSend(packet: IPacket): void

- Implementation of IListener.onPacketSend

  - Defined in lib/listener/OffSwitchListener.ts:53

  Is called when a packet will be sent

  #### Parameters

  - ##### packet: IPacket

  #### Returns void

### switchOff

- switchOff(nerStrategies?: Map<string, any>): void

- - Defined in lib/listener/OffSwitchListener.ts:72

  Sets the disabled flag and adds the CSS class lto-off to the invoker and textbox, if there is no NER strategy passed

  #### Parameters

  - ##### Optional nerStrategies: Map<string, any>

    the NER strategy which is used in the current message

  #### Returns void

Generated using TypeDoc