import { Editor } from '@tiptap/core';
import { default as CxDialog } from '../../../atoms/src/components/dialog/dialog.ts';
import { default as CxPopup } from '../../../atoms/src/components/popup/popup.ts';
import { default as CxSpace } from '../../../atoms/src/components/space/space.ts';
import { default as CxTimecode } from '../../../atoms/src/components/timecode/timecode.ts';
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
import { default as CxMentions } from '../../../molecules/src/mentions/mentions.ts';
import { AutocompleteItem } from '../../../types/src/comment';
import { TimecodeMode } from '../../../types/src/video-editor';
import { TemplateResult } from 'lit';
import { default as CxCommentMenu } from './components/comment-menu/comment-menu';

export type CxCommentChangeEvent = CustomEvent<{
    content: string;
}>;
declare global {
    interface GlobalEventHandlersEventMap {
        'cx-comment-change': CxCommentChangeEvent;
    }
}
/**
 * @summary Widget for comment.
 * @description Replaces Cortex's current SSR comment and allows rich text editing thanks to the migration of Tiptap.
 *
 * @event {{ content: string }} cx-comment-change - Emitted when the editor's content changes.
 * @event cx-recording-started - Emitted when the screen recorder has started.
 * @event cx-recording-stopped - Emitted when the screen recorder has stopped.
 * @event {{ error: Error }} cx-recording-error - Emitted when the screen recorder has error.
 */
export default class CxComment extends CortexElement {
    static readonly styles: import('lit').CSSResult[];
    private readonly localize;
    static readonly dependencies: {
        'cx-comment-menu': typeof CxCommentMenu;
        'cx-dialog': typeof CxDialog;
        'cx-mentions': typeof CxMentions;
        'cx-popup': typeof CxPopup;
        'cx-space': typeof CxSpace;
        'cx-timecode': typeof CxTimecode;
    };
    private readonly cortexPopupController;
    private caretAnimationId?;
    readonly editorContainer: HTMLDivElement;
    readonly commentMenu: CxCommentMenu;
    readonly commentMention: CxMentions;
    readonly overlayContent: HTMLDivElement;
    readonly container: HTMLDivElement;
    readonly dialog: CxDialog;
    content: string;
    editable: boolean;
    autoFocus: boolean;
    canUpload: boolean;
    canUseAIAssistant: boolean;
    recording: boolean;
    queryName: string;
    filterName: string;
    serviceName: string;
    autocompletionViewstate: string;
    maxCount: number;
    queryDelay: number;
    minQueryLength: number;
    isEmpty: boolean;
    originalContainer: Element | null;
    editor: Editor;
    fullscreen: boolean;
    /**
     * Whether the time based button should be shown in the comment menu.
     */
    canUseTimeBased: boolean;
    /**
     * Whether the time based feature is enabled.
     */
    timeBased: boolean;
    /**
     * When true, hides the time based icon button in the comment menu while
     * still allowing the time based feature to function (e.g. `timeBased`
     * state is still respected). Useful when the parent wants to enable the
     * feature without exposing the toggle button to end users.
     */
    hideTimeBasedIcon: boolean;
    /**
     * When true, hides the fullscreen icon button and prevents entering
     * fullscreen. `toggleFullscreen()` becomes a no-op when not already
     * fullscreen, but still allows exiting fullscreen if currently open.
     */
    disableFullscreen: boolean;
    /**
     * The time values for the time based feature.
     */
    time: number[];
    /**
     * The timecode mode for the time based feature.
     */
    timecodeMode: TimecodeMode;
    /**
     * The frame rate for the time based feature.
     */
    frameRate: number;
    /**
     * The placeholder for the comment editor.
     */
    placeholder: string;
    constructor();
    connectedCallback(): void;
    disconnectedCallback(): void;
    private handleOutsideClick;
    private handleCopy;
    private fetchAutocompleteItems;
    getMentionItems(queryString: string): Promise<AutocompleteItem[]>;
    resetMention(): void;
    private handleMenuItemClick;
    private handleFullscreenClick;
    toggleFullscreen(): void;
    private readonly debouncedFetch;
    private fetchItems;
    private handleMentionSelect;
    private handleMentionStart;
    private handleMentionUpdate;
    private handleMentionKeyDown;
    private initEditor;
    runFirstUpdated(): void;
    private handleCommentMousedown;
    handleEditableChange(): void;
    handleTimeChange(): void;
    handlePlaceholderChange(): void;
    handleFullscreenChange(): void;
    private handleRequestClose;
    private handleTimeBasedChange;
    render(): TemplateResult;
}
declare global {
    interface HTMLElementTagNameMap {
        'cx-comment': CxComment;
    }
}
