import * as _angular_core from '@angular/core'; import { InjectionToken, Signal, WritableSignal, OnInit, OnDestroy, ElementRef, ViewContainerRef, TemplateRef } from '@angular/core'; import * as lexical from 'lexical'; import { LexicalEditor, Klass, LexicalNode, LexicalNodeReplacement, NodeKey, EditorConfig, DOMExportOutput, DecoratorNode, DOMConversionMap, Spread, SerializedLexicalNode, LexicalUpdateJSON, TextFormatType } from 'lexical'; import { ControlValueAccessor, FormControl } from '@angular/forms'; import { LuSimpleSelectInputComponent } from '@lucca-front/ng/simple-select'; import { LinkNode, LinkAttributes, SerializedLinkNode, AutoLinkNode, SerializedAutoLinkNode } from '@lexical/link'; import { LuccaIcon } from '@lucca-front/icons'; type UnregisterFn = () => void; declare abstract class RichTextFormatter { /** Register the rich-text or plain-text Lexical plugin */ abstract registerTextPlugin(editor: LexicalEditor): UnregisterFn; abstract parse(editor: LexicalEditor, text?: string | null): void; abstract format(editor: LexicalEditor): string; } declare const RICH_TEXT_FORMATTER: InjectionToken; interface ILuRichTextInputLabel { clearFormat: string; linksCancel: string; linksDelete: string; linksHref: string; linksLabel: string; linksSubmit: string; linksPlaceholder: string; listsNumberedLabel: string; listsBulletLabel: string; headingsLabel: string; headings0: string; headings1: string; headings2: string; headings3: string; headings4: string; headings5: string; headings6: string; stylesItalic: string; stylesBold: string; stylesUnderline: string; stylesStrikethrough: string; insertTag: string; } declare const INITIAL_UPDATE_TAG = "initial-update"; declare const SKIP_DOM_SELECTION_TAG = "skip-dom-selection"; interface RichTextPluginComponent { setEditorInstance(editor: LexicalEditor): void; getLexicalNodes?(): (Klass | LexicalNodeReplacement)[]; setDisabledState(isDisabled: boolean): void; pluginComponents?: Signal; tabindex?: WritableSignal; focus?(): void; } declare const RICH_TEXT_PLUGIN_COMPONENT: InjectionToken; declare class RichTextInputComponent implements OnInit, OnDestroy, ControlValueAccessor { #private; readonly placeholder: _angular_core.InputSignal; readonly disableSpellcheck: _angular_core.InputSignalWithTransform; readonly autoResize: _angular_core.InputSignalWithTransform; readonly hideToolbar: _angular_core.InputSignalWithTransform; readonly content: Signal>; readonly contentPresentation: Signal>; readonly pluginComponents: Signal; readonly currentCanShowPlaceholder: WritableSignal; readonly isDisabled: WritableSignal; readonly formFieldId: Signal; constructor(); ngOnInit(): void; ngOnDestroy(): void; writeValue(value: string | null): void; registerOnChange(onChange: (markdown: string | null) => void): void; registerOnTouched(onTouch: () => void): void; setDisabledState(isDisabled: boolean): void; focusSiblingPlugin(event: Event, direction: -1 | 1): void; focus(): void; touch(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ClearFormatComponent implements RichTextPluginComponent, OnDestroy { #private; readonly intl: _angular_core.InputSignalWithTransform>; readonly element: _angular_core.Signal>; readonly tabindex: _angular_core.WritableSignal; readonly isDisabled: _angular_core.WritableSignal; setEditorInstance(editor: LexicalEditor): void; ngOnDestroy(): void; dispatchCommand(): void; setDisabledState(isDisabled: boolean): void; focus(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class HeadingsComponent implements OnDestroy, RichTextPluginComponent { #private; readonly element: _angular_core.Signal>; readonly tabindex: _angular_core.WritableSignal; readonly maxHeadingLevel: _angular_core.InputSignal<1 | 2 | 3 | 4 | 5 | 6>; readonly headingOptions: _angular_core.Signal<("h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "paragraph")[]>; readonly intl: _angular_core.InputSignalWithTransform>; readonly headingLabels: _angular_core.Signal>; readonly formControl: FormControl<"h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "paragraph">; setEditorInstance(editor: LexicalEditor): void; getLexicalNodes(): Klass[]; ngOnDestroy(): void; focus(): void; setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } interface LinkTemplateContext { href: string; title?: string | null; target?: string | null; isAutoLink: boolean; } declare class PopoverLinkNode extends LinkNode { #private; setViewContainerRef(vcr: ViewContainerRef): this; getViewContainerRef(): ViewContainerRef | undefined; setTemplateRef(templateRef: TemplateRef): this; getTemplateRef(): TemplateRef | undefined; static getType(): string; constructor(url?: string, attributes?: LinkAttributes & { viewContainerRef?: ViewContainerRef; templateRef?: TemplateRef; }, key?: NodeKey); createDOM(config: EditorConfig): HTMLElement; updateDOM(prevNode: this): boolean; exportDOM(editor: LexicalEditor): DOMExportOutput; remove(preserveEmptyParent?: boolean): void; static importJSON(serializedNode: SerializedLinkNode): PopoverLinkNode; static clone(node: PopoverLinkNode): PopoverLinkNode; } declare class PopoverAutoLinkNode extends AutoLinkNode { #private; setViewContainerRef(vcr: ViewContainerRef): this; getViewContainerRef(): ViewContainerRef | undefined; setTemplateRef(templateRef: TemplateRef): this; getTemplateRef(): TemplateRef | undefined; static getType(): string; constructor(url?: string, attributes?: LinkAttributes & { viewContainerRef?: ViewContainerRef; templateRef?: TemplateRef; }, key?: NodeKey); createDOM(config: EditorConfig): HTMLElement; updateDOM(prevNode: this): boolean; exportDOM(editor: LexicalEditor): DOMExportOutput; remove(preserveEmptyParent?: boolean): void; static importJSON(serializedNode: SerializedAutoLinkNode): PopoverAutoLinkNode; static clone(node: PopoverAutoLinkNode): PopoverAutoLinkNode; } declare class LinkComponent implements OnDestroy, RichTextPluginComponent { #private; readonly linkNodeTemplate: _angular_core.Signal>; readonly element: _angular_core.Signal>; readonly tabindex: _angular_core.WritableSignal; readonly active: _angular_core.WritableSignal; readonly isDisabled: _angular_core.WritableSignal; readonly intl: _angular_core.InputSignalWithTransform>; setEditorInstance(editor: LexicalEditor): void; getLexicalNodes(): (typeof PopoverLinkNode | typeof PopoverAutoLinkNode | { replace: typeof LinkNode; with: (node: LinkNode) => PopoverLinkNode; withKlass: typeof PopoverLinkNode; } | { replace: typeof AutoLinkNode; with: (node: AutoLinkNode) => PopoverAutoLinkNode; withKlass: typeof PopoverAutoLinkNode; })[]; ngOnDestroy(): void; dispatchCommand(): void; deleteLink(): void; focus(): void; setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class ListStyleToolbarComponent implements OnDestroy, RichTextPluginComponent { #private; pluginComponents: _angular_core.Signal; intl: _angular_core.InputSignalWithTransform>; setEditorInstance(editor: LexicalEditor): void; getLexicalNodes?(): Klass[]; setDisabledState(isDisabled: boolean): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } type Tag = { key: string; description?: string; }; declare class RichTextPluginTagComponent implements RichTextPluginComponent, OnDestroy { #private; readonly intl: _angular_core.InputSignalWithTransform>; readonly tags: _angular_core.InputSignal; readonly isDisabled: _angular_core.WritableSignal; readonly focusIndex: _angular_core.WritableSignal; readonly focusableElements: _angular_core.Signal[]>; editor: LexicalEditor | null; constructor(); setEditorInstance(editor: LexicalEditor): void; getLexicalNodes(): Klass[]; insertTag(tag: Tag): void; setDisabledState(isDisabled: boolean): void; focus(): void; focusTag(event: Event, direction: -1 | 1): void; ngOnDestroy(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } type SerializedTagNode = Spread<{ tagKey?: string; tagDescription?: string; disabled?: boolean; }, SerializedLexicalNode>; declare class TagNode extends DecoratorNode { #private; setViewContainerRef(vcr: ViewContainerRef): this; getViewContainerRef(): ViewContainerRef; constructor(tagKey?: string, viewContainerRef?: ViewContainerRef, tagDescription?: string, disabled?: boolean, key?: NodeKey); isDisabled(): boolean; setDisabled(disabled: boolean): this; getTagKey(): string; setTagKey(tagKey: string): this; getTagDescription(): string; setTagDescription(description: string): this; static getType(): string; static clone(node: TagNode): TagNode; /** * This method must be implemented but has no purpose outside of react */ decorate(): string; createDOM(_config: EditorConfig, editor: LexicalEditor): HTMLElement; updateDOM(prevNode: TagNode, _dom: HTMLElement, _config: EditorConfig): boolean; remove(preserveEmptyParent?: boolean): void; exportDOM(): DOMExportOutput; static importDOM(): DOMConversionMap; static importJSON(serializedNode: SerializedTagNode): TagNode; updateFromJSON(serializedNode: LexicalUpdateJSON): this; exportJSON(): SerializedTagNode; getTextContent(): string; } declare function $createTagNode(key?: string, viewContainerRef?: ViewContainerRef, description?: string): TagNode; declare function $isTagNode(node: LexicalNode | null | undefined): node is TagNode; declare class TextStyleComponent implements OnDestroy, RichTextPluginComponent { #private; format: _angular_core.InputSignal; icon: _angular_core.InputSignal; tooltip: _angular_core.InputSignal; tabindex: _angular_core.WritableSignal; active: _angular_core.WritableSignal; isDisabled: _angular_core.WritableSignal; element: _angular_core.Signal>; setEditorInstance(editor: LexicalEditor): void; ngOnDestroy(): void; dispatchCommand(): void; setDisabledState(isDisabled: boolean): void; focus(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class TextStyleToolbarComponent implements RichTextPluginComponent { pluginComponents: _angular_core.Signal; intl: _angular_core.InputSignalWithTransform>; setEditorInstance(editor: LexicalEditor): void; setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare class RichTextInputToolbarComponent implements RichTextPluginComponent { pluginComponents: _angular_core.Signal; setEditorInstance(editor: LexicalEditor): void; getLexicalNodes(): (lexical.KlassConstructor | lexical.LexicalNodeReplacement)[]; setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { $createTagNode, $isTagNode, ClearFormatComponent, HeadingsComponent, INITIAL_UPDATE_TAG, LinkComponent, ListStyleToolbarComponent, RICH_TEXT_FORMATTER, RICH_TEXT_PLUGIN_COMPONENT, RichTextFormatter, RichTextInputComponent, RichTextInputToolbarComponent, RichTextPluginTagComponent, SKIP_DOM_SELECTION_TAG, TagNode, TextStyleComponent, TextStyleToolbarComponent }; export type { RichTextPluginComponent, SerializedTagNode, Tag };