UNPKG

1.83 kBTypeScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5/**
6 * @module table/converters/upcasttable
7 */
8import type { UpcastDispatcher } from 'ckeditor5/src/engine';
9/**
10 * Returns a function that converts the table view representation:
11 *
12 * ```xml
13 * <figure class="table"><table>...</table></figure>
14 * ```
15 *
16 * to the model representation:
17 *
18 * ```xml
19 * <table></table>
20 * ```
21 */
22export declare function upcastTableFigure(): (dispatcher: UpcastDispatcher) => void;
23/**
24 * View table element to model table element conversion helper.
25 *
26 * This conversion helper converts the table element as well as table rows.
27 *
28 * @returns Conversion helper.
29 */
30export default function upcastTable(): (dispatcher: UpcastDispatcher) => void;
31/**
32 * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.
33 *
34 * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells
35 * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only
36 * rows that have related `tableRow` elements).
37 *
38 * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue
39 * of an improper table with all empty rows.
40 *
41 * @returns Conversion helper.
42 */
43export declare function skipEmptyTableRow(): (dispatcher: UpcastDispatcher) => void;
44/**
45 * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.
46 *
47 * @returns Conversion helper.
48 */
49export declare function ensureParagraphInTableCell(elementName: string): (dispatcher: UpcastDispatcher) => void;