ngx-tiptap
Version:
Angular bindings for tiptap v2
26 lines (25 loc) • 1.13 kB
TypeScript
import { Injector, Type } from '@angular/core';
import { NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
import type { Decoration, DecorationSource } from '@tiptap/pm/view';
import type { Node as ProseMirrorNode } from '@tiptap/pm/model';
import { AngularNodeViewComponent } from './node-view.component';
interface RendererUpdateProps {
oldNode: ProseMirrorNode;
oldDecorations: readonly Decoration[];
oldInnerDecorations: DecorationSource;
newNode: ProseMirrorNode;
newDecorations: readonly Decoration[];
innerDecorations: DecorationSource;
updateProps: () => void;
}
type AttrProps = Record<string, string> | ((props: {
node: ProseMirrorNode;
HTMLAttributes: Record<string, any>;
}) => Record<string, string>);
interface AngularNodeViewRendererOptions extends NodeViewRendererOptions {
update?: ((props: RendererUpdateProps) => boolean) | null;
injector: Injector;
attrs?: AttrProps;
}
export declare const AngularNodeViewRenderer: (ViewComponent: Type<AngularNodeViewComponent>, options: Partial<AngularNodeViewRendererOptions>) => NodeViewRenderer;
export {};