UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

21 lines (20 loc) 1.1 kB
/** @jsx jsx */ import React from 'react'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view'; import type { PMPluginFactoryParams } from '../types'; export type InlineNodeViewComponentProps = { view: EditorView; getPos: () => GetPosReturn; node: PMNode; }; type InlineNodeViewComponent<ExtraComponentProps> = React.ComponentType<React.PropsWithChildren<InlineNodeViewComponentProps & ExtraComponentProps>>; export declare const inlineNodeViewClassname = "inlineNodeView"; type NodeViewProducer = (node: PMNode, view: EditorView, getPos: () => GetPosReturn, decorations: readonly Decoration[]) => NodeView; type GetPosReturn = number | undefined; export declare function getInlineNodeViewProducer<ExtraComponentProps>({ pmPluginFactoryParams, Component, extraComponentProps, }: { pmPluginFactoryParams: PMPluginFactoryParams; Component: InlineNodeViewComponent<ExtraComponentProps>; extraComponentProps?: ExtraComponentProps; }): NodeViewProducer; export {};