/// <reference types="ckeditor4" />
import { NumberInput } from '@angular/cdk/coercion';
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { Destroy } from '@deja-js/component/core';
import { Subscription } from 'rxjs';
import { DejaEditorService } from './deja-editor.service';
import * as i0 from "@angular/core";
/**
 * CKEditor component
 * Usage :
 *  <ckeditor [(ngModel)]="data" [config]="{...}" debounce="500"></ckeditor>
 */
export declare class DejaEditorComponent extends Destroy implements OnChanges, OnInit, AfterViewInit, OnDestroy, ControlValueAccessor {
    private zone;
    private changeDetectorRef;
    private initializer;
    config: CKEDITOR.config;
    readonly change: EventEmitter<any>;
    readonly ready: EventEmitter<any>;
    readonly blur: EventEmitter<any>;
    readonly focus: EventEmitter<any>;
    readonly disabled: EventEmitter<boolean>;
    host: ElementRef<HTMLTextAreaElement>;
    instance: CKEDITOR.editor;
    debounceTimeout$sub: Subscription;
    private _readonly;
    private _debounce;
    private _inline;
    private onDataChangeListener;
    private focus$;
    private disabled$;
    private onCkeditorChange$;
    private writeValue$;
    private _value;
    private isDestroyed;
    private registeredListeners;
    set readonly(value: boolean);
    get readonly(): boolean;
    set inline(value: boolean);
    get inline(): boolean;
    set debounce(debounce: NumberInput);
    /**
     * Constructor
     */
    constructor(zone: NgZone, changeDetectorRef: ChangeDetectorRef, initializer: DejaEditorService);
    get value(): string;
    set value(v: string);
    ngOnChanges(changes: SimpleChanges): void;
    ngOnInit(): void;
    /**
     * On component destroy
     */
    ngOnDestroy(): void;
    /**
     * On component view init
     */
    ngAfterViewInit(): void;
    /**
     * Value update process
     */
    updateValue(): void;
    textAreaChange(): void;
    /**
     * CKEditor init
     */
    ckeditorInit(config: CKEDITOR.config): void;
    /**
     * Implements ControlValueAccessor
     */
    writeValue(value: string): void;
    onChange(_x: unknown): void;
    onTouched(): void;
    registerOnChange(fn: (_a: unknown) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    /**
     * Return the word at cursor position.
     *  - If the cursor is at the end of a word, it return that word.
     *  - If the cursor is at the begining of a word, it return that word.
     *  - If the cursor is in the middle of a word, it return that word.
     *  - If there are no word nearly the cursor, return null
     */
    getWordAtCursor(): string;
    hasActiveSelection(): boolean;
    getSelectedText(): string;
    /**
     * Replace the content of the editor.
     *  - If there is an active selection, replace this selection
     *  - If the editor is empty, simply insert the text
     *  - If the cursor is near a word, replace this word with the text
     *  - If there is no selection, no word near the cursor, simply insert the text at the cursor position
     * @param replace the string to replace with
     */
    replace(replace: string): void;
    setFocus(): void;
    private registerChangeListener;
    private hasTextNodeAsChild;
    private mergeTextNodeAroundWithDirection;
    private mergeTextNodeAround;
    private firstNonEmptyTextNode;
    private trim;
    private extractFirstWord;
    private firstTextNodeResult;
    private firstTextNodeWithDirection;
    private firstTextNode;
    private replaceWord;
    private updateCkeditorInstanceValue;
    private listenEvent;
    private cleanListeners;
    static ɵfac: i0.ɵɵFactoryDeclaration<DejaEditorComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DejaEditorComponent, "deja-editor", never, { "config": "config"; "readonly": "readonly"; "inline": "inline"; "debounce": "debounce"; "value": "value"; }, { "change": "change"; "ready": "ready"; "blur": "blur"; "focus": "focus"; "disabled": "disabled"; }, never, never, false>;
}
