classdesc

  Class representing a component.

### Hierarchy

- Component

## Index

### Constructors

- constructor

### 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

## Accessors

### data

- get data(): any
- set data(data: any): void

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

    Get the component's data.

  readonly

  #### Returns any

  - 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: any

    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): any

- - 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 any

  - Updated data object/array

Generated using TypeDoc