import { DocBlock, EditorDoc, BlockBase } from "./doc"; export interface ParserHandler { onBeginBlock?: (doc: EditorDoc, blockId: string, type: string, blockData: DocBlock, parentBlock: DocBlock | null) => void; onText?: (doc: EditorDoc, blockId: string, text: string, attributes: { [index: string]: any; }) => void; onEndBlock?: (doc: EditorDoc, blockId: string) => void; } export interface ParseTableHandler { onBeginTable?: (doc: EditorDoc, tableId: string, cols: number, rows: number, blockData: DocBlock) => void; onTableCell?: (doc: EditorDoc, col: number, row: number, cellId: string, virtual: boolean, blocks: DocBlock[]) => void; onEndTable?: (doc: EditorDoc, tableId: string) => void; } export interface ParseComplexHandler { onChild?: (doc: EditorDoc, containerId: string, blocks: DocBlock[]) => void; } export interface CellGridData { cellId: string; row: number; col: number; colSpan: number; rowSpan: number; virtual?: boolean; } export declare class CellRow { private _cells; constructor(cols: number); cols(): number; setCell(col: number, cell: CellGridData): void; getCell(col: number): CellGridData; getCellAllowEmpty(col: number): CellGridData | undefined; getNextNonVirtualCell(col: number): CellGridData | undefined; forEach(callbackfn: (value: CellGridData, index: number, array: CellGridData[]) => void): void; } export interface CellIndex { row: number; col: number; } export declare class CellGrid { private _data; private _rows; constructor(tableData: BlockBase); get rowCount(): any; get colCount(): any; getNextEmptyCell(col: number, row: number): { col: number; row: number; } | null; fillGrid(): void; getCell(index: CellIndex): CellGridData; getRow(row: number): CellRow; forEach(callbackfn: (value: CellRow, index: number, array: CellRow[]) => void): void; } export declare function parseBlocks(doc: EditorDoc, blocks: DocBlock[], parentBlock: DocBlock | null, handler: ParserHandler): void; export declare function parseComplexBlock(doc: EditorDoc, block: DocBlock, handler: ParseComplexHandler): void; export declare function parseTable(doc: EditorDoc, block: DocBlock, handler: ParseTableHandler): void; export declare function parseDoc(doc: EditorDoc, handler: ParserHandler): void; export declare function parseAllText(doc: EditorDoc, handler: ParserHandler): void; export declare function enumAllBlocks(doc: EditorDoc, onBeginBlock: (doc: EditorDoc, id: string, type: string, block: DocBlock, parent: DocBlock | null) => void): void;