import Editor from 'tinymce/core/api/Editor'; import { EditorOptions } from 'tinymce/core/api/OptionTypes'; const option: { (name: K): (editor: Editor) => EditorOptions[K]; (name: string): (editor: Editor) => T; } = (name: string) => (editor: Editor) => editor.options.get(name); const register = (editor: Editor): void => { const registerOption = editor.options.register; registerOption('pagebreak_separator', { processor: 'string', default: '' }); registerOption('pagebreak_split_block', { processor: 'boolean', default: false }); }; const getSeparatorHtml = option('pagebreak_separator'); const shouldSplitBlock = option('pagebreak_split_block'); export { register, getSeparatorHtml, shouldSplitBlock };