1

I'd like to be able to extend native blots as seen in cloning medium w/ parchment. I am using angular2 with typescript, and typescript does not believe that BlockEmbed is a real constructor.

Using the following code (pretty much directly from above tutorial): let BlockEmbed = Quill.import('blots/block/embed');

class DividerBlot extends BlockEmbed { }
DividerBlot.blotName = 'divider';
DividerBlot.tagName = 'hr';
pixelpax
  • 1,435
  • 13
  • 22

1 Answers1

0

Something like this has worked for me:

const BlockEmbed = Quill.import('blots/block/embed') as { new (node, value): Object };
export class DividerBlot extends BlockEmbed {
    static blotName = 'divider';
    static tagName = 'hr';
}
brianc
  • 1,547
  • 3
  • 16
  • 30