UNPKG

ngx-editor-plus

Version:

WYSIWYG Editor for Angular Applications

105 lines (104 loc) 3.17 kB
import { OnInit, ElementRef, EventEmitter, Renderer2 } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { CommandExecutorService } from './common/services/command-executor.service'; import { MessageService } from './common/services/message.service'; import * as Utils from './common/utils/ngx-editor.utils'; export declare class NgxEditorComponent implements OnInit, ControlValueAccessor { private _elementRef; private _messageService; private _commandExecutor; private _renderer; editable: boolean; spellcheck: boolean; placeholder: string; translate: string; height: string; minHeight: string; width: string; minWidth: string; toolbar: any; resizer: string; config: { editable: boolean; spellcheck: boolean; height: string; minHeight: string; width: string; minWidth: string; translate: string; placeholder: string; toolbar: string[][]; }; showToolbar: boolean; textArea: any; enableToolbar: boolean; Utils: typeof Utils; private lastViewModel; private onChange; private onTouched; blur: EventEmitter<{}>; focus: EventEmitter<{}>; isTouched: boolean; /** * * @param _elementRef api to access dom element * @param _messageService service to send message to the editor message component * @param _commandExecutor executes command from the toolbar * @param _renderer access and manipulate the dom element */ constructor(_elementRef: ElementRef, _messageService: MessageService, _commandExecutor: CommandExecutorService, _renderer: Renderer2); /** * events */ onFocus(): void; onDocumentClick(event: any): void; /** * * @param html html string from contenteditable */ onContentChange(html: string): void; onBlur(): void; /** * resizing text area * * @param offsetY vertical height of the eidtable portion of the editor */ resizeTextArea(offsetY: number): void; /** * editor actions, i.e., executes command from toolbar * * @param commandName name of the command to be executed */ executeCommand(commandName: string): void; /** * Write a new value to the element. * * @param value value to be executed when there is a change in contenteditable */ writeValue(value: any): void; /** * Set the function to be called * when the control receives a change event. * * @param fn a function */ registerOnChange(fn: any): void; /** * Set the function to be called * when the control receives a touch event. * * @param fn a function */ registerOnTouched(fn: any): void; /** * refresh view/HTML of the editor * * @param value html string from the editor */ refreshView(value: string): void; /** * return a json containing input params */ getCollectiveParams(): any; ngOnInit(): void; }