import { EditorV3Style } from "@asup/editor-v3"; import { DraftComponent } from "draft-js"; import React, { Dispatch } from "react"; export interface AibBlockLine { aifid: string; lineType: AibLineType; left: T | null; center: T | null; right: T | null; addBelow: boolean; canEdit: boolean; canRemove: boolean; canMove: boolean; canChangeType: boolean; } export enum AibLineType { leftOnly = "Left only", centerOnly = "Center only", leftAndRight = "Left and Right", leftCenterAndRight = "Left, Center and Right" } export interface AieStyleMap { [styleName: string]: { css: EditorV3Style; aieExclude?: string[]; }; } export interface AsupInternalEditorProps { 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; [key: string]: unknown; } export interface EditorProps { Editor: (props: AsupInternalEditorProps) => JSX.Element; getTextFromT: (text: T) => string[]; replaceTextInT: (s: T, oldPhrase: string, newPhrase: T) => T; blankT: T; joinTintoBlock: (lines: T[]) => T; splitTintoLines: (text: T) => T[]; } export interface AitCellData { aitid?: string; text: T; justifyText?: DraftComponent.Base.DraftTextAlignment | "decimal" | "default"; comments: T; colWidth?: number; textIndents?: number; replacedText?: T; spaceAfterRepeat?: boolean; } interface AitHeaderCellData extends AitCellData { colSpan?: number; rowSpan?: number; repeatColSpan?: number; repeatRowSpan?: number; spaceAfterSpan?: number; } export interface AitRowData { aitid?: string; rowRepeat?: string; cells: AitCellData[]; spaceAfter?: boolean; } interface AitHeaderRowData extends AitRowData { cells: AitHeaderCellData[]; } export interface AitRowGroupData { aitid?: string; name?: string; rows: AitRowData[]; comments?: T; spaceAfter?: boolean; replacements?: AioReplacement[]; } interface AitHeaderGroupData extends AitRowGroupData { rows: AitHeaderRowData[]; } export interface AitTableData { headerData?: AitHeaderGroupData | false; bodyData?: AitRowGroupData[]; comments?: T; rowHeaderColumns?: number; noRepeatProcessing?: boolean; decimalAlignPercent?: number; } export const newReplacementValues: (blankT: T) => AioReplacementValues; export const newExternalReplacements: (blankT: T) => AioExternalReplacements; export const newExternalSingle: (blankT: T) => AioExternalSingle; /** * Add newRowGroupTemplate to existing body * @param l - Length of row * @param newRowGroupTemplate * @returns New row group */ export const newRowGroup: (defaultCellWidth: number, blank: T, l?: number, newRowGroupTemplate?: AitRowGroupData) => AitRowGroupData; /** 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 { airid?: string; oldText: string; newTexts: AioReplacementValues[]; includeTrailing?: boolean; externalName?: string; } export interface AioReplacementValues { airid?: string; texts: T[]; spaceAfter?: boolean; subLists?: AioReplacement[]; } export interface AioExternalReplacements { givenName: string; newTexts: AioReplacementValues[]; } export interface AioExternalSingle { 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" } export const toHtml: (text: T) => T; export const fromHtml: (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; }; interface AioStringProps { id: string; label?: string; value?: string; setValue?: (value: string) => void; } export const AioString: { (props: AioStringProps): JSX.Element; displayName: string; }; /** * Properties for AioReplacements * @param value AioReplacement list * @param setValue update function */ interface AioSingleReplacementProps { id: string; label?: string; replacements?: AioExternalSingle[]; setReplacements?: (ret: AioExternalSingle[]) => void; Editor?: (props: AsupInternalEditorProps) => JSX.Element; blankT?: T; styleMap?: AieStyleMap; } /** * Option item for replacements * @param props replacement object * @returns JSX */ export const AioSingleReplacements: { ({ id, label, replacements, setReplacements, blankT, styleMap, Editor, }: AioSingleReplacementProps): JSX.Element; displayName: string; }; export const AsupInternalEditor: ({ id, value, setValue, style, styleMap, textAlignment, showStyleButtons, editable, decimalAlignPercent, }: AsupInternalEditorProps) => import("react/jsx-runtime").JSX.Element; interface AioDropSelectProps { id: string; value?: string; availableValues?: Array; setValue?: (value: string) => void; } /** * Wrapper to preprend Icon button with chosen text */ export const AioDropSelect: { ({ id, value, setValue, availableValues, }: AioDropSelectProps): JSX.Element; displayName: string; }; export declare namespace AioArraySortable { var displayName: string; } 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; displayName: string; }; interface AioReplacementValuesDisplayProps { id: string; airid?: string; texts?: T[]; spaceAfter?: boolean; subLists?: AioReplacement[]; setReplacementValue?: (ret: AioReplacementValues) => void; dontAskSpace?: boolean; dontAskTrail?: boolean; externalLists?: AioExternalReplacements[]; Editor: (props: AsupInternalEditorProps) => JSX.Element; blankT: T; styleMap?: AieStyleMap; joinTintoBlock: (lines: T[]) => T; splitTintoLines: (text: T) => T[]; } export const AioReplacementValuesDisplay: { ({ id, airid, texts, spaceAfter, subLists, setReplacementValue, dontAskSpace, dontAskTrail, externalLists, styleMap, joinTintoBlock, blankT, Editor, splitTintoLines, }: AioReplacementValuesDisplayProps): JSX.Element; displayName: string; }; interface AioReplacmentDisplayProps { id: string; airid?: string; oldText?: string; newTexts: AioReplacementValues[]; includeTrailing?: boolean; externalName?: string; setReplacement?: (ret: AioReplacement) => void; externalLists?: AioExternalReplacements[]; dontAskSpace?: boolean; dontAskTrail?: boolean; noText?: boolean; Editor: (props: AsupInternalEditorProps) => 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: { ({ id, airid, oldText, newTexts, includeTrailing, externalName, setReplacement, externalLists, dontAskSpace, dontAskTrail, noText: noOldText, styleMap, joinTintoBlock, splitTintoLines, blankT, Editor, }: AioReplacmentDisplayProps): JSX.Element; displayName: string; }; interface AsupInternalBlockProps { id: string; lines: AibBlockLine[]; setLines?: Dispatch[]>; disabled?: boolean; minLines?: number; maxLines?: number; externalSingles?: AioExternalSingle[]; styleMap?: AieStyleMap; defaultType?: AibLineType; canChangeType?: boolean; lineStyle?: React.CSSProperties; editorProps: EditorProps; } export const AsupInternalBlock: { ({ id, lines, setLines, disabled, minLines, maxLines, externalSingles, styleMap, defaultType, canChangeType, lineStyle, editorProps, }: AsupInternalBlockProps): JSX.Element; displayName: string; }; interface AsupInternalTableProps { id: string; tableData: AitTableData; isEditable?: boolean; setTableData?: (ret: AitTableData) => void; processedDataRef?: React.MutableRefObject | undefined>; externalLists?: AioExternalReplacements[]; externalSingles?: AioExternalSingle[]; style?: React.CSSProperties; showCellBorders?: boolean; groupTemplates?: AitRowGroupData[] | false; commentStyles?: AieStyleMap; cellStyles?: AieStyleMap; colWidthMod?: number; initialDecimalAlignPercent?: number; defaultCellWidth?: number; noTableOptions?: boolean; Editor?: (props: AsupInternalEditorProps) => 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: { ({ id, tableData, isEditable, setTableData, processedDataRef, externalLists, externalSingles, style, showCellBorders, groupTemplates, commentStyles, cellStyles, colWidthMod, initialDecimalAlignPercent, defaultCellWidth, noTableOptions, Editor, getTextFromT, replaceTextInT, blankT, joinTintoBlock, splitTintoLines, }: AsupInternalTableProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; //# sourceMappingURL=asupinternalcomponents.d.ts.map