import ComponentFactory from '@ckeditor/ckeditor5-ui/src/componentfactory'; import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker'; import { Observable } from '@ckeditor/ckeditor5-utils/src/observablemixin'; import Editor from './editor'; // tslint:disable-next-line:no-empty-interface export default interface EditorUI extends Observable {} /** * A class providing the minimal interface that is required to successfully bootstrap any editor UI. */ export default class EditorUI implements Observable { /** * Creates an instance of the editor UI class. */ constructor(editor: Editor); /** * The editor that the UI belongs to. */ readonly editor: Editor; /** * An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins * to register factories of specific UI components. */ readonly componentFactory: ComponentFactory; /** * Stores the information about the editor UI focus and propagates it so various plugins and components * are unified as a focus group. */ readonly focusTracker: FocusTracker; /** * Stores viewport offsets from every direction. * * Viewport offset can be used to constrain balloons or other UI elements into an element smaller than the viewport. * This can be useful if there are any other absolutely positioned elements that may interfere with editor UI. * * Example `editor.ui.viewportOffset` returns: * * ```js * { * top: 50, * right: 50, * bottom: 50, * left: 50 * } * ``` * * This property can be overriden after editor already being initialized: * * ```js * editor.ui.viewportOffset = { * top: 100, * right: 0, * bottom: 0, * left: 0 * }; * ``` */ get viewportOffset(): { top: number; right: number; bottom: number; left: number }; protected set viewportOffset(value: { top: number; right: number; bottom: number; left: number }); /** * The main (outermost) DOM element of the editor UI. * * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `