editor.js/types/events/block/BlockAdded.ts
ferntheplant 494d6e4b9b
fix: use type imports for block events (#2491)
* fix: use type imports for block events

* add changelog entry

---------

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2023-12-05 19:26:10 +03:00

22 lines
481 B
TypeScript

import type { BlockMutationEventDetail } from './Base';
/**
* Type name of CustomEvent related to block added event
*/
export const BlockAddedMutationType = 'block-added';
/**
* Information about added block
*/
interface BlockAddedEventDetail extends BlockMutationEventDetail {
/**
* Index of added block
*/
index: number;
}
/**
* Event will be fired when the new block is added to the editor
*/
export type BlockAddedEvent = CustomEvent<BlockAddedEventDetail>;