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 | import type { Element, ElementCreatorFunction } from 'ckeditor5/src/engine';
|
6 | import type TableUtils from '../tableutils';
|
7 | import type { AdditionalSlot } from '../tableediting';
|
8 | /**
|
9 | * Model table element to view table element conversion helper.
|
10 | */
|
11 | export declare function downcastTable(tableUtils: TableUtils, options: DowncastTableOptions): ElementCreatorFunction;
|
12 | /**
|
13 | * Model table row element to view `<tr>` element conversion helper.
|
14 | *
|
15 | * @returns Element creator.
|
16 | */
|
17 | export declare function downcastRow(): ElementCreatorFunction;
|
18 | /**
|
19 | * Model table cell element to view `<td>` or `<th>` element conversion helper.
|
20 | *
|
21 | * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
|
22 | * and `<td>` otherwise.
|
23 | *
|
24 | * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
|
25 | * @returns Element creator.
|
26 | */
|
27 | export declare function downcastCell(options?: {
|
28 | asWidget?: boolean;
|
29 | }): ElementCreatorFunction;
|
30 | /**
|
31 | * Overrides paragraph inside table cell conversion.
|
32 | *
|
33 | * This converter:
|
34 | * * should be used to override default paragraph conversion.
|
35 | * * It will only convert `<paragraph>` placed directly inside `<tableCell>`.
|
36 | * * For a single paragraph without attributes it returns `<span>` to simulate data table.
|
37 | * * For all other cases it returns `<p>` element.
|
38 | *
|
39 | * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
|
40 | * @returns Element creator.
|
41 | */
|
42 | export declare function convertParagraphInTableCell(options?: {
|
43 | asWidget?: boolean;
|
44 | }): ElementCreatorFunction;
|
45 | /**
|
46 | * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.
|
47 | *
|
48 | * The paragraph should be converted in the editing view to:
|
49 | *
|
50 | * * If returned `true` - to a `<span class="ck-table-bogus-paragraph">`
|
51 | * * If returned `false` - to a `<p>`
|
52 | */
|
53 | export declare function isSingleParagraphWithoutAttributes(modelElement: Element): boolean;
|
54 | export interface DowncastTableOptions {
|
55 | /**
|
56 | * If set to `true`, the downcast conversion will produce a widget.
|
57 | */
|
58 | asWidget?: boolean;
|
59 | /**
|
60 | * Array of additional slot handlers.
|
61 | */
|
62 | additionalSlots: Array<AdditionalSlot>;
|
63 | }
|