import SpreadSheetProvider from './SpreadSheetProvider';
import { Props, IRowWithCell as IRowWithCell_ } from './SpreadSheetProvider/index.data';
import commands from './commands';
import * as helpers from './helper';
import { registerCellType, removeCellType, NumericEditor } from './cellTypes';
import { IEditor as IEditor_, EditorProps as EditorProps_ } from './cellTypes/index.data';
import { IRenderer as IRenderer_, RendererProps as RendererProps_ } from './cellTypes/index.data';
import { BaseInputEditor, BasePickableRenderer, TextRenderer, NumericRenderer } from './cellTypes';

import { EDITOR_MACHINE_EVENT_BUS, BEFORE_EXIT_EDITING, PICK_CELL } from './StateMachine';

export default SpreadSheetProvider;
export type SpreadSheetProps = Props;
export type IRowWithCell = IRowWithCell_;
export type IEditor<T> = IEditor_<T>;
export type IRenderer<T> = IRenderer_<T>;
export type EditorProps<T> = EditorProps_<T>;
export type RendererProps<T> = RendererProps_<T>;

export * from './index.data';
/**
 * commands: 实现了命令模式的各种命令, 与 commandManager一起使用
 * helpers: 辅助函数, 用于从state中提取数据
 * registerCellType: 注册其它单元格类型 ( 主要是注册单元格的renderer与editor )
 */
export { commands, helpers, registerCellType, removeCellType, NumericEditor };
export { BaseInputEditor, BasePickableRenderer, TextRenderer, NumericRenderer };

// 状态机常数
export { EDITOR_MACHINE_EVENT_BUS, BEFORE_EXIT_EDITING, PICK_CELL };

import { SHEET_MESSAGE_EVENT_BUS, FSM_IGNORE } from './constants';
export { SHEET_MESSAGE_EVENT_BUS, FSM_IGNORE };
