import { HttpEvent, HttpResponse } from "@angular/common/http"; import { Observable } from "rxjs"; import * as i0 from "@angular/core"; import { AfterViewInit, ElementRef, EventEmitter, InjectionToken, OnDestroy, OnInit, Provider, TemplateRef } from "@angular/core"; import * as i7 from "@angular/forms"; import { ControlValueAccessor } from "@angular/forms"; import * as i6 from "@angular/common"; type AeSanitizeFn = (html: string) => string; export declare const AE_SANITIZER: InjectionToken; export declare function provideEditorSanitizer(sanitizeFn: AeSanitizeFn): Provider; /** * Custom class configuration for applying styles to selected content. * * @example * // Basic usage (inline span) * { name: 'Red Text', class: 'text-red' } * * // Block-level class (applies to each paragraph) * { name: 'Highlight', class: 'highlight', mode: 'block' } * * // Auto mode (smart detection) * { name: 'Quote', class: 'quote', mode: 'auto', tag: 'div' } */ interface CustomClass { /** Display name shown in dropdown */ name: string; /** CSS class to apply */ class: string; /** HTML tag to use for wrapping (default: 'span') */ tag?: string; /** * Application mode: * - 'inline': Always wrap selection in a single element (legacy behavior) * - 'block': Apply class to each block element in selection * - 'auto': Smart detection - inline for single block, block for multiple (default) */ mode?: 'inline' | 'block' | 'auto'; } interface Font { name: string; class: string; } interface EditorFormattingState { bold: boolean; italic: boolean; underline: boolean; strikeThrough: boolean; subscript: boolean; superscript: boolean; justifyLeft: boolean; justifyCenter: boolean; justifyRight: boolean; justifyFull: boolean; insertUnorderedList: boolean; insertOrderedList: boolean; indent: boolean; link: boolean; block: string; fontName: string; fontSize: string; foreColor: string; backColor: string; linkSelected: boolean; customClassId: string; } export declare const DEFAULT_FORMATTING_STATE: EditorFormattingState; export declare const TOGGLE_COMMANDS: readonly ["bold", "italic", "underline", "strikeThrough", "subscript", "superscript", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull", "insertUnorderedList", "insertOrderedList"]; export declare const BLOCK_TAGS: string[]; interface AngularEditorConfig { editable?: boolean; spellcheck?: boolean; height?: 'auto' | string; minHeight?: '0' | string; maxHeight?: 'auto' | string; width?: 'auto' | string; minWidth?: '0' | string; translate?: 'yes' | 'now' | string; enableToolbar?: boolean; showToolbar?: boolean; placeholder?: string; defaultParagraphSeparator?: string; defaultFontName?: string; defaultFontSize?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | string; uploadUrl?: string; upload?: (file: File) => Observable>; uploadWithCredentials?: boolean; fonts?: Font[]; customClasses?: CustomClass[]; sanitize?: boolean; toolbarPosition?: 'top' | 'bottom'; outline?: boolean; toolbarHiddenButtons?: string[][]; rawPaste?: boolean; textDirection?: 'ltr' | 'rtl' | 'auto'; outputFormat?: 'html' | 'markdown'; pasteMarkdown?: boolean; } interface MarkdownConverter { toMarkdown(html: string): string; toHtml(markdown: string): string; } export declare const AE_MARKDOWN_CONVERTER: InjectionToken; declare const angularEditorConfig: AngularEditorConfig; export interface UploadResponse { imageUrl: string; } export declare class AngularEditorService { savedSelection: Range | null; selectedText: string; uploadUrl: string; uploadWithCredentials: boolean; private readonly _formattingState; readonly formattingState: import("@angular/core").Signal; readonly isBold: import("@angular/core").Signal; readonly isItalic: import("@angular/core").Signal; readonly isUnderline: import("@angular/core").Signal; readonly isStrikeThrough: import("@angular/core").Signal; readonly isSubscript: import("@angular/core").Signal; readonly isSuperscript: import("@angular/core").Signal; readonly isJustifyLeft: import("@angular/core").Signal; readonly isJustifyCenter: import("@angular/core").Signal; readonly isJustifyRight: import("@angular/core").Signal; readonly isJustifyFull: import("@angular/core").Signal; readonly isUnorderedList: import("@angular/core").Signal; readonly isOrderedList: import("@angular/core").Signal; readonly isIndent: import("@angular/core").Signal; readonly isLink: import("@angular/core").Signal; readonly currentBlock: import("@angular/core").Signal; readonly currentFontName: import("@angular/core").Signal; readonly currentFontSize: import("@angular/core").Signal; readonly currentForeColor: import("@angular/core").Signal; readonly currentBackColor: import("@angular/core").Signal; readonly isLinkSelected: import("@angular/core").Signal; readonly currentCustomClassId: import("@angular/core").Signal; private http; private doc; /** * Executed command from editor header buttons exclude toggleEditorMode * @param command string from triggerCommand * @param value */ executeCommand(command: string, value?: string): void; /** * Create URL link * @param url string from UI prompt */ createLink(url: string): void; /** * insert color either font or background * * @param color color to be inserted * @param where where the color has to be inserted either text/background */ insertColor(color: string, where: string): void; /** * Set font name * @param fontName string */ setFontName(fontName: string): void; /** * Set font size * @param fontSize string */ setFontSize(fontSize: string): void; /** * Create raw HTML * @param html HTML string */ insertHtml(html: string): void; /** * save selection when the editor is focussed out */ saveSelection: () => void; /** * restore selection when the editor is focused in * * saved selection when the editor is focused out */ restoreSelection(): boolean; /** * setTimeout used for execute 'saveSelection' method in next event loop iteration */ executeInNextQueueIteration(callbackFn: (...args: unknown[]) => unknown, timeout?: number): void; /** check any selection is made or not */ private checkSelection; /** * Upload file to uploadUrl * @param file The file */ uploadImage(file: File): Observable>; /** * Insert image with Url * @param imageUrl The imageUrl. */ insertImage(imageUrl: string): void; setDefaultParagraphSeparator(separator: string): void; setInitialState(overrides: Partial): void; detectFormattingState(ancestorNodes: Node[], customClasses?: CustomClass[]): void; /** * Apply custom class to selection with enterprise-level HTML structure preservation. * Supports three modes: * - 'inline': Wrap selection in a single element (legacy behavior) * - 'block': Apply class to each block element in selection * - 'auto': Smart detection based on selection span (default) * * @param customClass The custom class configuration */ createCustomClass(customClass: CustomClass): void; /** * Apply class inline by wrapping selection in a single element. * Uses extractContents + insertNode pattern for safety. */ private applyClassInline; /** * Fallback method for inline class application (legacy behavior). */ private applyClassInlineFallback; /** * Apply class to each block element in selection. * Preserves HTML structure by adding class to existing elements. */ private applyClassToBlocks; /** * Get all block-level elements within a range. * Returns elements that are fully or partially selected. */ private getBlockElementsInRange; /** * Check if a node is fully contained within a range. */ private isNodeFullyInRange; /** * Check if element has an ancestor in the given set. */ private hasAncestorInSet; insertVideo(videoUrl: string): void; private insertYouTubeVideoTag; private insertVimeoVideoTag; nextNode(node: any): any; getRangeSelectedNodes(range: any, includePartiallySelectedContainers: boolean): any[]; getSelectedNodes(): any[]; replaceWithOwnChildren(el: any): void; removeSelectedElements(tagNames: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare namespace ae_select_component_d_exports { export { AeSelectComponent, SelectOption }; } export interface SelectOption { label: string; value: string; } export declare class AeSelectComponent implements OnInit, ControlValueAccessor { options: SelectOption[]; isHidden: boolean; selectedOption: SelectOption; disabled: boolean; optionId: number; get label(): string; opened: boolean; get value(): string; hidden: string; changeEvent: EventEmitter; labelButton: ElementRef; private elRef; private r; ngOnInit(): void; hide(): void; optionSelect(option: SelectOption, event: MouseEvent): void; toggleOpen(event: MouseEvent): void; onClick($event: MouseEvent): void; close(): void; get isOpen(): boolean; writeValue(value: any): void; setValue(value: any): void; onChange: any; onTouched: any; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; handleKeyDown($event: KeyboardEvent): void; _handleArrowDown($event: any): void; _handleArrowUp($event: any): void; _handleSpace($event: any): void; _handleEnter($event: any): void; _handleTab($event: any): void; _handleBackspace(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare namespace ae_toolbar_component_d_exports { export { AeToolbarComponent }; } export declare class AeToolbarComponent { htmlMode: boolean; headings: SelectOption[]; fontSizes: SelectOption[]; _customClasses: CustomClass[]; customClassList: SelectOption[]; id: string; uploadUrl: string; upload: (file: File) => Observable>; showToolbar: boolean; fonts: SelectOption[]; set customClasses(classes: CustomClass[]); set defaultFontName(value: string); set defaultFontSize(value: string); hiddenButtons: string[][]; execute: EventEmitter; myInputFile: ElementRef; get isLinkButtonDisabled(): boolean; protected editorService: AngularEditorService; triggerCommand(command: string): void; setEditorMode(m: boolean): void; insertUrl(): void; insertVideo(): void; insertColor(color: string, where: string): void; setFontName(fontName: string): void; setFontSize(fontSize: string): void; onFileChanged(event: any): void; watchUploadImage(response: HttpResponse<{ imageUrl: string; }>, event: any): void; setCustomClass(classId: string): void; isButtonHidden(name: string): boolean; focus(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare namespace angular_editor_component_d_exports { export { AngularEditorComponent }; } export declare class AngularEditorComponent implements OnInit, ControlValueAccessor, AfterViewInit, OnDestroy { private autoFocus; private onChange; private onTouched; modeVisual: boolean; showPlaceholder: boolean; disabled: boolean; focused: boolean; touched: boolean; changed: boolean; focusInstance: any; blurInstance: any; id: string; config: AngularEditorConfig; private pendingValue; private viewInitialized; placeholder: string; tabIndex: number | null; html: EventEmitter; textArea: ElementRef; editorWrapper: ElementRef; editorToolbar: AeToolbarComponent; customButtonsTemplateRef?: TemplateRef; executeCommandFn: (command: string, value?: string) => void; viewMode: EventEmitter; /** emits `blur` event when focused out from the textarea */ blurEvent: EventEmitter; /** emits `focus` event when focused in to the textarea */ focusEvent: EventEmitter; tabindex: number; onFocus(): void; private r; private editorService; private doc; private sanitizeFn; private markdownConverter; private cdRef; contentChanged: EventEmitter<{ html: string; markdown?: string; text: string; }>; private get isMarkdownOutput(); private sanitizeHtml; getHtml(): string; getMarkdown(): string; constructor(defaultTabIndex: string, autoFocus: any); ngOnInit(): void; ngAfterViewInit(): void; onPaste(event: ClipboardEvent): string | undefined; /** * Executed command from editor header buttons * @param command string from triggerCommand * @param value */ executeCommand(command: string, value?: string): void; /** * focus event */ onTextAreaFocus(event: FocusEvent): void; /** * @description fires when cursor leaves textarea */ onTextAreaMouseOut(event: MouseEvent): void; /** * blur event */ onTextAreaBlur(event: FocusEvent): void; /** * focus the text area when the editor is focused */ focus(): void; /** * Executed from the contenteditable section while the input property changes * @param element html element from contenteditable */ onContentChange(element: HTMLElement): 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; /** * Write a new value to the element. * * @param value value to be executed when there is a change in contenteditable */ writeValue(value: any): void; private applyValue; /** * refresh view/HTML of the editor * * @param value html string from the editor */ refreshView(value: string): void; /** * toggles placeholder based on input string * * @param value A HTML string from the editor */ togglePlaceholder(value: boolean): void; /** * Implements disabled state for this element * * @param isDisabled Disabled flag */ setDisabledState(isDisabled: boolean): void; /** * toggles editor mode based on bToSource bool * * @param bToSource A boolean value from the editor */ toggleEditorMode(bToSource: boolean): void; /** * toggles editor buttons when cursor moved or positioning * * Send a node array from the contentEditable of the editor */ exec(): void; private configure; getFonts(): { label: string; value: string; }[]; getCustomTags(): string; ngOnDestroy(): void; filterStyles(html: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare namespace ae_button_component_d_exports { export { AeButtonComponent }; } export declare class AeButtonComponent { iconName: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare namespace ae_toolbar_set_component_d_exports { export { AeToolbarSetComponent }; } export declare class AeToolbarSetComponent { constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class AngularEditorModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export type { AeSanitizeFn, AngularEditorConfig, CustomClass, EditorFormattingState, MarkdownConverter };