ngx-tiptap-editor
Version:
[](https://github.com/HuiiBuh/ngx-tiptap-editor/actions/workflows/publish.yml) [ • 1.97 kB
TypeScript
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 {};