import { Node } from 'prosemirror-model'; import { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue } from '@atlaskit/editor-common/types'; import { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent'; import type { ResolvedEditorState } from '@atlaskit/collab-provider'; import type { FeatureFlags, Transformer } from '@atlaskit/editor-common/types'; import { EditorView } from 'prosemirror-view'; import { EventDispatcher } from '../event-dispatcher'; export default class EditorActions implements EditorActionsOptions { private editorView?; private contentTransformer?; private contentEncode?; private eventDispatcher?; private listeners; static from(view: EditorView, eventDispatcher: EventDispatcher, transformer?: Transformer): EditorActions; _privateGetEditorView(): EditorView | undefined; _privateGetEventDispatcher(): EventDispatcher | undefined; private getFeatureFlags; _privateRegisterEditor(editorView: EditorView, eventDispatcher: EventDispatcher, contentTransformer?: Transformer, getFeatureFlags?: () => FeatureFlags): void; _privateUnregisterEditor(): void; _privateSubscribe(cb: ContextUpdateHandler): void; _privateUnsubscribe(cb: ContextUpdateHandler): void; focus(): boolean; blur(): boolean; clear(): boolean; __temporaryFixForConfigPanel(): Promise; getValue(): Promise; getNodeByLocalId(id: string): Node | undefined; getNodeByFragmentLocalId(id: string): Node | undefined; /** * This method will return the currently selected `Node` if the selection is a `Node`. * Otherwise, if the selection is textual or a non-selectable `Node` within another selectable `Node`, the closest selectable parent `Node` will be returned. */ getSelectedNode(): Node | undefined; isDocumentEmpty(): boolean; replaceDocument(rawValue: any, shouldScrollToBottom?: boolean, /** @deprecated [ED-14158] shouldAddToHistory is not being used in this function */ shouldAddToHistory?: boolean): boolean; replaceSelection(rawValue: ReplaceRawValue | Array, tryToReplace?: boolean): boolean; appendText(text: string): boolean; dispatchAnalyticsEvent: (payload: AnalyticsEventPayload) => void; /** * If editor is using new collab service, * we want editor to call the collab provider to * retrieve the final acknowledged state of the * editor. The final acknowledged editor state * refers to the latest state of editor with confirmed * steps. */ getResolvedEditorState: () => Promise; }