* Returns BlockAPI object by Block id * * @param id - id of block to get
(id: string)
| 99 | * @param id - id of block to get |
| 100 | */ |
| 101 | public getById(id: string): BlockAPIInterface | null { |
| 102 | const block = this.Editor.BlockManager.getBlockById(id); |
| 103 | |
| 104 | if (block === undefined) { |
| 105 | _.logLabeled('There is no block with id `' + id + '`', 'warn'); |
| 106 | |
| 107 | return null; |
| 108 | } |
| 109 | |
| 110 | return new BlockAPI(block); |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Get Block API object by any child html element |