import { BaseElement, BaseText, Descendant, Point, Range } from 'slate';
import type { IListMemberData, IMentions, IDiscussionFormFns } from '../../../discussion/shared';
import type { MemberDetailsProps } from '../../../user';
import type { IEnrichedUrlData } from '../../../navigation';
interface IRTEData {
    /** Optional mentions */
    mentions?: IMentions;
    /** Optional data about the first link, to be displayed in the EnrichedUrl component */
    link?: IEnrichedUrlData | false | undefined;
}
interface IRTEFunctions extends IDiscussionFormFns {
    /** An optional event handler, called when the rich text editor is changed */
    onChange?: (value: string, data?: false | IEnrichedUrlData) => void;
    /** An optional event handler, called when the data in the rich text editor is changed. This is used to keep data state up-to-date, when the onChange isn't likely to have been called, e.g. when a link preview resolves */
    onChangeData?: (data: IRTEData) => void;
    /** An optional function to call when a mention is inserted */
    onMention?: (value?: IListMemberData) => void;
    /** An optional event handler, called when the rich text editor reports an error */
    reportError?: ReportError;
}
export interface IRTEProps {
    /** The id of the rich text editor */
    id?: string;
    /** The default value of the rich text editor */
    value?: string;
    /** The placeholder text of the rich text editor */
    placeholder?: string;
    /** The maximum length of the rich text editor */
    maxLength?: number;
    /** Information about the rich text editor */
    meta?: {
        /** Whether the rich text editor is inside a modal */
        isInOverlay?: false | 'string';
    };
    /** Optional functions */
    functions?: IRTEFunctions;
    /** Optional autoFocus */
    autoFocus?: boolean;
    /** Optional aria invalid */
    'aria-invalid'?: boolean;
    /**  Optional aria error message */
    'aria-errormessage'?: string;
    /** Optional data for the editor */
    data?: IRTEData;
    /** Optional styling */
    styling?: {
        /** Optional toolbar styling */
        toolbar?: {
            showHeadingOption?: boolean;
        };
    };
}
export interface IRTEInitialState {
    editorKey: string | null;
    originalValue: string | null;
    initialValue: Descendant[] | null;
    showLinkEditor: boolean;
    mentionPopover: IMentionPopOver;
    lastAnchor: Point | null;
    stringValue: string;
    lastKey: string | null;
    hasInteracted: boolean;
    hasLoaded: boolean;
    enrichedUrl: IEnrichedUrlData | false | undefined;
}
export interface IToolbarInitialState {
    tabbableOption: string;
    openTooltip: string | null;
}
export interface IToolbarReducer {
    type: keyof IToolbarInitialState;
    value: any;
}
export interface IRTEReducer {
    type: keyof IRTEInitialState;
    value: any;
}
export declare enum Formatting {
    blockquote = "block_quote",
    bold = "bold",
    code = "code",
    codeblock = "code_block",
    heading = "heading",
    hr = "thematic_break",
    image = "image",
    italic = "italic",
    li = "list_item",
    link = "link",
    mention = "mention",
    ol = "ol_list",
    paragraph = "paragraph",
    ul = "ul_list",
    strikethrough = "strikeThrough",
    span = "span",
    h3 = "heading_three"
}
export declare enum Marks {
    delete = "delete_mark",
    emphasis = "emphasis_mark",
    code = "inline_code_mark",
    strong = "strong_mark"
}
export interface BaseProps {
    className?: string;
    styling?: {
        showHeadingOption?: boolean;
    };
    [key: string]: unknown;
}
export type BlockOptionType = Formatting.blockquote | Formatting.link | Formatting.li | Formatting.mention | Formatting.ol | Formatting.ul | Formatting.paragraph | Formatting.span;
export interface TypeElement extends BaseElement {
    type: BlockOptionType | MarkOptionType;
    [Formatting.h3]?: boolean;
}
export interface MentionElement extends BaseElement {
    type: Formatting.mention;
    id: string;
    name?: string;
}
export type MarkOptionType = Formatting.bold | Formatting.italic | Formatting.strikethrough | Formatting.h3;
export interface TypeText extends BaseText {
    [Formatting.bold]?: boolean;
    [Formatting.italic]?: boolean;
    [Formatting.strikethrough]?: boolean;
    [Formatting.h3]?: boolean;
}
export type OptionTypes = {
    format: BlockOptionType | MarkOptionType;
    hasDivider?: boolean;
};
export type LinkElement = {
    type: Formatting.link;
    link: string;
    children: Descendant[];
};
export type ReportError = (error: string) => void;
export interface IMention {
    id: string;
    creator?: boolean;
    role?: string;
    createdAt?: string;
    updatedAt?: string;
    userId?: string;
    user: MemberDetailsProps;
}
export type ListMembers = ({ id, name }: IListMemberData) => Promise<IMention[]>;
export type ClickMentionFallback = () => void;
export interface IMentionPopOver {
    show: boolean;
    selectedUser: number;
    possibleUsers: IMention[];
    position: Range | null;
    numberOfUsers: number | null;
}
export {};
