JSDoc: Class: Action

# Class: Action

## action.Action(id, type, subtype)

Repesents an action for dispatch. Used in |action.Chain| and |action.Sequence|.

## Constructor

#### new Action(id, type, subtype)

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | string | Input source ID.
`type` | string | Action type: none, key, pointer.
`subtype` | string | Action subtype: `action.Pause`, `action.KeyUp`, `action.KeyDown`, `action.PointerUp`, `action.PointerDown`, `action.PointerMove`, or `action.PointerCancel`.

Source:
  - action.js, line 643

##### Throws:

If any parameters are undefined.

Type
  InvalidArgumentError

### Methods

#### (static) fromJSON(actionSequence, actionItem) → {action.Action}

##### Parameters:

Name | Type | Description
--- | --- | ---
`actionSequence` | action.Sequence | Object representing sequence of actions from one input source.
`actionItem` | action.Action | Object representing a single action from |actionSequence|.

Source:
  - action.js, line 675

##### Throws:

- If any `actionSequence` or `actionItem` attributes are invalid.

  Type
    InvalidArgumentError

- If `actionItem.type` is `action.PointerCancel`.

  Type
    UnsupportedOperationError

##### Returns:

An action that can be dispatched; corresponds to |actionItem|.

Type
  action.Action