import { EditorV3Style, EditorV3TextBlock, EditorV3Align, IEditorV3, EditorV3Styles } from "@asup/editor-v3";
import React from "react";
import { DraftComponent } from "draft-js";
export interface AibBlockLine<T extends string | object> {
    aifid?: string;
    lineType: AibLineType;
    left?: T | null;
    center?: T | null;
    right?: T | null;
    addBelow?: boolean;
    canEdit?: boolean;
    canRemove?: boolean;
    canMove?: boolean;
    canChangeType?: boolean;
}
export const enum AibLineType {
    leftOnly = "Left only",
    centerOnly = "Center only",
    leftAndRight = "Left and Right",
    leftCenterAndRight = "Left, Center and Right"
}
export interface AieStyleMap {
    [styleName: string]: {
        css: React.CSSProperties | EditorV3Style;
        aieExclude: string[];
    };
}
export const toHtml: <T extends string | object>(text: T) => T;
export const fromHtml: <T extends string | object>(text: T) => T;
interface AioIconButtonProps {
    id: string;
    onClick?: (ret: string) => void;
    iconName?: string;
    tipText?: string;
    popUpTip?: boolean;
    menuItems?: string[];
    leftMenuOffset?: string;
    style?: React.CSSProperties;
}
export const AioIconButton: {
    ({ id, onClick, iconName, tipText, popUpTip, menuItems, leftMenuOffset, style, }: AioIconButtonProps): JSX.Element;
    displayName: string;
};
/** Individual options */
export interface AioOption {
    optionName?: AioNewItem;
    type: AioOptionType;
    value: unknown;
    label?: string;
    availableValues?: string[];
    readOnly?: boolean;
}
/** Text replacements, and their replacement matrix */
export interface AioReplacement<T extends string | object> {
    airid?: string;
    oldText: string;
    newTexts: AioReplacementValues<T>[];
    includeTrailing?: boolean;
    externalName?: string;
}
export interface AioReplacementValues<T extends string | object> {
    airid?: string;
    texts: T[];
    spaceAfter?: boolean;
    subLists?: AioReplacement<T>[];
}
export interface AioExternalReplacements<T extends string | object> {
    givenName: string;
    newTexts: AioReplacementValues<T>[];
}
export interface AioExternalSingle<T extends string | object> {
    airid?: string;
    oldText?: string;
    newText?: T;
}
enum AioOptionType {
    string = "string",
    number = "number",
    array = "array",
    object = "object",
    boolean = "boolean",
    select = "select",
    replacements = "replacements"
}
enum AioNewItem {
    newKey = "newKey",
    newType = "newType"
}
interface AioStringProps {
    id: string;
    label?: string;
    value?: string;
    setValue?: (value: string) => void;
}
export const AioString: (props: AioStringProps) => JSX.Element;
/**
 * Properties for AioReplacements
 * @param value AioReplacement list
 * @param setValue update function
 */
interface AioSingleReplacementProps<T extends string | object> {
    id: string;
    label?: string;
    replacements?: AioExternalSingle<T>[];
    setReplacements?: (ret: AioExternalSingle<T>[]) => void;
    Editor?: (props: AsupInternalEditorProps<T>) => JSX.Element;
    blankT?: T;
    styleMap?: AieStyleMap;
}
/**
 * Option item for replacements
 * @param props replacement object
 * @returns JSX
 */
export const AioSingleReplacements: <T extends string | object>({ id, label, replacements, setReplacements, blankT, styleMap, Editor, }: AioSingleReplacementProps<T>) => JSX.Element;
interface AioDropSelectProps {
    id: string;
    value?: string;
    availableValues?: Array<string>;
    setValue?: (value: string) => void;
}
/**
 * Wrapper to preprend Icon button with chosen text
 */
export const AioDropSelect: ({ id, value, setValue, availableValues, }: AioDropSelectProps) => JSX.Element;
interface AioExpanderProps {
    id: string;
    inputObject?: {
        [key: string]: any;
    };
    label?: string;
    showBorders?: boolean;
    updateObject?: (value: any) => void;
    canAddItems?: boolean;
    canMoveItems?: boolean;
    canRemoveItems?: boolean;
}
export const AioExpander: (props: AioExpanderProps) => JSX.Element;
interface AioReplacementValuesDisplayProps<T extends string | object> {
    id: string;
    airid?: string;
    texts?: T[];
    spaceAfter?: boolean;
    subLists?: AioReplacement<T>[];
    setReplacementValue?: (ret: AioReplacementValues<T>) => void;
    dontAskSpace?: boolean;
    dontAskTrail?: boolean;
    externalLists?: AioExternalReplacements<T>[];
    Editor: (props: AsupInternalEditorProps<T>) => JSX.Element;
    blankT: T;
    styleMap?: AieStyleMap;
    joinTintoBlock: (lines: T[]) => T;
    splitTintoLines: (text: T) => T[];
}
export const AioReplacementValuesDisplay: <T extends string | object>({ id, airid, texts, spaceAfter, subLists, setReplacementValue, dontAskSpace, dontAskTrail, externalLists, styleMap, joinTintoBlock, blankT, Editor, splitTintoLines, }: AioReplacementValuesDisplayProps<T>) => JSX.Element;
interface AioReplacmentDisplayProps<T extends string | object> {
    id: string;
    airid?: string;
    oldText?: string;
    newTexts: AioReplacementValues<T>[];
    includeTrailing?: boolean;
    externalName?: string;
    setReplacement?: (ret: AioReplacement<T>) => void;
    externalLists?: AioExternalReplacements<T>[];
    dontAskSpace?: boolean;
    dontAskTrail?: boolean;
    noText?: boolean;
    Editor: (props: AsupInternalEditorProps<T>) => JSX.Element;
    blankT: T;
    styleMap?: AieStyleMap;
    joinTintoBlock: (lines: T[]) => T;
    splitTintoLines: (text: T) => T[];
}
/**
 * Render an individuial AioReplacement
 * @param props value/setValue pair
 */
export const AioReplacementDisplay: <T extends string | object>({ id, airid, oldText, newTexts, includeTrailing, externalName, setReplacement, externalLists, dontAskSpace, dontAskTrail, noText: noOldText, styleMap, joinTintoBlock, splitTintoLines, blankT, Editor, }: AioReplacmentDisplayProps<T>) => JSX.Element;
export interface AitCellData<T extends string | object> {
    aitid?: string;
    text: T;
    justifyText?: DraftComponent.Base.DraftTextAlignment | "decimal" | "default";
    comments: T;
    colWidth?: number;
    textIndents?: number;
    replacedText?: T;
    spaceAfterRepeat?: boolean;
}
interface AitHeaderCellData<T extends string | object> extends AitCellData<T> {
    colSpan?: number;
    rowSpan?: number;
    repeatColSpan?: number;
    repeatRowSpan?: number;
    spaceAfterSpan?: number;
}
export interface AitRowData<T extends string | object> {
    aitid?: string;
    rowRepeat?: string;
    cells: AitCellData<T>[];
    spaceAfter?: boolean;
}
interface AitHeaderRowData<T extends string | object> extends AitRowData<T> {
    cells: AitHeaderCellData<T>[];
}
export interface AitRowGroupData<T extends string | object> {
    aitid?: string;
    name?: string;
    rows: AitRowData<T>[];
    comments?: T;
    spaceAfter?: boolean;
    replacements?: AioReplacement<T>[];
}
interface AitHeaderGroupData<T extends string | object> extends AitRowGroupData<T> {
    rows: AitHeaderRowData<T>[];
}
export interface AitTableData<T extends string | object> {
    headerData?: AitHeaderGroupData<T> | false;
    bodyData?: AitRowGroupData<T>[];
    comments?: T;
    rowHeaderColumns?: number;
    noRepeatProcessing?: boolean;
    decimalAlignPercent?: number;
}
export const newReplacementValues: <T extends string | object>(blankT: T) => AioReplacementValues<T>;
export const newExternalReplacements: <T extends string | object>(blankT: T) => AioExternalReplacements<T>;
export const newExternalSingle: <T extends string | object>(blankT: T) => AioExternalSingle<T>;
/**
 * Add newRowGroupTemplate to existing body
 * @param l - Length of row
 * @param newRowGroupTemplate
 * @returns New row group
 */
export const newRowGroup: <T extends string | object>(defaultCellWidth: number, blank: T, l?: number, newRowGroupTemplate?: AitRowGroupData<T>) => AitRowGroupData<T>;
interface oldReplacementText {
    text: string;
    spaceAfter: boolean;
}
interface oldReplacementValue {
    newText: string;
    subList?: oldReplacementValue[];
}
interface oldReplacement {
    airid?: string;
    replacementTexts: oldReplacementText[];
    replacementValues: oldReplacementValue[];
    givenName?: string;
    externalName?: string;
}
export const updateReplacementVersion: (reps?: AioReplacement<string>[] | oldReplacement[]) => AioReplacement<string>[];
export function updateReplToExtl(reps: AioExternalReplacements<string>[] | oldReplacement[] | {
    name: string;
    list: oldReplacement[];
}[]): AioExternalReplacements<string>[];
interface OldTableData {
    headerData?: OldRowGroupData;
    bodyData?: OldRowGroupData[];
    comments?: string;
    rowHeaderColumns?: number;
    noRepeatProcessing?: boolean;
}
interface OldRowGroupData {
    aitid?: string;
    name?: string;
    rows: AitRowData<string>[];
    comments?: string;
    spaceAfter?: boolean;
    replacements?: AioReplacement<string>[] | oldReplacement[];
}
export const updateTableDataVersion: (inData: OldTableData | AitTableData<string>, defaultCellWidth: number) => AitTableData<string>;
/** Interface for the AsupInternalEditor component */
export interface AsupInternalEditorProps<T extends string | object> {
    id: string;
    value?: T;
    setValue?: (ret: T) => void;
    style?: React.CSSProperties;
    styleMap?: AieStyleMap;
    textAlignment?: Draft.DraftComponent.Base.DraftTextAlignment | "decimal" | "default";
    decimalAlignPercent?: number;
    showStyleButtons?: boolean;
    editable?: boolean;
    className?: string;
    resize?: boolean;
}
export const AsupInternalEditor: <T extends string | object>({ id, value, setValue, style, styleMap, textAlignment, showStyleButtons, editable, decimalAlignPercent, }: AsupInternalEditorProps<T>) => import("react/jsx-runtime").JSX.Element;
interface AsupInternalBlockProps<T extends string | object> {
    id: string;
    lines: AibBlockLine<T>[];
    setLines?: (ret: AibBlockLine<T>[]) => void;
    minLines?: number;
    maxLines?: number;
    externalSingles?: AioExternalSingle<T>[];
    styleMap?: AieStyleMap;
    defaultType?: AibLineType;
    canChangeType?: boolean;
    style?: React.CSSProperties;
    Editor?: (props: AsupInternalEditorProps<T>) => JSX.Element;
    blankT?: T;
    replaceTextInT?: (s: T, oldPhrase: string, newPhrase: T) => T;
}
export const AsupInternalBlock: {
    <T extends string | object>({ id, lines, setLines, minLines, maxLines, externalSingles, styleMap, defaultType, canChangeType, style, Editor, blankT, replaceTextInT, }: AsupInternalBlockProps<T>): JSX.Element;
    displayName: string;
};
interface OldBlockLine {
    aifid?: string;
    left?: string | false;
    centre?: string | false;
    right?: string | false;
    addBelow?: boolean;
    canEdit?: boolean;
    canRemove?: boolean;
    canMove?: boolean;
}
export const updateLineDisplayVersion: (inArray: OldBlockLine[] | AibBlockLine<string>[]) => AibBlockLine<string>[];
interface AsupInternalTableProps<T extends string | object> {
    id: string;
    tableData: AitTableData<T>;
    isEditable?: boolean;
    setTableData?: (ret: AitTableData<T>) => void;
    processedDataRef?: React.MutableRefObject<AitTableData<T> | undefined>;
    externalLists?: AioExternalReplacements<T>[];
    externalSingles?: AioExternalSingle<T>[];
    style?: React.CSSProperties;
    showCellBorders?: boolean;
    groupTemplates?: AitRowGroupData<T>[] | false;
    commentStyles?: AieStyleMap;
    cellStyles?: AieStyleMap;
    colWidthMod?: number;
    initialDecimalAlignPercent?: number;
    defaultCellWidth?: number;
    noTableOptions?: boolean;
    Editor?: (props: AsupInternalEditorProps<T>) => JSX.Element;
    getTextFromT?: (text: T) => string[];
    replaceTextInT?: (s: T, oldPhrase: string, newPhrase: T) => T;
    blankT?: T;
    joinTintoBlock?: (lines: T[]) => T;
    splitTintoLines?: (text: T) => T[];
}
/**
 * Table view for clinical table data
 * @param props
 * @returns
 */
export const AsupInternalTable: {
    <T extends string | object>({ id, tableData, isEditable, setTableData, processedDataRef, externalLists, externalSingles, style, showCellBorders, groupTemplates, commentStyles, cellStyles, colWidthMod, initialDecimalAlignPercent, defaultCellWidth, noTableOptions, Editor, getTextFromT, replaceTextInT, blankT, joinTintoBlock, splitTintoLines, }: AsupInternalTableProps<T>): import("react/jsx-runtime").JSX.Element;
    displayName: string;
};
export const readV2DivElement: (arg: HTMLDivElement) => {
    textBlocks: EditorV3TextBlock[];
    decimalAlignPercent: number;
    textAlignment: EditorV3Align;
};
export const stringToV3: (value: string) => IEditorV3;
interface EditorV3WrapperProps extends AsupInternalEditorProps<IEditorV3> {
    customStyleMap?: EditorV3Styles;
    debounceMilliseconds?: number;
    spellCheck?: boolean;
}
export const EditorV3Wrapper: {
    (props: EditorV3WrapperProps): import("react/jsx-runtime").JSX.Element;
    displayName: string;
};
export const convertRowGroup: (rg: AitRowGroupData<string | IEditorV3>) => AitRowGroupData<IEditorV3>;
export const convertTable: (table: AitTableData<string | IEditorV3>) => AitTableData<IEditorV3>;
export const convertBlockLine: (bl: AibBlockLine<string | IEditorV3>) => AibBlockLine<IEditorV3>;
export const convertExternalReplacements: <T extends string | IEditorV3>(externalReplacements: AioExternalReplacements<T>) => AioExternalReplacements<IEditorV3>;
export const getTextFromEditorV3: (input: IEditorV3 | string) => string[];
export const replaceTextInEditorV3: (input: IEditorV3 | string, oldPhrase: string, newPhrase: IEditorV3 | string) => IEditorV3;
export const styleToV3: (style: AieStyleMap) => EditorV3Styles;

//# sourceMappingURL=asupinternalcomponents.d.ts.map
