UNPKG

ngx-tiptap-editor

Version:

[![Build and Publish](https://github.com/HuiiBuh/ngx-tiptap-editor/actions/workflows/publish.yml/badge.svg)](https://github.com/HuiiBuh/ngx-tiptap-editor/actions/workflows/publish.yml) [![Deploy to Github Pages](https://github.com/HuiiBuh/ngx-tiptap-edito

56 lines (55 loc) 1.97 kB
import { Injector, NgZone, Type } from '@angular/core'; import { AnyExtension, Range } from '@tiptap/core'; import { MentionOptions } from '@tiptap/extension-mention'; import { Node as ProseMirrorNode } from 'prosemirror-model'; import { TipDialogService } from '../../../services/dialog.service'; import { AdvancedBaseExtension } from '../../tip-base-extension'; import { MentionFetchFunction, MentionPreviewComponent, MentionPreviewInterface } from './mention-preview.component'; import * as i0 from "@angular/core"; export declare type MentionData = { id: string; label?: string; } | { id: string; label: null; }; declare module '@tiptap/core' { interface Commands<ReturnType> { mention: { setMention: (attributes: { range?: Range | number; props: MentionData; }) => ReturnType; }; } } interface NgxMentionOptions { previewComponent: Type<MentionPreviewInterface>; HTMLAttributes: Record<string, any>; renderLabel: (props: { options: MentionOptions; node: ProseMirrorNode; }) => string; mentionFetchFunction?: MentionFetchFunction; } export declare class NgxMention extends AdvancedBaseExtension<NgxMentionOptions> { protected injector: Injector; private ngZone; private document; private dialogService; private _onClick$; onClick$: import("rxjs").Observable<MentionData>; defaultOptions: { HTMLAttributes: { class: string; }; previewComponent: typeof MentionPreviewComponent; }; constructor(injector: Injector, ngZone: NgZone, document: Document, dialogService: TipDialogService); createExtension(extensionOptions: Required<NgxMentionOptions>): AnyExtension; private extendMention; private configureMention; static ɵfac: i0.ɵɵFactoryDeclaration<NgxMention, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NgxMention>; } export {};