1 | /**
|
2 | * @license Copyright (c) 2003-2024, 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 list/legacylist/legacylistutils
|
7 | */
|
8 | import type { Element, Model, Position } from 'ckeditor5/src/engine.js';
|
9 | import { Plugin } from 'ckeditor5/src/core.js';
|
10 | /**
|
11 | * A set of helpers related to legacy lists.
|
12 | */
|
13 | export default class LegacyListUtils extends Plugin {
|
14 | /**
|
15 | * @inheritDoc
|
16 | */
|
17 | static get pluginName(): "LegacyListUtils";
|
18 | /**
|
19 | * Checks whether the given list-style-type is supported by numbered or bulleted list.
|
20 | */
|
21 | getListTypeFromListStyleType(listStyleType: string): 'bulleted' | 'numbered' | null;
|
22 | /**
|
23 | * Returns an array with all `listItem` elements in the model selection.
|
24 | *
|
25 | * It returns all the items even if only a part of the list is selected, including items that belong to nested lists.
|
26 | * If no list is selected, it returns an empty array.
|
27 | * The order of the elements is not specified.
|
28 | */
|
29 | getSelectedListItems(model: Model): Array<Element>;
|
30 | /**
|
31 | * Returns an array with all `listItem` elements that represent the same list.
|
32 | *
|
33 | * It means that values of `listIndent`, `listType`, `listStyle`, `listReversed` and `listStart` for all items are equal.
|
34 | *
|
35 | * Additionally, if the `position` is inside a list item, that list item will be returned as well.
|
36 | *
|
37 | * @param position Starting position.
|
38 | * @param direction Walking direction.
|
39 | */
|
40 | getSiblingNodes(position: Position, direction: 'forward' | 'backward'): Array<Element>;
|
41 | }
|