import { CSSInterpolation, CSSObject } from '@emotion/css';

export type { CSSInterpolation };

export type Value = string | number | boolean;

export type SheetData = Value[][];

export enum MODIFIER_TYPE {
  ADD_ROW = 'addRow',
  ADD_COLUMN = 'addColumn',
  REMOVE_ROW = 'removeRow',
  REMOVE_COLUMN = 'removeColumn',
}

export type DataHandlerResult = SheetData;

export type DataHandler = {
  headerStep?: DataHandlerHeaderStep;
  reviewStep?: DataHandlerReviewStep;
};

export type DataHandlerHeaderStep = (
  modifier: HeaderStepModifier,
  data: ISheetData[]
) =>
  | Promise<JSONData[] | SheetData | void | HandlerFileData[]>
  | JSONData[]
  | SheetData
  | void
  | HandlerFileData[];

export type HandlerFileData = {
  data: JSONData[] | SheetData;
  sheetName: string;
  fileName: string;
  fileSize?: number;
  fileType?: SpreadSheetType;
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type JSONData = Record<string, any>;

export type DataHandlerResultValues = Record<
  string,
  FieldValue | CurrencyValue | HookedRecordResult
>[];

export type ReviewStepHandlerData = DataHandlerResultValues;

export type DataHandlerReviewStep = (
  modifier: Modifier,
  data: ReviewStepHandlerData,
  logs: ImportLogs,
  metadata?: DataHandlerMetaData[]
) => Promise<ReviewStepHandlerData | void> | ReviewStepHandlerData | void;

type SpreadSheetType =
  | 'csv'
  | 'tsv'
  | 'psv'
  | 'xlsx'
  | 'json'
  | 'xml'
  | 'dynamic-import';

export type DataHandlerMetaData = {
  fileName: string;
  fileSize: number;
  fileType: SpreadSheetType;
};

export type Modifier = {
  addRow: ModifierAddRow;
  removeRow: ModifierRemoveRow;
  addColumn: ModifierAddColumn;
  removeColumn: ModifierRemoveColumn;
};

export type ModifierAddRow = ({
  data,
  index,
}: {
  data: DataHandlerResultValues;
  index?: number;
}) => void;

export type ModifierRemoveRow = (index: number) => void;

export type MappingStepModifierAddColumn = ({
  label,
}: {
  label: string;
}) => void;

export type ModifierAddColumn = ({
  key,
  label,
  columnType,
  validations,
  dropdownOptions,
  outputFormat,
  isMultiSelect,
  columnWidth,
  hidden,
  disabled,
}: {
  key: string;
  label: string;
  columnType: ColumnType;
  validations?: ValidatorAPI[] | null;
  dropdownOptions?: DropdownOptionAPI[];
  outputFormat?: string | null;
  isMultiSelect?: boolean;
  columnWidth?: number;
  hidden?: boolean;
  disabled?: boolean;
}) => void;

export type ModifierRemoveColumn = (key: string) => void;

export type ModifierStack<ROW_DATA> = {
  modifierType: MODIFIER_TYPE;
  rowIndex?: number;
  rowData?: ROW_DATA;
  columnKey?: string;
  columnLabel?: string;
  columnType?: ColumnType;
  columnValidations?: ValidatorAPI[] | null;
  columnIndex?: number;
  columnDropdownOptions?: DropdownOptionAPI[];
  outputFormat?: string | null;
  isMultiSelect?: boolean;
  hidden?: boolean;
  disabled?: boolean;
};

export type MappingStepModifierAddRow = ({
  data,
  index,
}: {
  data: ResultValues;
  index?: number;
}) => void;

export type MappingStepModifier = {
  addRow: MappingStepModifierAddRow;
  removeRow: ModifierRemoveRow;
  addColumn: MappingStepModifierAddColumn;
  removeColumn: ModifierRemoveColumn;
};

export type DataHandlerMappingStep = (
  modifier: MappingStepModifier,
  data: ISheetData[],
  metadata?: DataHandlerMetaData[]
) => DataHandlerResult | void;

export type HeaderStepModifierAddRow = (data: HeaderStepAddRowProps) => void;

export type HeaderStepAddRowProps = {
  data: SheetData;
  index?: number;
};

export type HeaderStepModifierRemoveColumn = (index: number) => void;

export type HeaderStepModifier = {
  addRow: HeaderStepModifierAddRow;
  removeRow: ModifierRemoveRow;
  addColumn: MappingStepModifierAddColumn;
  removeColumn: HeaderStepModifierRemoveColumn;
};

export type CompleteImportType = 'discard' | 'submit' | 'block';

export enum SubmitResultType {
  Reject = 'Reject',
  Pass = 'Pass',
}

interface SubmitResult {
  type: SubmitResultType;
}

export type SheetLikeData = {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  data: any;
  sheetName?: string;
  fileName: string;
};

export type ISheetData = {
  data: SheetData;
  sheetName: string;
  fileName: string;
  fileSize: number;
  fileType: string;
  transposed: boolean;
  headerRowIndexes: number[];
  addedColumns: AddedColumn[];
};

type IUploadStepUpdateDataFn = (data: SheetLikeData[]) => void;

export type IAlertFn = (params: {
  title: string;
  description: string;
  cancelButton: string;
  proceedButton: string;
}) => void;

export type IBlockFn = (params: {
  title: string;
  description: string;
  closeButton: string;
}) => void;

export type AddedColumnSource =
  | 'metadata_cell'
  | 'custom_value'
  | 'file_name'
  | 'sheet_name'
  | 'column_promotion';

export type AddedColumn = {
  columnName: string;
  value: string;
  source: AddedColumnSource;
  sourceCell?: { row: number; col: number }; // Internal UI tracking only, not exposed to stepHandlers
};

export type IUploadStepHandler = (params: {
  parsedData: ISheetData[];
  rawData: File[];
  updateData: IUploadStepUpdateDataFn;
  alert: IAlertFn;
  block: IBlockFn;
}) => Promise<void> | void;

export type IAddColumn = Omit<
  ColumnAPI,
  | 'optionMappingConfiguration'
  | 'optionMappingMode'
  | 'columnSize'
  | 'alternativeMatches'
  | 'allowCustomOptions'
>;

export type IUpdateColumnChanges = Partial<Omit<IAddColumn, 'key'>>;

export type ITdmModifier = {
  addColumn: (column: IAddColumn, options?: { index?: number }) => void;
  removeColumn: (key: string) => void;
  updateColumn: (
    key: string,
    changes: IUpdateColumnChanges,
    options?: { index?: number }
  ) => void;
};

export type IReviewEntriesUpdatedData = Record<
  string,
  FieldValue | HookedRecordResult
>[];

export type IMappingStepUpdateData = (data: IReviewEntriesUpdatedData) => void;

export type IMappingStepHandler = (params: {
  data: Values;
  tdm: ITdmModifier;
  updateData: IMappingStepUpdateData;
  alert: IAlertFn;
  block: IBlockFn;
  logs: ImportLogs;
}) => Promise<void> | void;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type IHeaderStepUpdateDataFn = (data: SheetLikeData[] | any[]) => void;

export type IHeaderStepHandler = (params: {
  data: ISheetData[];
  updateData: IHeaderStepUpdateDataFn;
  alert: IAlertFn;
  block: IBlockFn;
}) => Promise<void> | void;

export type IReviewData = Record<
  string,
  {
    value?: FieldValue;
    info?: HookedRecordInfo[];
  }
>[];

export type IReviewStepUpdateDataFn = (data: IReviewEntriesUpdatedData) => void;

export type IReviewStepHandler = (params: {
  data: IReviewData;
  updateData: IReviewStepUpdateDataFn;
  block: IBlockFn;
  logs: ImportLogs;
}) => Promise<void> | void;

export type IStepHandler = {
  uploadStep?: IUploadStepHandler;
  mappingStep?: IMappingStepHandler;
  headerStep?: IHeaderStepHandler;
  reviewStep?: IReviewStepHandler;
};

export type ConfigureAPI = {
  licenseKey: string;
  settings: SettingsAPI;
  columnHooks?: ColumnHooks;
  onResults?: OnResults;
  onCancel?: OnCancel;
  onEntryChange?: OnEntryChange;
  onEntryInit?: OnEntryInit;
  /** @deprecated - this setting is deprecated.  */
  dataHandler?: DataHandler;
  stepHandler?: IStepHandler;
};

export type ColumnType =
  | 'category'
  | 'boolean'
  | 'int'
  | 'float'
  | 'string'
  | 'date'
  | 'date_dmy'
  | 'date_mdy'
  | 'date_iso'
  | 'datetime'
  | 'time_hms'
  | 'time_hms_24'
  | 'time_hm'
  | 'time_hm_24'
  | 'email'
  | 'url_www'
  | 'url_https'
  | 'url'
  | 'phone'
  | 'zip_code_de'
  | 'percentage'
  | 'country_code_alpha_2'
  | 'country_code_alpha_3'
  | 'currency_code'
  | 'currency_eur'
  | 'currency_usd'
  | 'bic'
  | 'vat_eu'
  | 'gtin'
  | 'iban';

export type ValidationTypeAPI =
  | 'required'
  | 'unique'
  | 'regex'
  | 'required_with'
  | 'required_without'
  | 'required_with_all'
  | 'required_without_all'
  | 'required_with_values'
  | 'required_without_values'
  | 'required_with_all_values'
  | 'required_without_all_values';

export type ColumnValueAPI = Record<string, FieldValue[] | FieldValue>;

export type columnsAPI = string[];

export type ValidatorAPI = {
  validate: ValidationTypeAPI;
  regex?: string | null;
  columnValues?: ColumnValueAPI | null;
  columns?: columnsAPI;
  errorMessage?: string;
};

export type DropdownOptionType = 'string' | 'float' | 'int';

export type ButtonModeType = 'import' | 'edit' | 'both';

export type ProcessorType = 'default' | 'node';

export type InputType =
  | 'pdf'
  | 'json'
  | 'xml'
  | 'csv'
  | 'tsv'
  | 'xlsx'
  | 'xls'
  | 'psv';

export type DropdownOptionAPI = DropdownOptionAPIBase &
  (DropdownOptionAPIString | DropdownOptionAPINumber);

type DropdownOptionAPIBase = {
  label: string;
  alternativeMatches?: string[];
  validations?: DropdownOptionValidation[];
  description?: string;
};

type DropdownOptionAPIString = {
  type: 'string';
  value: string;
};

type DropdownOptionAPINumber = {
  type: 'float' | 'int';
  value: number;
};

export type DropdownOptionValidation = {
  validate: DropdownOptionValidate;
  errorMessage?: string;
};

export type DropdownOptionValidate = Record<
  string,
  { [key: string]: DropdownOptionValidate | FieldValue } | FieldValue
>;

export enum ValidateOperators {
  AND = 'AND',
  OR = 'OR',
  GTE = 'GTE',
  GT = 'GT',
  LT = 'LT',
  LTE = 'LTE',
  EQ = 'EQ',
  NEQ = 'NEQ',
}

export enum NumberFormat {
  US = 'us',
  EU = 'eu',
}

export type ColumnNumberFormat = {
  column: string;
  numberFormat: `${NumberFormat}` | NumberFormat | undefined;
};

export type DetectedNumberFormats = {
  global: `${NumberFormat}` | NumberFormat;
  columns: ColumnNumberFormat[];
};

export type MappingValidationAPI = {
  logic: string;
  errorMessage: string;
};

export type ColumnAPI = {
  label: string;
  key: string;
  description?: string;
  example?: string | null;
  columnSize?: number | null;
  columnWidth?: number;
  validations?: ValidatorAPI[] | null;
  mappingValidation?: MappingValidationAPI | null;
  columnType?: ColumnType | null;
  dropdownOptions?: DropdownOptionAPI[] | null;
  alternativeMatches?: string[];
  isMultiSelect?: boolean;
  outputFormat?: string | null;
  allowCustomOptions?: boolean;
  allowedCustomOptionTypes?: DropdownOptionType[];
  numberFormat?: 'eu' | 'us';
  /**
   * @deprecated This property should not be used
   */
  optionMappingMode?: 'smart' | 'exact';
  hidden?: boolean;
  disabled?: boolean;
  optionMappingConfiguration?: IMappingConfiguration;
};

export type I18nOverrides =
  | {
      en?: Record<string, string>;
      de?: Record<string, string>;
      es?: Record<string, string>;
      fr?: Record<string, string>;
      it?: Record<string, string>;
      nl?: Record<string, string>;
      pl?: Record<string, string>;
      pt?: Record<string, string>;
      sv?: Record<string, string>;
    }
  | Record<string, string>;

type IAdditionalInfo = {
  uploadStep?: boolean;
  sheetSelectionStep?: boolean;
  headerStep?: boolean;
  mappingStep?: boolean;
  reviewStep?: boolean;
  joinSheetsStep?: boolean;
};

export type IApplyMappingMode = 'none' | 'gapFill' | 'always';

export type ISkipConfigurationHeader = {
  enabled: boolean;
  showInStepper?: boolean;
  showInfoBox?: boolean;
};

export type ISkipConfigurationMapping = {
  showInStepper?: boolean;
  showInfoBox?: boolean;
  automaticMapping?: boolean;
  applyColumnMapping?: IApplyMappingMode;
  applyOptionMapping?: IApplyMappingMode;
};

export type ISkipConfiguration = {
  header?: ISkipConfigurationHeader;
  mapping?: ISkipConfigurationMapping;
};

export type SettingsAPI = {
  developerMode?: boolean;
  identifier: string;
  style?: ThemeAPI;
  columns: ColumnAPI[];
  enableExamples?: boolean;
  maxEntries?: number;
  modal?: boolean;
  title?: string;
  disableTemplates?: boolean;
  completeImportAction?: CompleteImportType;
  enableMassiveErrorAlert?: number;
  /** @deprecated - this setting is deprecated. Use skipConfiguration.header.enabled instead. */
  automaticHeaderDetection?: boolean;
  i18nOverrides?: I18nOverrides;
  embedUploadArea?: boolean;
  multipleFileUpload?: boolean;
  /** @deprecated - this setting is deprecated. Use successModalConfiguration.display instead */
  disableSuccessModal?: boolean;
  allowManualInput?: boolean;
  onlyMappedColumns?: boolean;
  allowCustomColumns?: boolean;
  columnResize?: boolean;
  /** @deprecated - this setting will be deprecated. Use allowCustomOptions from Target Data Model instead. */
  allowCustomOptions?: boolean;
  disableExcelTemplate?: boolean;
  /** @deprecated - this setting is deprecated. Use skipConfiguration.mapping instead. */
  automaticMapping?: boolean;
  preloadData?: Values;
  /** @deprecated - this setting is deprecated. Use inputTypes instead. */
  allowNestedData?: boolean;
  /** @deprecated - this setting is deprecated. Use inputTypes instead. */
  advancedParsing?: boolean;
  inputTypes?: InputType[];
  buttonMode?: ButtonModeType;
  language?: LanguageType;
  /** @deprecated - this setting is deprecated.  */
  processingEngine?: ProcessorType;
  /** @deprecated - this setting is deprecated. */
  disableTemplateDropdowns?: boolean;
  smartTable?: boolean;
  cleaningAssistant?: boolean;
  contextualEngine?: `${ContextualEngineType}`;
  columnMappingConfiguration?: IMappingConfiguration;
  baseUrl?: string;
  submitModalConfiguration?: ISubmitModalConfiguration;
  prompts?: boolean;
  successModalConfiguration?: ISuccessModalConfiguration;
  workersBaseUrl?: string;
  mappingViewMode?: 'sourceColumns' | 'targetColumns';
  additionalInfo?: IAdditionalInfo;
  transpose?: boolean;
  mergeHeaders?: boolean;
  metadataSelection?: boolean;
  skipConfiguration?: ISkipConfiguration;
};

export type FieldValue =
  | string
  | FieldValue[]
  | undefined
  | number
  | boolean
  | null;

export type CurrencyType = 'EUR' | 'USD';

export type CurrencyValue = {
  value: string | number;
  type: CurrencyType;
};

export type HookedRecordValue = [FieldValue, number];

export type Values = Record<string, FieldValue>[];

type ResultValue = Record<string, FieldValue | CurrencyValue>;

type ErrorValue = {
  value: ResultValue;
  info?: { message: string; level: string }[];
};

export type ResultValues = ResultValue[];

export type ErrorValues = Record<string, ErrorValue>[];

export type ICompleteParams = { importedRows: number; failedRows: number };

export type OnResults = (
  result: ResultValues,
  errors: ErrorValues,
  complete: (completeResultParam?: Partial<ICompleteParams>) => void,
  logs: ImportLogs,
  block: IBlockFn
) => Promise<void> | void;

export type HookedRecordInfoLevel = 'info' | 'warning' | 'error' | 'disabled';

export type HookedRecordInfo = {
  message: string;
  level: HookedRecordInfoLevel;
};

export type HookedRecordResult = {
  value?: FieldValue;
  info?: HookedRecordInfo[];
};

export type Row = Record<string, FieldValue>;

export type RowInfo = Record<string, HookedRecordInfo[]>;

export type ChangeActionType =
  | 'edit'
  | 'delete'
  | 'replace'
  | 'create'
  | 'removePrompt'
  | 'applyPrompt';

export type HookRowResult =
  | Record<string, HookedRecordResult>
  | Promise<Record<string, HookedRecordResult>>
  | void;

export type OnEntryInit = (
  record: Row,
  index: number
) => HookRowResult | undefined;

export type EntryChangeRow = {
  rowIndex: number;
  data: Row;
  changeLog: Row | null;
  actionType: ChangeActionType;
  info: RowInfo;
};

export type RowResult = Record<string, HookedRecordResult | FieldValue>;

export type EntryChangeResult = {
  rowIndex: number;
  data: RowResult;
  changeLog?: Row | null;
  actionType?: ChangeActionType;
};

export type ResultOnEntryChange =
  | Promise<EntryChangeResult[] | void>
  | EntryChangeResult[]
  | void;

export type OnEntryChange = (
  rows: EntryChangeRow[],
  logs: OnEntryChangeLogs
) => ResultOnEntryChange;

export type HookedRecordRowResult = [HookedRecordResult, number];

export type ColumnHookCallback = (
  values: HookedRecordValue[]
) => Promise<HookedRecordRowResult[]> | HookedRecordRowResult[] | void;

export type ColumnHooks = Record<string, ColumnHookCallback>;

export type OnCancel = () => void;

export type ImportLogs = {
  mappings?: ImportLogsMapping[];
  columns?: ImportLogsColumns;
} | null;

export type ImportLogsColumns = {
  addedColumns?: ImportLogsAddedColumn[];
  addedOptions?: ImportLogsAddedOptions[];
};

export type ImportLogsAddedColumn = {
  label: string;
  key: string;
  columnType: ColumnType;
  outputFormat?: string | null;
};

export type ImportLogsAddedOptions = {
  columnKey: string;
  dropdownOptions: ImportLogsAddedDropdownOption[];
};

export type ImportLogsAddedDropdownOption = {
  label: string;
  value: string | number | null;
  type: DropdownOptionType;
};

export type ImportLogsMappingOptions = {
  sourceValue: string | number | boolean;
  targetOptions: string[];
};

export type ImportLogsMapping = {
  sourceColumn: string;
  targetColumn: string;
  options?: ImportLogsMappingOptions[];
};

export type IAdditionalInfoTheme = {
  root?: CSSInterpolation;
  icon?: CSSInterpolation;
  text?: CSSInterpolation;
  infoModal?: {
    root?: CSSInterpolation;
    closeIcon?: CSSInterpolation;
    scrollbar?: {
      navigatorColor?: string;
      backgroundColor?: string;
    };
    overlay?: CSSInterpolation;
    title?: CSSInterpolation;
    message?: CSSInterpolation;
  };
};

export type AIpromptThemeAPI = {
  root?: CSSInterpolation;
  button?: CSSInterpolation;
  header?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    descriptionIcon?: CSSInterpolation;
    closeIcon?: CSSInterpolation;
    locateIcon?: CSSInterpolation;
  };
  footer?: {
    root?: CSSInterpolation;
    button?: CSSInterpolation;
  };
  prompt?: {
    root?: CSSInterpolation;
    input?: {
      root?: CSSInterpolation;
      variables?: {
        default?: CSSInterpolation;
        column?: CSSInterpolation;
        number?: CSSInterpolation;
        string?: CSSInterpolation;
      };
      scrollbar?: {
        navigatorColor?: string;
        backgroundColor?: string;
      };
      suggestion?: {
        root?: CSSInterpolation;
        scrollbar?: {
          navigatorColor?: string;
          backgroundColor?: string;
        };
        option?: CSSInterpolation;
        selectedOption?: CSSInterpolation;
      };
    };
    button?: CSSInterpolation;
    icon?: CSSInterpolation;
    description?: CSSInterpolation;
    example?: {
      root?: CSSInterpolation;
      icon?: CSSInterpolation;
    };
  };
  function?: {
    root?: CSSInterpolation;
    input?: {
      root?: CSSInterpolation;
      variables?: {
        default?: CSSInterpolation;
        column?: CSSInterpolation;
        number?: CSSInterpolation;
        string?: CSSInterpolation;
      };
      scrollbar?: {
        navigatorColor?: string;
        backgroundColor?: string;
      };
      suggestion?: {
        root?: CSSInterpolation;
        scrollbar?: {
          navigatorColor?: string;
          backgroundColor?: string;
        };
        option?: CSSInterpolation;
        selectedOption?: CSSInterpolation;
      };
    };
    button?: CSSInterpolation;
    icon?: CSSInterpolation;
    example?: {
      root?: CSSInterpolation;
      icon?: CSSInterpolation;
    };
  };
  table?: {
    root?: CSSInterpolation;
    th?: CSSInterpolation;
    td?: {
      root?: CSSInterpolation;
      error?: CSSInterpolation;
    };
    popover?: CSSInterpolation;
  };
};

export type ThemeAPI = {
  root?: RootThemeAPI;
  buttons?: ButtonThemeVariantAPI;
  globals?: GlobalsThemeAPI;
  dialog?: DialogThemeAPI;
  messagePopup?: Omit<DialogThemeAPI, 'scrollbar'> & {
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    warnIcon?: CSSInterpolation;
  };
  loader?: LoaderThemeAPI;
  headerSelect?: HeaderMatchAPI;
  dropzone?: DropzoneThemeAPI;
  progressBar?: ProgressBarThemeAPI;
  joinSheet?: JoinSheetThemeAPI;
  footer?: FooterThemeAPI;
  header?: HeaderThemeAPI;
  columnMatch?: ColumnMatchThemeAPI;
  reviewEntries?: ReviewEntriesThemeAPI;
  sheetSelect?: SheetSelectThemeAPI;
  popoverInfo?: PopoverInfoThemeAPI;
  popover?: PopoverThemeAPI;
  cleaningAssistant?: CleaningAssistantThemeAPI;
  contextualEngine?: ContextualEngineThemeAPI;
  alertPopup?: Omit<DialogThemeAPI, 'scrollbar'> & {
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  blockPopup?: Omit<DialogThemeAPI, 'scrollbar'> & {
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  prompts?: AIpromptThemeAPI;
};

type RootThemeAPI = {
  container?: CSSInterpolation;
};

export type Variant =
  | 'primary'
  | 'secondary'
  | 'tertiary'
  | 'import'
  | 'cleanData'
  | 'exportExcel'
  | 'findError'
  | 'findReplace'
  | 'exportErrorRows';

type ButtonThemeIconAPI = { icon?: CSSInterpolation };

export type ButtonThemeCssObjectAPI = CSSInterpolation & ButtonThemeIconAPI;

type ButtonThemeVariantAPI = {
  primary?: ButtonThemeCssObjectAPI;
  secondary?: ButtonThemeCssObjectAPI;
  tertiary?: ButtonThemeCssObjectAPI;
  import?: ButtonThemeCssObjectAPI;
  cleanData?: ButtonThemeCssObjectAPI;
  exportExcel?: ButtonThemeCssObjectAPI & {
    dropdown?: {
      root?: CSSInterpolation;
      item?: CSSInterpolation;
    };
  };
  findError?: ButtonThemeCssObjectAPI;
  findReplace?: ButtonThemeCssObjectAPI;
  exportErrorRows?: ButtonThemeCssObjectAPI;
  transpose?: ButtonThemeCssObjectAPI & {
    popover?: CSSInterpolation;
  };
};

export type GlobalsThemeAPI = {
  fontFamily?: string;
  textColor?: string;
  primaryTextColor?: string;
  secondaryTextColor?: string;
  backgroundColor?: string;
  primaryColor?: string;
  secondaryColor?: string;
  borderRadius?: string | number;
  maxHeight?: string | number;
};

type PopoverInfoThemeAPI = CSSInterpolation;

type PopoverThemeAPI = {
  root?: CSSInterpolation;
  info?: {
    root?: CSSInterpolation;
    circle?: CSSInterpolation;
  };
  warning?: {
    root?: CSSInterpolation;
    circle?: CSSInterpolation;
  };
  error?: {
    root?: CSSInterpolation;
    circle?: CSSInterpolation;
  };
};

type DialogThemeAPI = {
  root?: CSSInterpolation;
  overlay?: CSSInterpolation;
  closeIcon?: CSSInterpolation;
  scrollbar?: {
    navigatorColor?: string;
    backgroundColor?: string;
  };
};

type LoaderThemeAPI = {
  root?: CSSInterpolation;
  content?: CSSInterpolation;
  loadAnimationColor?: string;
};

type HeaderMatchAPI = {
  root?: CSSInterpolation;
  pageHeader?: HeaderThemeAPI;
  content?: CSSInterpolation;
  sheetName?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    border?: CSSInterpolation;
  };
  table?: {
    th?: CSSInterpolation;
    td?: CSSInterpolation;
    selectRowColor?: string;
    hoverRowColor?: string;
    scrollbar?: {
      navigatorColor?: string;
      backgroundColor?: string;
    };
  };
  fullScreen?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  sheetNameSelected?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    border?: CSSInterpolation;
  };
  progressBar?: {
    root?: CSSInterpolation;
    progress?: {
      navigatorColor?: string;
      backgroundColor?: string;
    };
  };
  additionalInfo?: IAdditionalInfoTheme;
};

type DropzoneIllustrationStyle = {
  borderColor?: string;
  headerColor?: string;
  circleHeaderColor?: string;
  circleRowColor?: string;
  downloadIconColor?: string;
  shadowColor?: string;
};

type DropzoneThemeAPI = {
  root?: CSSInterpolation;
  icon?: {
    box?: CSSInterpolation;
  };
  content?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    illustration?: DropzoneIllustrationStyle;
  };
  container?: CSSInterpolation;
  additionalInfo?: IAdditionalInfoTheme;
};

type ProgressBarThemeAPI = {
  root?: CSSInterpolation;
  icon?: CSSInterpolation;
  current?: CSSInterpolation;
  complete?: CSSInterpolation;
  incomplete?: CSSInterpolation;
};

type FooterThemeAPI = {
  root?: CSSInterpolation;
};

type HeaderThemeAPI = {
  root?: CSSInterpolation;
  title?: CSSInterpolation;
  description?: CSSInterpolation;
};

type ColumnMatchThemeDropdownAPI = {
  root?: CSSInterpolation;
  button?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    placeholder?: string;
  };
  search?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    placeholder?: string;
  };
  badge?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  scrollbar?: {
    navigatorColor?: string;
    backgroundColor?: string;
  };
  header?: CSSInterpolation;
  option?: CSSInterpolation;
  selectedOption?: CSSInterpolation;
  createNewOption?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  multiSelectionBadge?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  iconCheckedColor?: string;
};

type CreateCustomTextField = {
  label?: CSSInterpolation;
  icon?: CSSInterpolation;
  input?: CSSInterpolation;
  errorMessage?: CSSInterpolation;
};

type CreateCustomDropdown = {
  button?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    placeholder?: string;
  };
  scrollbar?: {
    navigatorColor?: string;
    backgroundColor?: string;
  };
  option?: CSSInterpolation;
  selectedOption?: CSSInterpolation;
  iconCheckedColor?: string;
};

type CreateCustomDropdownField = {
  label?: CSSInterpolation;
  icon?: CSSInterpolation;
  errorMessage?: CSSInterpolation;
  dropdown?: CreateCustomDropdown;
};

type DialogCreateCustomColumn = {
  root?: CSSInterpolation;
  overlay?: CSSInterpolation;
  closeIcon?: CSSInterpolation;
  title?: CSSInterpolation;
  description?: CSSInterpolation;
  columnName?: CreateCustomTextField;
  columnType?: CreateCustomDropdownField;
  dateFormat?: CreateCustomDropdownField;
  popover?: CSSInterpolation;
};

type DialogCreateCustomOption = {
  root?: CSSInterpolation;
  overlay?: CSSInterpolation;
  closeIcon?: CSSInterpolation;
  title?: CSSInterpolation;
  description?: CSSInterpolation;
  optionName?: CreateCustomTextField;
  optionType?: CreateCustomDropdownField;
};

type ColumnMatchThemeAPI = {
  root?: CSSInterpolation;
  pageHeader?: HeaderThemeAPI;
  borderColor?: CSSInterpolation;
  matchingTitle?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    checkIcon?: CSSInterpolation;
    warningIcon?: CSSInterpolation;
    errorIcon?: CSSInterpolation;
  };
  matchingPercent?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  icon?: CSSInterpolation;
  columnMatchHeader?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    dropdown?: Exclude<
      ColumnMatchThemeDropdownAPI,
      'header' | 'search' | 'badge' | 'multiSelectionBadge'
    >;
  };
  columnMatchValue?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    dropdown?: ColumnMatchThemeDropdownAPI;
    emptyValue?: CSSInterpolation;
    scrollbar?: {
      navigatorColor?: string;
      backgroundColor?: string;
    };
    loading?: CSSInterpolation;
  };
  requiredColumns?: {
    title?: CSSInterpolation;
    hasMatch?: CSSInterpolation;
    notMatch?: CSSInterpolation;
    notMatchError?: CSSInterpolation;
    hasMatchIcon?: CSSInterpolation;
    notMatchIcon?: CSSInterpolation;
    notMatchErrorIcon?: CSSInterpolation;
    showMore?: {
      root?: CSSInterpolation;
      text?: CSSInterpolation;
      icon?: CSSInterpolation;
      badge?: CSSInterpolation;
    };
    errorPopover?: CSSInterpolation;
  };
  notMatchingValue?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  joinBadge?: CSSInterpolation;
  sheetInfo?: CSSInterpolation;
  dialogCreateCustomColumn?: DialogCreateCustomColumn;
  dialogCreateCustomOption?: DialogCreateCustomOption;
  columnPopover?: CSSInterpolation;
  additionalInfo?: IAdditionalInfoTheme;
  infoBox?: InfoBoxThemeAPI;
};

type FilterConditionDropdown = {
  root?: CSSInterpolation;
  icon?: CSSInterpolation;
  list?: {
    root?: CSSInterpolation;
    item?: CSSInterpolation;
  };
};

type FindColumnDropdown = {
  root?: CSSInterpolation;
  icon?: CSSInterpolation;
  list?: {
    root?: CSSInterpolation;
    item?: CSSInterpolation;
    checkbox?: CSSInterpolation;
    selectedItem?: CSSInterpolation;
  };
};

type SmartTableThemeAPI = {
  th?: {
    menuIcon?: CSSInterpolation;
    expandIcon?: CSSInterpolation;
    loadingIcon?: CSSInterpolation;
  };
  contextMenu?: {
    root?: CSSInterpolation;
    item?: {
      root?: CSSInterpolation;
      label?: CSSInterpolation;
      icon?: CSSInterpolation;
      popover?: CSSInterpolation;
    };
    filter?: {
      root?: CSSInterpolation;
      dropdown?: FilterConditionDropdown;
      radioButton?: {
        root?: CSSInterpolation;
        radio?: CSSInterpolation;
      };
      input?: {
        root?: CSSInterpolation;
        icon?: CSSInterpolation;
      };
      label?: CSSInterpolation;
      valueList?: {
        root?: CSSInterpolation;
        item?: CSSInterpolation;
        checkbox?: CSSInterpolation;
        emptyIcon?: CSSInterpolation;
      };
      outlineButton?: CSSInterpolation;
      primaryButton?: CSSInterpolation;
      secondButton?: CSSInterpolation;
    };
  };
  findAndReplaceButton?: CSSInterpolation;
  findAndReplaceMenu?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    label?: CSSInterpolation;
    checkbox?: CSSInterpolation;
    checkboxLabel?: CSSInterpolation;
    input?: CSSInterpolation;
    infoText?: CSSInterpolation;
    primaryButton?: CSSInterpolation;
    dropdown?: FindColumnDropdown;
    closeIcon?: CSSInterpolation;
  };
  freezeBoxShadow?: CSSObject['boxShadow'];
};

export type SubmitModalSummaryAPI = {
  root?: CSSInterpolation;
  icon?: CSSInterpolation;
  title?: CSSInterpolation;
  value?: CSSInterpolation;
  iconBox?: CSSInterpolation;
};

export type ReviewEntriesThemeAPI = {
  root?: CSSInterpolation;
  pageHeader?: HeaderThemeAPI;
  table?: {
    th?: CSSInterpolation;
    td?: {
      root?: CSSInterpolation;
      normal?: CSSInterpolation;
      error?: CSSInterpolation;
      warning?: CSSInterpolation;
      info?: CSSInterpolation;
      addColumn?: CSSInterpolation;
    };
    selectedBackground?: {
      normal?: string;
      error?: string;
      warning?: string;
      info?: string;
    };
    scrollbar?: {
      navigatorColor?: string;
      backgroundColor?: string;
    };
    example?: CSSInterpolation;
    dragStyle?: {
      color?: string;
      style?: string;
    };
  };
  selectRowColor?: string;
  edit?: {
    number?: CSSInterpolation;
    string?: CSSInterpolation;
    percentage?: CSSInterpolation;
    currency?: CSSInterpolation;
    date?: CSSInterpolation;
    time?: CSSInterpolation;
    boolean?: {
      button?: {
        closeIcon?: CSSInterpolation;
        arrowIcon?: CSSInterpolation;
      };
      item?: {
        root?: CSSInterpolation;
        option?: CSSInterpolation;
        selectedOption?: CSSInterpolation;
      };
    };
    category?: {
      header?: CSSInterpolation;
      search?: {
        root?: CSSInterpolation;
        icon?: CSSInterpolation;
        placeholder?: string;
      };
      button?: {
        closeIcon?: CSSInterpolation;
        arrowIcon?: CSSInterpolation;
      };
      item?: {
        root?: CSSInterpolation;
        option?: CSSInterpolation;
        selectedOption?: CSSInterpolation;
      };
      multiSelectionBadge?: {
        root?: CSSInterpolation;
        icon?: CSSInterpolation;
      };
      iconCheckedColor?: string;
      createNewOption?: {
        root?: CSSInterpolation;
        icon?: CSSInterpolation;
      };
    };
  };
  selectedBackground?: {
    normal?: string;
    error?: string;
    warning?: string;
    info?: string;
  };
  icon?: CSSInterpolation;
  infoIcon?: CSSInterpolation;
  fullScreen?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  rowHeader?: {
    checkbox?: CSSInterpolation;
    allCheckbox?: CSSInterpolation;
  };
  addRowButton?: CSSInterpolation;
  duplicateButton?: CSSInterpolation;
  clearFilterButton?: CSSInterpolation;
  removeButton?: CSSInterpolation;
  selectedBadge?: CSSInterpolation;
  smartTable?: SmartTableThemeAPI;
  dialogCreateCustomColumn?: DialogCreateCustomColumn;
  dialogCreateCustomOption?: DialogCreateCustomOption;
  addColumnButton?: CSSInterpolation;
  undoButton?: CSSInterpolation;
  redoButton?: CSSInterpolation;
  toggleViewButton?: {
    item?: CSSInterpolation;
    selected?: CSSInterpolation;
    allRows?: CSSInterpolation;
    errorRows?: CSSInterpolation;
    root?: CSSInterpolation;
  };
  submitModal?: Omit<DialogThemeAPI, 'scrollbar'> & {
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    icon?: CSSInterpolation;
    cleanRow?: SubmitModalSummaryAPI;
    errorRow?: SubmitModalSummaryAPI;
  };
  successModal?: Omit<DialogThemeAPI, 'scrollbar'> & {
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    icon?: CSSInterpolation;
    importRow?: SubmitModalSummaryAPI;
    failRow?: SubmitModalSummaryAPI;
    header?: CSSInterpolation;
  };
  submitLoading?: IFullLoadingPageThemeAPI;
  automaticInfo?: {
    root?: CSSInterpolation;
    wrapper?: CSSInterpolation;
    infoIcon?: CSSInterpolation;
    title?: CSSInterpolation;
    closeIcon?: CSSInterpolation;
    description?: CSSInterpolation;
  };
  additionalInfo?: IAdditionalInfoTheme;
};

type SheetSelectThemeAPI = {
  root?: CSSInterpolation;
  pageHeader?: HeaderThemeAPI;
  header?: CSSInterpolation;
  sheetName?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    border?: CSSInterpolation;
  };
  grid?: {
    container?: CSSInterpolation;
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    checkbox?: CSSInterpolation;
    illustration?: {
      borderColor?: string;
      headerColor?: string;
      cellColor?: string;
      outlineColor?: string;
    };
    checked?: {
      root?: CSSInterpolation;
      title?: CSSInterpolation;
      description?: CSSInterpolation;
      checkbox?: CSSInterpolation;
      illustration?: {
        borderColor?: string;
        headerColor?: string;
        cellColor?: string;
        outlineColor?: string;
      };
    };
  };
  list?: {
    container?: CSSInterpolation;
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    checkbox?: CSSInterpolation;
    checked?: {
      root?: CSSInterpolation;
      title?: CSSInterpolation;
      description?: CSSInterpolation;
      checkbox?: CSSInterpolation;
    };
  };
  pagination?: {
    root?: CSSInterpolation;
    pageButton?: CSSInterpolation;
    pageMore?: CSSInterpolation;
    currentPageButton?: CSSInterpolation;
    nextButton?: CSSInterpolation;
    prevButton?: CSSInterpolation;
  };
  icon?: CSSInterpolation;
  sheetLists?: {
    root?: CSSInterpolation;
  };
  unSelectSheetName?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    border?: CSSInterpolation;
  };
  scrollbar?: {
    navigatorColor?: string;
    backgroundColor?: string;
  };
  addFileButton?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
  sheetPreview?: SheetPreviewThemeAPI & {
    listButton?: CSSInterpolation;
    gridButton?: CSSInterpolation;
  };
  additionalInfo?: IAdditionalInfoTheme;
};

export type SheetItemThemeAPI = {
  root?: CSSInterpolation;
  addButton?: CSSInterpolation;
  removeButton?: CSSInterpolation;
  previewButton?: CSSInterpolation;
  title?: CSSInterpolation;
  description?: CSSInterpolation;
  addMenu?: {
    root?: CSSInterpolation;
    item?: CSSInterpolation;
  };
};

export type JoinSheetTableThemeAPI = {
  root?: CSSInterpolation;
  badge?: CSSInterpolation;
  th?: CSSInterpolation;
  td?: CSSInterpolation;
  scrollbar?: {
    navigatorColor?: string;
    backgroundColor?: string;
  };
  empty?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    description?: CSSInterpolation;
    content?: CSSInterpolation;
  };
};

type JoinSheetCommonDialogThemeAPI = {
  root?: CSSInterpolation;
  overlay?: CSSInterpolation;
  closeIcon?: CSSInterpolation;
  title?: CSSInterpolation;
  description?: CSSInterpolation;
  dropdown?: ColumnDropdownThemeAPI;
  errorMessage?: CSSInterpolation;
  label?: CSSInterpolation;
  asterisk?: CSSInterpolation;
  scrollbar?: {
    navigatorColor?: string;
    backgroundColor?: string;
  };
};

export type ColumnDropdownThemeAPI = {
  root?: CSSInterpolation;
  button?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    placeholder?: CSSInterpolation;
  };
  search?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    placeholder?: CSSInterpolation;
  };
  badge?: CSSInterpolation;
  joinBadge?: CSSInterpolation;
  scrollbar?: {
    navigatorColor?: string;
    backgroundColor?: string;
  };
  header?: CSSInterpolation;
  option?: CSSInterpolation;
  selectedOption?: CSSInterpolation;
};

export type JoinSheetMatchStatus = {
  success?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    percent?: CSSInterpolation;
    description?: CSSInterpolation;
  };
  warning?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    percent?: CSSInterpolation;
    description?: CSSInterpolation;
  };
  loading?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
};

export type JoinColumnsDialogThemeAPI = JoinSheetCommonDialogThemeAPI & {
  deleteButton?: CSSInterpolation;
  matchStatus?: JoinSheetMatchStatus;
};

export type AppendColumnsDialogThemeAPI = JoinSheetCommonDialogThemeAPI & {
  appendColumn?: CSSInterpolation;
};

type InfoBoxThemeAPI = {
  root?: CSSInterpolation;
  wrapper?: CSSInterpolation;
  infoIcon?: CSSInterpolation;
  title?: CSSInterpolation;
  closeIcon?: CSSInterpolation;
  description?: CSSInterpolation;
};

type JoinSheetThemeAPI = {
  root?: CSSInterpolation;
  pageHeader?: HeaderThemeAPI;
  content?: CSSInterpolation;
  sheetSelection?: {
    root?: CSSInterpolation;
    title?: CSSInterpolation;
    badge?: CSSInterpolation;
    sheet?: SheetItemThemeAPI;
    joinedSheets?: {
      root?: CSSInterpolation;
    };
    unselectedSheets?: {
      root?: CSSInterpolation;
    };
    empty?: CSSInterpolation;
    scrollbar?: {
      navigatorColor?: string;
      backgroundColor?: string;
    };
  };
  sheetPreview?: SheetPreviewThemeAPI;
  table?: JoinSheetTableThemeAPI;
  joinPopover?: CSSInterpolation;
  joinColumnsDialog?: JoinColumnsDialogThemeAPI;
  appendColumnsDialog?: AppendColumnsDialogThemeAPI;
  removedSheet?: {
    root?: CSSInterpolation;
    sheetName?: CSSInterpolation;
  };
  additionalInfo?: IAdditionalInfoTheme;
  infoBox?: InfoBoxThemeAPI;
};

export type SheetPreviewTableThemeAPI = {
  root?: CSSInterpolation;
  th?: CSSInterpolation;
  td?: CSSInterpolation;
  scrollbarNavigatorColor?: string;
  scrollbarBackgroundColor?: string;
};

export type SheetPreviewThemeAPI = {
  title?: CSSInterpolation;
  fileName?: CSSInterpolation;
  sheetName?: CSSInterpolation;
  table?: SheetPreviewTableThemeAPI;
};

export type CleaningAssistantThemeAPI = {
  root?: CSSInterpolation;
  toggle?: {
    root?: CSSInterpolation;
    sparkleA?: CSSInterpolation;
    sparkleB?: CSSInterpolation;
    icon?: CSSInterpolation;
    badge?: CSSInterpolation;
  };
  suggestionList?: {
    root?: CSSInterpolation;
    header?: CSSInterpolation;
    headerCheckbox?: CSSInterpolation;
    headerCheckboxLabel?: CSSInterpolation;
  };
  suggestion?: {
    root?: CSSInterpolation;
    newValue?: CSSInterpolation;
    oldValue?: CSSInterpolation;
    oldValueEmpty?: CSSInterpolation;
    checkbox?: CSSInterpolation;
    details?: CSSInterpolation;
    actions?: CSSInterpolation;
    findButton?: CSSInterpolation;
    dismissButton?: CSSInterpolation;
    applyButton?: CSSInterpolation;
  };
  loadingState?: {
    root?: CSSInterpolation;
    skeleton?: CSSInterpolation;
  };
  emptyState?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    title?: CSSInterpolation;
    text?: CSSInterpolation;
  };
  message?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    text?: CSSInterpolation;
  };
  dropdown?: {
    root?: CSSInterpolation;
    messageContainer?: CSSInterpolation;
    header?: CSSInterpolation;
    headerBack?: CSSInterpolation;
    headerText?: CSSInterpolation;
    headerTag?: CSSInterpolation;
    headerActions?: CSSInterpolation;
    headerActionRepeat?: CSSInterpolation;
    headerActionRepeatSpinner?: CSSInterpolation;
    headerActionRepeatSpinnerInner?: CSSInterpolation;
    headerActionClose?: CSSInterpolation;
    body?: CSSInterpolation;
    footer?: CSSInterpolation;
    footerSelected?: CSSInterpolation;
    footerActions?: CSSInterpolation;
    footerDismiss?: CSSInterpolation;
    footerApply?: CSSInterpolation;
    footerApplySpinner?: CSSInterpolation;
    footerApplySpinnerInner?: CSSInterpolation;
  };
  cleaningGroupList?: {
    root?: CSSInterpolation;
  };
  cleaningGroup?: {
    root?: CSSInterpolation;
    name?: CSSInterpolation;
    divider?: CSSInterpolation;
    count?: CSSInterpolation;
    icon?: CSSInterpolation;
  };
};

export type IFullLoadingPageThemeAPI = {
  root?: CSSInterpolation;
  icon?: CSSInterpolation;
};

export type ContextualEngineThemeAPI = {
  loading?: IFullLoadingPageThemeAPI;
  prompt?: {
    root?: CSSInterpolation;
    icon?: CSSInterpolation;
    cancelButton?: CSSInterpolation;
    confirmButton?: CSSInterpolation;
  };
};

export type LanguageType =
  | 'de'
  | 'en'
  | 'es'
  | 'fr'
  | 'it'
  | 'nl'
  | 'pl'
  | 'pt'
  | 'sv'
  | 'cz'
  | 'dk'
  | 'hu'
  | 'lt'
  | 'no'
  | 'ru'
  | 'sk'
  | 'zh';

export type DynamicStepValues =
  | 'header'
  | 'mapping'
  | 'review'
  | 'sheetSelection';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type UploadData = any[] | Record<string, any>;

export type SheetSelectionUploadData = {
  fileName: string;
  sheets: { sheetName: string; data: UploadData }[];
}[];

export type UploadOptions = {
  step: DynamicStepValues;
  headerIndex?: number;
  data: UploadData;
};

export type ParseFiles = FileList | File[];
export type ValueType = boolean | number | string | null | undefined;
export type IParseSheet = {
  sheetName: string;
  data: ValueType[][];
};

export type IParseFile = {
  fileName: string;
  sheets: IParseSheet[];
};

export type OnEntryChangeLogs = {
  columns?: ImportLogsColumns;
};

export enum ContextualEngineMode {
  ENABLED = 'enabled',
  DISABLED = 'disabled',
  PROMPT = 'prompt',
}

export type ContextualEngineType = `${ContextualEngineMode}`;

export type ProcessingMode = 'node' | 'browser';

export type MappingLayer = 'exact' | 'historic' | 'smart' | 'fuzzy';

export type MappingLayers = MappingLayer[];

export type IMappingConfiguration = {
  layers?: MappingLayers;
  threshold?: number;
  processingMode?: ProcessingMode;
};

export type ISubmitModalConfiguration = {
  exportButton?: boolean;
  importSummary?: boolean;
  display?: boolean;
};

export type ISuccessModalConfiguration = {
  importSummary?: boolean;
  display?: boolean;
};

export type ImporterSessionVerifyResult = {
  verified: boolean;
  identifier: string;
};

export type ImporterSessionVerifyOptions = {
  identifier?: string;
};

export type ImporterSessionParseOptions = {
  data: ParseFiles;
  identifier?: string;
};

export type ImporterSessionParseResult = {
  accepted: IParseFile[];
  rejected: IParseFile[];
};

export type ImporterSessionUploadOptions = {
  step: DynamicStepValues;
  data: UploadData;
  headerIndex?: number;
  identifier?: string;
};

export type ImporterSessionStartOptions = {
  identifier?: string;
};

export type ImporterSessionReloadOptions = ImporterSessionStartOptions;

export declare const ImporterSession: {
  upload: (options?: ImporterSessionUploadOptions) => Promise<void>;
  parse: (
    options?: ImporterSessionParseOptions
  ) => Promise<ImporterSessionParseResult>;
  start: (options?: ImporterSessionStartOptions) => void;
  verify: (
    options?: ImporterSessionVerifyOptions
  ) => Promise<ImporterSessionVerifyResult>;
  reload: (options?: ImporterSessionReloadOptions) => Promise<void>;
};
