* Replace passed Block with the new one with specified Tool and data * * @param block - block to replace * @param newTool - new Tool name * @param data - new Tool data
(block: Block, newTool: string, data: BlockToolData)
| 378 | * @param data - new Tool data |
| 379 | */ |
| 380 | public replace(block: Block, newTool: string, data: BlockToolData): Block { |
| 381 | const blockIndex = this.getBlockIndex(block); |
| 382 | |
| 383 | return this.insert({ |
| 384 | tool: newTool, |
| 385 | data, |
| 386 | index: blockIndex, |
| 387 | replace: true, |
| 388 | }); |
| 389 | } |
| 390 | |
| 391 | /** |
| 392 | * Insert pasted content. Call onPaste callback after insert. |
no test coverage detected