UNPKG

2.12 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/tableproperties
7 */
8import type { Conversion, ViewElement } from 'ckeditor5/src/engine';
9/**
10 * Conversion helper for upcasting attributes using normalized styles.
11 *
12 * @param options.modelAttribute The attribute to set.
13 * @param options.styleName The style name to convert.
14 * @param options.viewElement The view element name that should be converted.
15 * @param options.defaultValue The default value for the specified `modelAttribute`.
16 * @param options.shouldUpcast The function which returns `true` if style should be upcasted from this element.
17 */
18export declare function upcastStyleToAttribute(conversion: Conversion, options: {
19 modelAttribute: string;
20 styleName: string;
21 viewElement: string | RegExp;
22 defaultValue: string;
23 reduceBoxSides?: boolean;
24 shouldUpcast?: (viewElement: ViewElement) => boolean;
25}): void;
26export interface StyleValues {
27 color: string;
28 style: string;
29 width: string;
30}
31/**
32 * Conversion helper for upcasting border styles for view elements.
33 *
34 * @param defaultBorder The default border values.
35 * @param defaultBorder.color The default `borderColor` value.
36 * @param defaultBorder.style The default `borderStyle` value.
37 * @param defaultBorder.width The default `borderWidth` value.
38 */
39export declare function upcastBorderStyles(conversion: Conversion, viewElementName: string, modelAttributes: StyleValues, defaultBorder: StyleValues): void;
40/**
41 * Conversion helper for downcasting an attribute to a style.
42 */
43export declare function downcastAttributeToStyle(conversion: Conversion, options: {
44 modelElement: string;
45 modelAttribute: string;
46 styleName: string;
47}): void;
48/**
49 * Conversion helper for downcasting attributes from the model table to a view table (not to `<figure>`).
50 */
51export declare function downcastTableAttribute(conversion: Conversion, options: {
52 modelAttribute: string;
53 styleName: string;
54}): void;