Interface that should be implemented for editors

### Hierarchy

- IPiecesAPI

## Index

### Properties

- deleteImage
- getImageList
- getNodeRect
- getPieceData
- isNodeVisible
- resolvers
- savePieceData
- uploadImage

## Properties

### Optional deleteImage

deleteImage: undefined | ((id: string) => Promise<any>)

Delete image by id. If not specified delete operation will be disabled

### Optional getImageList

getImageList: undefined | ((piece: { dataset?: undefined | {}; id: string }) => Promise<Array<GalleryItem>>)

Get image gallery. If not specified gallery will be disabled

### getNodeRect

getNodeRect: (piece: IPieceItem) => { hover?: Rect; node: Rect }

Resolves piece rectangle to display hover rectangle

#### Type declaration

- - (piece: IPieceItem): { hover?: Rect; node: Rect }

  - #### Parameters

    - ##### piece: IPieceItem

    #### Returns { hover?: Rect; node: Rect }

    - ##### Optional hover?: Rect

    - ##### node: Rect

### getPieceData

getPieceData: PieceDataResolver

Resolve piece data from server or other source

### isNodeVisible

isNodeVisible: (piece: IPieceItem) => boolean

Checks if node is visible on current page

#### Type declaration

- - (piece: IPieceItem): boolean

  - #### Parameters

    - ##### piece: IPieceItem

    #### Returns boolean

### resolvers

resolvers: Partial<Record<PieceType, PieceDataResolver>>

Specifies piece data resolvers per piece type

### savePieceData

savePieceData: (piece: IPieceItem) => Promise<IPieceItem>

Persist piece data on server or other target

#### Type declaration

- - (piece: IPieceItem): Promise<IPieceItem>

  - #### Parameters

    - ##### piece: IPieceItem

    #### Returns Promise<IPieceItem>

### Optional uploadImage

uploadImage: undefined | ((file: File | FileList) => Promise<GalleryItem | GalleryItem[]>)

Upload images. If not specified, upload will be disabled

Generated using TypeDoc