mirror of
https://github.com/codex-team/editor.js
synced 2024-05-19 14:56:46 +02:00
b7b00fd060
* block onchange stash * improve block filtration * update tool root * chore(block): remove willSelect und willUnselect * onchange events batching * get rid of CustomEvent extension, create custom event map instead * improve types of EventsDispatcher * fix tests * custom sinon + chai matchers * improve tests, add mutex for fake cursor * add test for fake-cursor mutex * test for batch filtering * fix caret setting by enter press at the end of the block * test for detectToolRootChange * remove resolved todos * changelog added * fix tests * Update CHANGELOG.md * rename FakeCursorAboutToBeSet -> FakeCursorAboutToBeToggled * update didMutated statements * move inputs cache clearing to a separate method * rm Record inheritance from Event maps * add type alisases * rename isElementContainsFakeCursor -> isFakeCursorInsideContainer * improve code style
47 lines
867 B
TypeScript
47 lines
867 B
TypeScript
import {BlockToolData} from '../tools';
|
|
import {BlockTuneData} from '../block-tunes/block-tune-data';
|
|
import { BlockId } from './block-id';
|
|
|
|
/**
|
|
* Output of one Tool
|
|
*
|
|
* @template Type - the string literal describing a tool type
|
|
* @template Data - the structure describing a data object supported by the tool
|
|
*/
|
|
export interface OutputBlockData<Type extends string = string, Data extends object = any> {
|
|
/**
|
|
* Unique Id of the block
|
|
*/
|
|
id?: BlockId;
|
|
/**
|
|
* Tool type
|
|
*/
|
|
type: Type;
|
|
/**
|
|
* Saved Block data
|
|
*/
|
|
data: BlockToolData<Data>;
|
|
|
|
/**
|
|
* Block Tunes data
|
|
*/
|
|
tunes?: {[name: string]: BlockTuneData};
|
|
}
|
|
|
|
export interface OutputData {
|
|
/**
|
|
* Editor's version
|
|
*/
|
|
version?: string;
|
|
|
|
/**
|
|
* Timestamp of saving in milliseconds
|
|
*/
|
|
time?: number;
|
|
|
|
/**
|
|
* Saved Blocks
|
|
*/
|
|
blocks: OutputBlockData[];
|
|
}
|