mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 09:52:36 +02:00
022320940e
* feat(conversion): allow to convert block using shortcut * display shortcuts in conversion toolbar * tests for the blocks.convert * tests for the toolbox shortcuts * Update CHANGELOG.md * Update toolbox.cy.ts * rm unused imports * firefox test fixed * test errors via to.throw
27 lines
825 B
TypeScript
27 lines
825 B
TypeScript
import type { BlockToolData } from '../tools';
|
|
|
|
/**
|
|
* Config allows Tool to specify how it can be converted into/from another Tool
|
|
*/
|
|
export interface ConversionConfig {
|
|
/**
|
|
* How to import string to this Tool.
|
|
*
|
|
* Can be a String or Function:
|
|
*
|
|
* 1. String — the key of Tool data object to fill it with imported string on render.
|
|
* 2. Function — method that accepts importing string and composes Tool data to render.
|
|
*/
|
|
import?: ((data: string) => string) | string;
|
|
|
|
/**
|
|
* How to export this Tool to make other Block.
|
|
*
|
|
* Can be a String or Function:
|
|
*
|
|
* 1. String — which property of saved Tool data should be used as exported string.
|
|
* 2. Function — accepts saved Tool data and create a string to export
|
|
*/
|
|
export?: ((data: BlockToolData) => string) | string;
|
|
}
|