module

  Types

## Index

### Interfaces

- GalleryItem
- IComponent
- IGlobalState
- IMeta
- INavBarProps
- IOptions
- IPiece
- IPieceControllerState
- IPieceItem
- IPieceProps
- IPiecesAPI
- IPiecesOptions
- IReactActionProps
- IReactPieceProps
- IToastrStateExtension
- IWriteAwayState
- IWriteAwayStateExtension

### Type aliases

- PieceActions
- PieceConflictResolver
- PieceDataResolver
- PieceSubscription
- PieceType

## Type aliases

### PieceActions

PieceActions<DataType>: { onEditorActive: (id: string, active: boolean) => void; onManualActivation: (id: string) => void; onManualDeactivation: (id: string) => void; onNodeResized: (id: string) => void; resetPiece: (id: string) => void; savePiece: (id: string) => void; setCurrentSourcePieceId: (id: string) => void; setPieceMessage: (id: string, message: string, messageLevel: string) => void; updatePiece: (id: string, piece: Partial<IPieceItem<DataType>>) => void }

Available actions for a piece

#### Type parameters

- #### DataType = any

#### Type declaration

- ##### onEditorActive: (id: string, active: boolean) => void

  - - (id: string, active: boolean): void

    - #### Parameters

      - ##### id: string

      - ##### active: boolean

      #### Returns void

- ##### onManualActivation: (id: string) => void

  deprecated
  - - (id: string): void

    - #### Parameters

      - ##### id: string

      #### Returns void

- ##### onManualDeactivation: (id: string) => void

  deprecated
  - - (id: string): void

    - #### Parameters

      - ##### id: string

      #### Returns void

- ##### onNodeResized: (id: string) => void

  Signal node was resized so controller resizes hover rectangle

  - - (id: string): void

    - #### Parameters

      - ##### id: string

      #### Returns void

- ##### resetPiece: (id: string) => void

  Rollback piece state to previously saved state

  - - (id: string): void

    - #### Parameters

      - ##### id: string

      #### Returns void

- ##### savePiece: (id: string) => void

  Save piece state on server

  - - (id: string): void

    - #### Parameters

      - ##### id: string

      #### Returns void

- ##### setCurrentSourcePieceId: (id: string) => void

  Forcefully opens source editor for specified id

  deprecated
  - - (id: string): void

    - #### Parameters

      - ##### id: string

      #### Returns void

- ##### setPieceMessage: (id: string, message: string, messageLevel: string) => void

  Sets message to display for specific piece in controller bar

  - - (id: string, message: string, messageLevel: string): void

    - #### Parameters

      - ##### id: string

      - ##### message: string

      - ##### messageLevel: string

      #### Returns void

- ##### updatePiece: (id: string, piece: Partial<IPieceItem<DataType>>) => void

  Update piece in state by id

  - - (id: string, piece: Partial<IPieceItem<DataType>>): void

    - #### Parameters

      - ##### id: string

      - ##### piece: Partial<IPieceItem<DataType>>

      #### Returns void

### PieceConflictResolver

PieceConflictResolver: (current: IPieceItem, external: IPieceItem) => IPieceItem

Resolve conflicts between current in-state piece data and data coming from external source Should resolve as data that needs to be applied

param

  current state of piece

param

  external state of piece

#### Type declaration

- - (current: IPieceItem, external: IPieceItem): IPieceItem

  - #### Parameters

    - ##### current: IPieceItem

    - ##### external: IPieceItem

    #### Returns IPieceItem

### PieceDataResolver

PieceDataResolver<DataType>: (piece: IPieceItem<DataType>, resolvers?: Partial<Record<PieceType, PieceDataResolver>>) => Promise<IPieceItem<DataType>>

#### Type parameters

- #### DataType = any

#### Type declaration

- - (piece: IPieceItem<DataType>, resolvers?: Partial<Record<PieceType, PieceDataResolver>>): Promise<IPieceItem<DataType>>

  - #### Parameters

    - ##### piece: IPieceItem<DataType>

    - ##### Optional resolvers: Partial<Record<PieceType, PieceDataResolver>>

    #### Returns Promise<IPieceItem<DataType>>

### PieceSubscription

PieceSubscription: (fn: (piece: Partial<IPieceItem>) => boolean) => () => void

Subscribe to piece updates coming from external source, i.e. websockets

param

  subscription function Should return an unsubscribe function

#### Type declaration

- - (fn: (piece: Partial<IPieceItem>) => boolean): () => void

  - #### Parameters

    - ##### fn: (piece: Partial<IPieceItem>) => boolean

      - - (piece: Partial<IPieceItem>): boolean

        - #### Parameters

          - ##### piece: Partial<IPieceItem>

          #### Returns boolean

    #### Returns () => void

    - - (): void

      - #### Returns void

### PieceType

PieceType: "source" | "background" | "html" | "image" | "seo"

Generated using TypeDoc