classdesc

  Class representing a component.

### Hierarchy

- Component

## Index

### Constructors

- constructor

### Properties

- _data
- _type
- _uuid

### Accessors

- data
- json
- type
- uuid

### Methods

- clone
- copy
- mergeData

## Constructors

### constructor

- new Component(config?: ComponentConfig): Component

- - Defined in core/Component.ts:16
  description

    Create a Component.

  #### Parameters

  - ##### Optional config: ComponentConfig

  #### Returns Component

## Properties

### Private _data

_data: __type | []

- Defined in core/Component.ts:14

### Private _type

_type: string

- Defined in core/Component.ts:15

### Private _uuid

_uuid: string

- Defined in core/Component.ts:16

## Accessors

### data

- get data(): __type | []
- set data(data: __type | []): void

- - Defined in core/Component.ts:53
  description

    Get the component's data.

  readonly

  #### Returns __type | []

  - The component's data
- - Defined in core/Component.ts:63
  description

    Set the component's data. Note: This method differs from `.mergeData()` in that it completely overwrites any existing data within the component.

  #### Parameters

  - ##### data: __type | []

    Data object to apply

  #### Returns void

  - The component's updated updated data object

### json

- get json(): string

- - Defined in core/Component.ts:72
  description

    Get the component's data as a JSON string.

  readonly

  #### Returns string

  - The component's data as a JSON string

### type

- get type(): string
- set type(type: string): void

- - Defined in core/Component.ts:85
  description

    Get the component's type.

  readonly

  #### Returns string

  - The component's type
- - Defined in core/Component.ts:93
  description

    Set the component's type.

  #### Parameters

  - ##### type: string

    New type for the component

  #### Returns void

  - The component's type

### uuid

- get uuid(): string

- - Defined in core/Component.ts:102
  description

    Get the component's UUID.

  readonly

  #### Returns string

  - The component's UUID

## Methods

### clone

- clone(): Component

- - Defined in core/Component.ts:113
  description

    Clone the component.

  #### Returns Component

  - New component instance with the same data

### copy

- copy(source: Component): void

- - Defined in core/Component.ts:123
  description

    Copy another component's data, resetting existing data.

  #### Parameters

  - ##### source: Component

    Component to copy from

  #### Returns void

### mergeData

- mergeData(data: any): __type | []

- - Defined in core/Component.ts:135
  description

    Merge a data object into this component.

  #### Parameters

  - ##### data: any

    JSON data to apply to the component

  #### Returns __type | []

  - Updated data object/array