import * as React from 'react'; import { ListRenderItemInfo, TextStyle } from 'react-native'; import { AlignType, ContentRow, ContentState, InsertRowEvent, RenderItemInputData, Selection, SelectionChangeEvent } from './models'; interface Props { data: ContentState; onFocus?: (e: any) => void; onChange?: (e: any) => void; extraData: any; imageHandler?: (image: string) => Promise; editable?: boolean; headerVisible?: boolean; footerVisible?: boolean; emptyVisible?: boolean; } interface State { isReady: boolean; isFullscreen: boolean; isSketchVisible: boolean; rows: ContentRow[]; extraData: any; activeRowIndex: number; selection: Selection; activeStyles: string[]; } declare class Editor extends React.Component { textInputRefs: any[]; sketch: null; lastBlock: {}; constructor(props: Props); componentDidMount(): void; componentWillUnmount(): void; initialize: () => void; fillContentState: () => void; reload: () => void; refresh: () => void; clear: () => void; hideKeyboard(): void; toggleFullscreen: () => void; toggleStyle: ({ style }: { style: string; }) => void; changeColorStyles: ({ color, type }: any) => void; clearStyles: () => void; alignRow: ({ type }: { type: AlignType; }) => void; deleteActiveRow: () => void; showChangeRowType: () => void; showInsertRow: () => void; showUploadFile: () => void; insertImage: ({ type }: { type: 'Take Photo' | 'Browse Photo'; }) => Promise; duplicateRow: () => void; emitActiveStyles: ({ activeStyles, updateState, }?: { activeStyles: string[]; updateState: boolean; }, callback?: () => void) => void; changeRowIndex: ({ direction }: any) => void; changeRowIndent: ({ direction }: { direction: string; }) => void; splitRow: ({ row, index }: any) => void; showSketchModal: () => void; /** * TODO: re-write * beginning press enter: insert new block before (keep type if is list) * middle press enter: split row at cursor * end press enter: insert new block after (keep type if is list) */ onSubmitEditing: ({ row, index }: any) => () => void; onChangeText: ({ row, index }: any) => (nv?: string) => void; handleBackspace: ({ row: item, index, }: { row: ContentRow; index: number; }) => void; getRowValue: ({ index }: any) => any; handleKeyPress: ({ row: item, index }: any) => ({ nativeEvent: { key: keyValue }, }: any) => void; onSelectionChange: ({ row, index, value }: SelectionChangeEvent) => (event: any) => void; onFocus: ({ index }: { index: number; }) => (_e: any) => void; getContentState: () => ContentState; checkActiveRowTypeChanged: () => void; focusRow({ index, timeout, clearStyles }: any, callback?: () => void): void; insertRow({ type, focus, focusIndex, newRowData, currentRow, insertAtActive, insertAfterActive, insertBeforeActive, insertAtLast, updateActiveIndex, }: InsertRowEvent, callback?: (_e: any) => void): void; insertHeading: ({ heading }: any) => void; insertList: ({ list }: any) => void; removeRow({ index, focusPrev }: any, callback?: () => void): void; emitOnChange: () => void; changeRowType({ index, type }: any): void; handleImage: ({ _row, index }: any) => () => void; toggleTodo: ({ row, index }: { row: ContentRow; index: number; }) => () => void; onSketchSave: (image: any) => void; getPlaceholder: ({ row, index }: any) => "" | "Heading 1" | "Heading 2" | "Heading 3" | "Blockquote" | "Write..." | "List"; getInputStyles: ({ row }: RenderItemInputData) => {}; getNumberOrder: ({ index }: RenderItemInputData) => number; getAlignStyles: ({ row }: RenderItemInputData) => TextStyle; renderInput: ({ row, index }: RenderItemInputData) => JSX.Element; renderItem: ({ item: row, index }: ListRenderItemInfo) => JSX.Element; renderImage: ({ row, index }: RenderItemInputData) => JSX.Element; renderLineBreak: ({ row, index }: RenderItemInputData) => JSX.Element; renderFooter: () => JSX.Element; renderEmpty: () => JSX.Element; renderLoading: () => JSX.Element; renderHeader: () => JSX.Element; renderList(): JSX.Element; renderFullScreen(): JSX.Element; render(): JSX.Element; } export default Editor;