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

52 lines (51 loc) 2.5 kB
import { AfterViewInit, ElementRef, OnDestroy, OnInit, QueryList } from '@angular/core'; import type { Editor } from '@tiptap/core'; import { Subject } from 'rxjs'; import { EditorEvent } from '../../models/types'; import { TiptapEventService } from '../../services/tiptap-event.service'; import { OptionComponent, SelectComponent } from '../select/select.component'; import * as i0 from "@angular/core"; export interface BaseControl { onEditorReady?(editor: Editor): void; onEditorDestroy?(): void; } export declare abstract class BaseControl { private _editor; get editor(): Editor | null; setEditor(editor: Editor): void; } export declare abstract class ExtendedBaseControl extends BaseControl implements OnDestroy { protected destroy$: Subject<boolean>; ngOnDestroy(): void; setEditor(editor: Editor): void; protected isEditable(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration<ExtendedBaseControl, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ExtendedBaseControl, never, never, {}, {}, never>; } export declare abstract class ButtonBaseControl extends ExtendedBaseControl implements OnDestroy, AfterViewInit { protected button: ElementRef<HTMLElement> | undefined; protected abstract eventService: TiptapEventService; protected updateEvent: EditorEvent; ngAfterViewInit(): void; setEditor(editor: Editor): void; protected abstract isActive(...args: any): boolean | Promise<boolean>; protected abstract can(...args: any): boolean | Promise<boolean>; private updateButton; static ɵfac: i0.ɵɵFactoryDeclaration<ButtonBaseControl, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonBaseControl, never, never, {}, {}, never>; } export declare abstract class SelectBaseControl extends ExtendedBaseControl implements OnInit, OnDestroy, AfterViewInit { protected abstract eventService: TiptapEventService; protected abstract canStyleParams: any[]; protected select: SelectComponent; protected options: QueryList<OptionComponent>; ngOnInit(): void; ngAfterViewInit(): void; setEditor(editor: Editor): void; protected abstract canStyle(...args: any[]): boolean | Promise<boolean>; protected abstract currentActive(): any | Promise<any>; private updateSelectValue; private updateDisabledValue; static ɵfac: i0.ɵɵFactoryDeclaration<SelectBaseControl, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<SelectBaseControl, never, never, {}, {}, never>; }