@ckeditor/ckeditor5-engine 36.0.1 → 37.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +1 -1
  2. package/package.json +24 -23
  3. package/src/controller/datacontroller.d.ts +331 -0
  4. package/src/controller/datacontroller.js +62 -109
  5. package/src/controller/editingcontroller.d.ts +98 -0
  6. package/src/controller/editingcontroller.js +22 -46
  7. package/src/conversion/conversion.d.ts +476 -0
  8. package/src/conversion/conversion.js +328 -347
  9. package/src/conversion/conversionhelpers.d.ts +26 -0
  10. package/src/conversion/conversionhelpers.js +1 -5
  11. package/src/conversion/downcastdispatcher.d.ts +547 -0
  12. package/src/conversion/downcastdispatcher.js +74 -152
  13. package/src/conversion/downcasthelpers.d.ts +1226 -0
  14. package/src/conversion/downcasthelpers.js +843 -762
  15. package/src/conversion/mapper.d.ts +499 -0
  16. package/src/conversion/mapper.js +84 -99
  17. package/src/conversion/modelconsumable.d.ts +201 -0
  18. package/src/conversion/modelconsumable.js +96 -99
  19. package/src/conversion/upcastdispatcher.d.ts +492 -0
  20. package/src/conversion/upcastdispatcher.js +73 -100
  21. package/src/conversion/upcasthelpers.d.ts +499 -0
  22. package/src/conversion/upcasthelpers.js +406 -373
  23. package/src/conversion/viewconsumable.d.ts +177 -0
  24. package/src/conversion/viewconsumable.js +157 -162
  25. package/src/dataprocessor/basichtmlwriter.d.ts +18 -0
  26. package/src/dataprocessor/basichtmlwriter.js +0 -9
  27. package/src/dataprocessor/dataprocessor.d.ts +61 -0
  28. package/src/dataprocessor/htmldataprocessor.d.ts +76 -0
  29. package/src/dataprocessor/htmldataprocessor.js +6 -28
  30. package/src/dataprocessor/htmlwriter.d.ts +16 -0
  31. package/src/dataprocessor/xmldataprocessor.d.ts +90 -0
  32. package/src/dataprocessor/xmldataprocessor.js +8 -40
  33. package/src/dev-utils/model.d.ts +124 -0
  34. package/src/dev-utils/model.js +41 -38
  35. package/src/dev-utils/operationreplayer.d.ts +51 -0
  36. package/src/dev-utils/operationreplayer.js +6 -14
  37. package/src/dev-utils/utils.d.ts +37 -0
  38. package/src/dev-utils/utils.js +5 -18
  39. package/src/dev-utils/view.d.ts +319 -0
  40. package/src/dev-utils/view.js +205 -226
  41. package/src/index.d.ts +105 -0
  42. package/src/index.js +1 -0
  43. package/src/model/batch.d.ts +106 -0
  44. package/src/model/differ.d.ts +329 -0
  45. package/src/model/document.d.ts +245 -0
  46. package/src/model/document.js +1 -1
  47. package/src/model/documentfragment.d.ts +196 -0
  48. package/src/model/documentfragment.js +2 -2
  49. package/src/model/documentselection.d.ts +420 -0
  50. package/src/model/element.d.ts +165 -0
  51. package/src/model/history.d.ts +114 -0
  52. package/src/model/item.d.ts +14 -0
  53. package/src/model/liveposition.d.ts +77 -0
  54. package/src/model/liverange.d.ts +102 -0
  55. package/src/model/markercollection.d.ts +335 -0
  56. package/src/model/model.d.ts +812 -0
  57. package/src/model/model.js +59 -30
  58. package/src/model/node.d.ts +256 -0
  59. package/src/model/nodelist.d.ts +91 -0
  60. package/src/model/operation/attributeoperation.d.ts +98 -0
  61. package/src/model/operation/detachoperation.d.ts +55 -0
  62. package/src/model/operation/insertoperation.d.ts +85 -0
  63. package/src/model/operation/markeroperation.d.ts +86 -0
  64. package/src/model/operation/mergeoperation.d.ts +95 -0
  65. package/src/model/operation/moveoperation.d.ts +91 -0
  66. package/src/model/operation/nooperation.d.ts +33 -0
  67. package/src/model/operation/operation.d.ts +89 -0
  68. package/src/model/operation/operationfactory.d.ts +18 -0
  69. package/src/model/operation/renameoperation.d.ts +78 -0
  70. package/src/model/operation/rootattributeoperation.d.ts +97 -0
  71. package/src/model/operation/rootattributeoperation.js +1 -1
  72. package/src/model/operation/splitoperation.d.ts +104 -0
  73. package/src/model/operation/transform.d.ts +100 -0
  74. package/src/model/operation/utils.d.ts +71 -0
  75. package/src/model/position.d.ts +539 -0
  76. package/src/model/position.js +1 -1
  77. package/src/model/range.d.ts +458 -0
  78. package/src/model/range.js +1 -1
  79. package/src/model/rootelement.d.ts +40 -0
  80. package/src/model/schema.d.ts +1176 -0
  81. package/src/model/schema.js +15 -15
  82. package/src/model/selection.d.ts +472 -0
  83. package/src/model/text.d.ts +66 -0
  84. package/src/model/text.js +0 -2
  85. package/src/model/textproxy.d.ts +144 -0
  86. package/src/model/treewalker.d.ts +186 -0
  87. package/src/model/treewalker.js +19 -10
  88. package/src/model/typecheckable.d.ts +255 -0
  89. package/src/model/utils/autoparagraphing.d.ts +37 -0
  90. package/src/model/utils/deletecontent.d.ts +58 -0
  91. package/src/model/utils/findoptimalinsertionrange.d.ts +32 -0
  92. package/src/model/utils/getselectedcontent.d.ts +30 -0
  93. package/src/model/utils/insertcontent.d.ts +46 -0
  94. package/src/model/utils/insertcontent.js +2 -12
  95. package/src/model/utils/insertobject.d.ts +44 -0
  96. package/src/model/utils/insertobject.js +3 -14
  97. package/src/model/utils/modifyselection.d.ts +48 -0
  98. package/src/model/utils/selection-post-fixer.d.ts +65 -0
  99. package/src/model/writer.d.ts +726 -0
  100. package/src/model/writer.js +6 -4
  101. package/src/view/attributeelement.d.ts +108 -0
  102. package/src/view/attributeelement.js +25 -69
  103. package/src/view/containerelement.d.ts +49 -0
  104. package/src/view/containerelement.js +10 -43
  105. package/src/view/datatransfer.d.ts +75 -0
  106. package/src/view/document.d.ts +184 -0
  107. package/src/view/document.js +15 -84
  108. package/src/view/documentfragment.d.ts +150 -0
  109. package/src/view/documentfragment.js +40 -81
  110. package/src/view/documentselection.d.ts +219 -0
  111. package/src/view/documentselection.js +75 -121
  112. package/src/view/domconverter.d.ts +620 -0
  113. package/src/view/domconverter.js +159 -276
  114. package/src/view/downcastwriter.d.ts +804 -0
  115. package/src/view/downcastwriter.js +336 -380
  116. package/src/view/editableelement.d.ts +52 -0
  117. package/src/view/editableelement.js +9 -49
  118. package/src/view/element.d.ts +466 -0
  119. package/src/view/element.js +150 -222
  120. package/src/view/elementdefinition.d.ts +87 -0
  121. package/src/view/emptyelement.d.ts +41 -0
  122. package/src/view/emptyelement.js +11 -44
  123. package/src/view/filler.d.ts +111 -0
  124. package/src/view/filler.js +24 -21
  125. package/src/view/item.d.ts +14 -0
  126. package/src/view/matcher.d.ts +486 -0
  127. package/src/view/matcher.js +247 -218
  128. package/src/view/node.d.ts +160 -0
  129. package/src/view/node.js +26 -100
  130. package/src/view/observer/arrowkeysobserver.d.ts +41 -0
  131. package/src/view/observer/arrowkeysobserver.js +0 -13
  132. package/src/view/observer/bubblingemittermixin.d.ts +166 -0
  133. package/src/view/observer/bubblingemittermixin.js +36 -25
  134. package/src/view/observer/bubblingeventinfo.d.ts +47 -0
  135. package/src/view/observer/bubblingeventinfo.js +3 -29
  136. package/src/view/observer/clickobserver.d.ts +43 -0
  137. package/src/view/observer/clickobserver.js +9 -19
  138. package/src/view/observer/compositionobserver.d.ts +82 -0
  139. package/src/view/observer/compositionobserver.js +13 -42
  140. package/src/view/observer/domeventdata.d.ts +50 -0
  141. package/src/view/observer/domeventdata.js +5 -30
  142. package/src/view/observer/domeventobserver.d.ts +69 -0
  143. package/src/view/observer/domeventobserver.js +19 -21
  144. package/src/view/observer/fakeselectionobserver.d.ts +46 -0
  145. package/src/view/observer/fakeselectionobserver.js +2 -15
  146. package/src/view/observer/focusobserver.d.ts +82 -0
  147. package/src/view/observer/focusobserver.js +14 -40
  148. package/src/view/observer/inputobserver.d.ts +86 -0
  149. package/src/view/observer/inputobserver.js +18 -64
  150. package/src/view/observer/keyobserver.d.ts +67 -0
  151. package/src/view/observer/keyobserver.js +8 -42
  152. package/src/view/observer/mouseobserver.d.ts +89 -0
  153. package/src/view/observer/mouseobserver.js +8 -28
  154. package/src/view/observer/mutationobserver.d.ts +82 -0
  155. package/src/view/observer/mutationobserver.js +7 -37
  156. package/src/view/observer/observer.d.ts +84 -0
  157. package/src/view/observer/observer.js +12 -25
  158. package/src/view/observer/selectionobserver.d.ts +143 -0
  159. package/src/view/observer/selectionobserver.js +9 -99
  160. package/src/view/observer/tabobserver.d.ts +42 -0
  161. package/src/view/observer/tabobserver.js +0 -14
  162. package/src/view/placeholder.d.ts +85 -0
  163. package/src/view/placeholder.js +26 -43
  164. package/src/view/position.d.ts +189 -0
  165. package/src/view/position.js +36 -83
  166. package/src/view/range.d.ts +279 -0
  167. package/src/view/range.js +79 -122
  168. package/src/view/rawelement.d.ts +73 -0
  169. package/src/view/rawelement.js +34 -48
  170. package/src/view/renderer.d.ts +265 -0
  171. package/src/view/renderer.js +105 -193
  172. package/src/view/rooteditableelement.d.ts +41 -0
  173. package/src/view/rooteditableelement.js +12 -40
  174. package/src/view/selection.d.ts +375 -0
  175. package/src/view/selection.js +79 -153
  176. package/src/view/styles/background.d.ts +33 -0
  177. package/src/view/styles/background.js +14 -12
  178. package/src/view/styles/border.d.ts +43 -0
  179. package/src/view/styles/border.js +58 -48
  180. package/src/view/styles/margin.d.ts +29 -0
  181. package/src/view/styles/margin.js +13 -11
  182. package/src/view/styles/padding.d.ts +29 -0
  183. package/src/view/styles/padding.js +13 -11
  184. package/src/view/styles/utils.d.ts +93 -0
  185. package/src/view/styles/utils.js +22 -48
  186. package/src/view/stylesmap.d.ts +675 -0
  187. package/src/view/stylesmap.js +249 -244
  188. package/src/view/text.d.ts +74 -0
  189. package/src/view/text.js +16 -46
  190. package/src/view/textproxy.d.ts +97 -0
  191. package/src/view/textproxy.js +10 -59
  192. package/src/view/treewalker.d.ts +195 -0
  193. package/src/view/treewalker.js +43 -106
  194. package/src/view/typecheckable.d.ts +401 -0
  195. package/src/view/uielement.d.ts +96 -0
  196. package/src/view/uielement.js +28 -62
  197. package/src/view/upcastwriter.d.ts +328 -0
  198. package/src/view/upcastwriter.js +124 -134
  199. package/src/view/view.d.ts +327 -0
  200. package/src/view/view.js +79 -150
@@ -6,7 +6,9 @@ import { getShorthandValues, getBoxSidesValueReducer, getBoxSidesValues, isLengt
6
6
  /**
7
7
  * Adds a border CSS styles processing rules.
8
8
  *
9
- * editor.data.addStyleProcessorRules( addBorderRules );
9
+ * ```ts
10
+ * editor.data.addStyleProcessorRules( addBorderRules );
11
+ * ```
10
12
  *
11
13
  * This rules merges all [border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) styles notation shorthands:
12
14
  *
@@ -25,15 +27,15 @@ import { getShorthandValues, getBoxSidesValueReducer, getBoxSidesValues, isLengt
25
27
  *
26
28
  * The normalized model stores border values as:
27
29
  *
28
- * const styles = {
29
- * border: {
30
- * color: { top, right, bottom, left },
31
- * style: { top, right, bottom, left },
32
- * width: { top, right, bottom, left },
33
- * }
34
- * };
35
- *
36
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
30
+ * ```ts
31
+ * const styles = {
32
+ * border: {
33
+ * color: { top, right, bottom, left },
34
+ * style: { top, right, bottom, left },
35
+ * width: { top, right, bottom, left },
36
+ * }
37
+ * };
38
+ * ```
37
39
  */
38
40
  export function addBorderRules(stylesProcessor) {
39
41
  stylesProcessor.setNormalizer('border', getBorderNormalizer());
@@ -197,32 +199,38 @@ function normalizeBorderShorthand(string) {
197
199
  }
198
200
  return result;
199
201
  }
200
- // The border reducer factory.
201
- //
202
- // It tries to produce the most optimal output for the specified styles.
203
- //
204
- // For a border style:
205
- //
206
- // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
207
- //
208
- // It will produce: `border-style: solid`.
209
- // For a border style and color:
210
- //
211
- // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
212
- // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
213
- //
214
- // It will produce: `border-color: #ff0; border-style: solid`.
215
- // If all border parameters are specified:
216
- //
217
- // color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
218
- // style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
219
- // width: {top: "2px", bottom: "2px", right: "2px", left: "2px"}
220
- //
221
- // It will combine everything into a single property: `border: 2px solid #ff0`.
222
- //
223
- // The definitions are merged only if all border selectors have the same values.
224
- //
225
- // @returns {Function}
202
+ /**
203
+ * The border reducer factory.
204
+ *
205
+ * It tries to produce the most optimal output for the specified styles.
206
+ *
207
+ * For a border style:
208
+ *
209
+ * ```css
210
+ * style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
211
+ * ```
212
+ *
213
+ * It will produce: `border-style: solid`.
214
+ * For a border style and color:
215
+ *
216
+ * ```css
217
+ * color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
218
+ * style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
219
+ * ```
220
+ *
221
+ * It will produce: `border-color: #ff0; border-style: solid`.
222
+ * If all border parameters are specified:
223
+ *
224
+ * ```css
225
+ * color: {top: "#ff0", bottom: "#ff0", right: "#ff0", left: "#ff0"}
226
+ * style: {top: "solid", bottom: "solid", right: "solid", left: "solid"}
227
+ * width: {top: "2px", bottom: "2px", right: "2px", left: "2px"}
228
+ * ```
229
+ *
230
+ * It will combine everything into a single property: `border: 2px solid #ff0`.
231
+ *
232
+ * The definitions are merged only if all border selectors have the same values.
233
+ */
226
234
  function getBorderReducer() {
227
235
  return value => {
228
236
  const topStyles = extractBorderPosition(value, 'top');
@@ -258,8 +266,9 @@ function getBorderReducer() {
258
266
  ...reduceBorderPosition(leftStyles, 'left')
259
267
  ];
260
268
  };
261
- // @param {Array.<Object>} styles The array of objects with `style`, `color`, `width` properties.
262
- // @param {'width'|'style'|'color'} type
269
+ /**
270
+ * @param styles The array of objects with `style`, `color`, `width` properties.
271
+ */
263
272
  function getReducedStyleValueForType(styles, type) {
264
273
  return styles
265
274
  .map(style => style[type])
@@ -269,16 +278,17 @@ function getBorderReducer() {
269
278
  function getBorderPositionReducer(which) {
270
279
  return value => reduceBorderPosition(value, which);
271
280
  }
272
- // Returns an array with reduced border styles depending on the specified values.
273
- //
274
- // If all border properties (width, style, color) are specified, the returned selector will be
275
- // merged into a group: `border-*: [width] [style] [color]`.
276
- //
277
- // Otherwise, the specific definitions will be returned: `border-(width|style|color)-*: [value]`.
278
- //
279
- // @param {Object|null} value Styles if defined.
280
- // @param {'top'|'right'|'bottom'|'left'|'all'} which The border position.
281
- // @returns {Array}
281
+ /**
282
+ * Returns an array with reduced border styles depending on the specified values.
283
+ *
284
+ * If all border properties (width, style, color) are specified, the returned selector will be
285
+ * merged into a group: `border-*: [width] [style] [color]`.
286
+ *
287
+ * Otherwise, the specific definitions will be returned: `border-(width|style|color)-*: [value]`.
288
+ *
289
+ * @param value Styles if defined.
290
+ * @param which The border position.
291
+ */
282
292
  function reduceBorderPosition(value, which) {
283
293
  const borderTypes = [];
284
294
  if (value && (value.width)) {
@@ -0,0 +1,29 @@
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 engine/view/styles/margin
7
+ */
8
+ import type { StylesProcessor } from '../stylesmap';
9
+ /**
10
+ * Adds a margin CSS styles processing rules.
11
+ *
12
+ * ```ts
13
+ * editor.data.addStyleProcessorRules( addMarginRules );
14
+ * ```
15
+ *
16
+ * The normalized value is stored as:
17
+ *
18
+ * ```ts
19
+ * const styles = {
20
+ * margin: {
21
+ * top,
22
+ * right,
23
+ * bottom,
24
+ * left
25
+ * }
26
+ * };
27
+ * ```
28
+ */
29
+ export declare function addMarginRules(stylesProcessor: StylesProcessor): void;
@@ -6,20 +6,22 @@ import { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils
6
6
  /**
7
7
  * Adds a margin CSS styles processing rules.
8
8
  *
9
- * editor.data.addStyleProcessorRules( addMarginRules );
9
+ * ```ts
10
+ * editor.data.addStyleProcessorRules( addMarginRules );
11
+ * ```
10
12
  *
11
13
  * The normalized value is stored as:
12
14
  *
13
- * const styles = {
14
- * margin: {
15
- * top,
16
- * right,
17
- * bottom,
18
- * left
19
- * }
20
- * };
21
- *
22
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
15
+ * ```ts
16
+ * const styles = {
17
+ * margin: {
18
+ * top,
19
+ * right,
20
+ * bottom,
21
+ * left
22
+ * }
23
+ * };
24
+ * ```
23
25
  */
24
26
  export function addMarginRules(stylesProcessor) {
25
27
  stylesProcessor.setNormalizer('margin', getPositionShorthandNormalizer('margin'));
@@ -0,0 +1,29 @@
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 engine/view/styles/padding
7
+ */
8
+ import type { StylesProcessor } from '../stylesmap';
9
+ /**
10
+ * Adds a margin CSS styles processing rules.
11
+ *
12
+ * ```ts
13
+ * editor.data.addStyleProcessorRules( addPaddingRules );
14
+ * ```
15
+ *
16
+ * The normalized value is stored as:
17
+ *
18
+ * ```ts
19
+ * const styles = {
20
+ * padding: {
21
+ * top,
22
+ * right,
23
+ * bottom,
24
+ * left
25
+ * }
26
+ * };
27
+ * ```
28
+ */
29
+ export declare function addPaddingRules(stylesProcessor: StylesProcessor): void;
@@ -6,20 +6,22 @@ import { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils
6
6
  /**
7
7
  * Adds a margin CSS styles processing rules.
8
8
  *
9
- * editor.data.addStyleProcessorRules( addPaddingRules );
9
+ * ```ts
10
+ * editor.data.addStyleProcessorRules( addPaddingRules );
11
+ * ```
10
12
  *
11
13
  * The normalized value is stored as:
12
14
  *
13
- * const styles = {
14
- * padding: {
15
- * top,
16
- * right,
17
- * bottom,
18
- * left
19
- * }
20
- * };
21
- *
22
- * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
15
+ * ```ts
16
+ * const styles = {
17
+ * padding: {
18
+ * top,
19
+ * right,
20
+ * bottom,
21
+ * left
22
+ * }
23
+ * };
24
+ * ```
23
25
  */
24
26
  export function addPaddingRules(stylesProcessor) {
25
27
  stylesProcessor.setNormalizer('padding', getPositionShorthandNormalizer('padding'));
@@ -0,0 +1,93 @@
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 engine/view/styles/utils
7
+ */
8
+ import type { BoxSides, PropertyDescriptor, StyleValue } from '../stylesmap';
9
+ /**
10
+ * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
11
+ *
12
+ * ```ts
13
+ * isColor( '#f00' ); // true
14
+ * isColor( '#AA00BB33' ); // true
15
+ * isColor( 'rgb(0, 0, 250)' ); // true
16
+ * isColor( 'hsla(240, 100%, 50%, .7)' ); // true
17
+ * isColor( 'deepskyblue' ); // true
18
+ * ```
19
+ *
20
+ * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
21
+ */
22
+ export declare function isColor(string: string): boolean;
23
+ /**
24
+ * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.
25
+ */
26
+ export declare function isLineStyle(string: string): boolean;
27
+ /**
28
+ * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.
29
+ */
30
+ export declare function isLength(string: string): boolean;
31
+ /**
32
+ * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.
33
+ */
34
+ export declare function isPercentage(string: string): boolean;
35
+ /**
36
+ * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.
37
+ */
38
+ export declare function isRepeat(string: string): boolean;
39
+ /**
40
+ * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.
41
+ */
42
+ export declare function isPosition(string: string): boolean;
43
+ /**
44
+ * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.
45
+ */
46
+ export declare function isAttachment(string: string): boolean;
47
+ /**
48
+ * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.
49
+ */
50
+ export declare function isURL(string: string): boolean;
51
+ /**
52
+ * Parses box sides as individual values.
53
+ */
54
+ export declare function getBoxSidesValues(value?: string): BoxSides;
55
+ /**
56
+ * Default reducer for CSS properties that concerns edges of a box
57
+ * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:
58
+ *
59
+ * ```ts
60
+ * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
61
+ * ```
62
+ */
63
+ export declare function getBoxSidesValueReducer(styleShorthand: string): (value: StyleValue) => Array<PropertyDescriptor>;
64
+ /**
65
+ * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation
66
+ * of a CSS property value.
67
+ *
68
+ * ```ts
69
+ * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
70
+ * // will return '1px 1px 2px'
71
+ * ```
72
+ */
73
+ export declare function getBoxSidesShorthandValue({ top, right, bottom, left }: BoxSides): string;
74
+ /**
75
+ * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.
76
+ *
77
+ * ```ts
78
+ * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
79
+ * ```
80
+ */
81
+ export declare function getPositionShorthandNormalizer(shorthand: string): (value: string) => {
82
+ path: string;
83
+ value: BoxSides;
84
+ };
85
+ /**
86
+ * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
87
+ *
88
+ * ```ts
89
+ * getShorthandValues( 'red blue RGB(0, 0, 0)');
90
+ * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
91
+ * ```
92
+ */
93
+ export declare function getShorthandValues(string: string): Array<string>;
@@ -43,16 +43,15 @@ const COLOR_NAMES = new Set([
43
43
  /**
44
44
  * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
45
45
  *
46
- * isColor( '#f00' ); // true
47
- * isColor( '#AA00BB33' ); // true
48
- * isColor( 'rgb(0, 0, 250)' ); // true
49
- * isColor( 'hsla(240, 100%, 50%, .7)' ); // true
50
- * isColor( 'deepskyblue' ); // true
46
+ * ```ts
47
+ * isColor( '#f00' ); // true
48
+ * isColor( '#AA00BB33' ); // true
49
+ * isColor( 'rgb(0, 0, 250)' ); // true
50
+ * isColor( 'hsla(240, 100%, 50%, .7)' ); // true
51
+ * isColor( 'deepskyblue' ); // true
52
+ * ```
51
53
  *
52
54
  * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
53
- *
54
- * @param {String} string
55
- * @returns {Boolean}
56
55
  */
57
56
  export function isColor(string) {
58
57
  // As far as I was able to test checking some pre-conditions is faster than joining each test with ||.
@@ -71,9 +70,6 @@ export function isColor(string) {
71
70
  const lineStyleValues = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'];
72
71
  /**
73
72
  * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.
74
- *
75
- * @param {String} string
76
- * @returns {Boolean}
77
73
  */
78
74
  export function isLineStyle(string) {
79
75
  return lineStyleValues.includes(string);
@@ -81,9 +77,6 @@ export function isLineStyle(string) {
81
77
  const lengthRegExp = /^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;
82
78
  /**
83
79
  * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.
84
- *
85
- * @param {String} string
86
- * @returns {Boolean}
87
80
  */
88
81
  export function isLength(string) {
89
82
  return lengthRegExp.test(string);
@@ -91,9 +84,6 @@ export function isLength(string) {
91
84
  const PERCENTAGE_VALUE_REGEXP = /^[+-]?[0-9]*([.][0-9]+)?%$/;
92
85
  /**
93
86
  * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.
94
- *
95
- * @param {String} string
96
- * @returns {Boolean}
97
87
  */
98
88
  export function isPercentage(string) {
99
89
  return PERCENTAGE_VALUE_REGEXP.test(string);
@@ -101,9 +91,6 @@ export function isPercentage(string) {
101
91
  const repeatValues = ['repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat'];
102
92
  /**
103
93
  * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.
104
- *
105
- * @param {String} string
106
- * @returns {Boolean}
107
94
  */
108
95
  export function isRepeat(string) {
109
96
  return repeatValues.includes(string);
@@ -111,9 +98,6 @@ export function isRepeat(string) {
111
98
  const positionValues = ['center', 'top', 'bottom', 'left', 'right'];
112
99
  /**
113
100
  * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.
114
- *
115
- * @param {String} string
116
- * @returns {Boolean}
117
101
  */
118
102
  export function isPosition(string) {
119
103
  return positionValues.includes(string);
@@ -121,9 +105,6 @@ export function isPosition(string) {
121
105
  const attachmentValues = ['fixed', 'scroll', 'local'];
122
106
  /**
123
107
  * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.
124
- *
125
- * @param {String} string
126
- * @returns {Boolean}
127
108
  */
128
109
  export function isAttachment(string) {
129
110
  return attachmentValues.includes(string);
@@ -131,15 +112,12 @@ export function isAttachment(string) {
131
112
  const urlRegExp = /^url\(/;
132
113
  /**
133
114
  * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.
134
- *
135
- * @param {String} string
136
- * @returns {Boolean}
137
115
  */
138
116
  export function isURL(string) {
139
117
  return urlRegExp.test(string);
140
118
  }
141
119
  /**
142
- * TODO: Docs
120
+ * Parses box sides as individual values.
143
121
  */
144
122
  export function getBoxSidesValues(value = '') {
145
123
  if (value === '') {
@@ -156,10 +134,9 @@ export function getBoxSidesValues(value = '') {
156
134
  * Default reducer for CSS properties that concerns edges of a box
157
135
  * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:
158
136
  *
159
- * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
160
- *
161
- * @param {String} styleShorthand
162
- * @returns {Function}
137
+ * ```ts
138
+ * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
139
+ * ```
163
140
  */
164
141
  export function getBoxSidesValueReducer(styleShorthand) {
165
142
  return (value) => {
@@ -189,11 +166,10 @@ export function getBoxSidesValueReducer(styleShorthand) {
189
166
  * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation
190
167
  * of a CSS property value.
191
168
  *
192
- * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
193
- * // will return '1px 1px 2px'
194
- *
195
- * @param {module:engine/view/stylesmap~BoxSides} styleShorthand
196
- * @returns {String}
169
+ * ```ts
170
+ * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
171
+ * // will return '1px 1px 2px'
172
+ * ```
197
173
  */
198
174
  export function getBoxSidesShorthandValue({ top, right, bottom, left }) {
199
175
  const out = [];
@@ -214,10 +190,9 @@ export function getBoxSidesShorthandValue({ top, right, bottom, left }) {
214
190
  /**
215
191
  * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.
216
192
  *
217
- * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
218
- *
219
- * @param {String} shorthand
220
- * @returns {Function}
193
+ * ```ts
194
+ * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
195
+ * ```
221
196
  */
222
197
  export function getPositionShorthandNormalizer(shorthand) {
223
198
  return (value) => {
@@ -230,11 +205,10 @@ export function getPositionShorthandNormalizer(shorthand) {
230
205
  /**
231
206
  * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
232
207
  *
233
- * getShorthandValues( 'red blue RGB(0, 0, 0)');
234
- * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
235
- *
236
- * @param {String} string
237
- * @returns {Array.<String>}
208
+ * ```ts
209
+ * getShorthandValues( 'red blue RGB(0, 0, 0)');
210
+ * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
211
+ * ```
238
212
  */
239
213
  export function getShorthandValues(string) {
240
214
  return string