mirror of
https://github.com/codex-team/editor.js
synced 2024-05-18 14:26:48 +02:00
494d6e4b9b
* fix: use type imports for block events * add changelog entry --------- Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
27 lines
547 B
TypeScript
27 lines
547 B
TypeScript
import type { BlockMutationEventDetail } from './Base';
|
|
|
|
/**
|
|
* Type name of CustomEvent related to block moved event
|
|
*/
|
|
export const BlockMovedMutationType = 'block-moved';
|
|
|
|
/**
|
|
* Information about moved block
|
|
*/
|
|
interface BlockMovedEventDetail extends BlockMutationEventDetail {
|
|
/**
|
|
* Previous block position
|
|
*/
|
|
fromIndex: number;
|
|
|
|
/**
|
|
* New block position
|
|
*/
|
|
toIndex: number;
|
|
}
|
|
|
|
/**
|
|
* Event will be fired when some block is moved to another position
|
|
*/
|
|
export type BlockMovedEvent = CustomEvent<BlockMovedEventDetail>;
|