UNPKG

@atlaskit/editor-plugin-extension

Version:

editor-plugin-extension plugin for @atlaskit/editor-core

38 lines (37 loc) 1.85 kB
import type { PublicPluginAPI } from '@atlaskit/editor-common/types'; import { type JSONDocNode } from '@atlaskit/editor-json-transformer'; import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics'; import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions'; import type { Mark, Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model'; import type { EditorState } from '@atlaskit/editor-prosemirror/state'; import type { ContentNodeWithPos, DomAtPos, NodeWithPos } from '@atlaskit/editor-prosemirror/utils'; export declare const getSelectedExtension: (state: EditorState, searchParent?: boolean) => ContentNodeWithPos | undefined; export declare const findExtensionWithLocalId: (state: EditorState, localId?: string) => NodeWithPos | undefined; export declare const getSelectedDomElement: (schema: Schema, domAtPos: DomAtPos, selectedExtensionNode: NodeWithPos) => HTMLElement; export declare const getDataConsumerMark: (newNode: PMNode) => Mark | undefined; export declare const getNodeTypesReferenced: (ids: string[], state: EditorState) => string[]; export declare const findNodePosWithLocalId: (state: EditorState, localId: string) => NodeWithPos | undefined; export interface Position { bottom?: number; left?: number; right?: number; top?: number; } /** * copying ADF from the unsupported content extension as text to clipboard */ export declare const copyUnsupportedContentToClipboard: ({ locale, schema, unsupportedContent, api, }: { api?: PublicPluginAPI<[ MentionsPlugin ]>; locale?: string; schema: Schema; unsupportedContent?: JSONDocNode; }) => Promise<void>; export declare const onCopyFailed: ({ error, extensionApi, state, }: { error: Error; extensionApi?: PublicPluginAPI<[ AnalyticsPlugin ]>; state: EditorState; }) => void;