UNPKG

1.52 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 list/documentlist/utils/postfixers
7 */
8import type { Position, Writer } from 'ckeditor5/src/engine';
9import { type ListIteratorValue } from './listwalker';
10import { type ListElement } from './model';
11/**
12 * Based on the provided positions looks for the list head and stores it in the provided map.
13 *
14 * @internal
15 * @param position The search starting position.
16 * @param itemToListHead The map from list item element to the list head element.
17 */
18export declare function findAndAddListHeadToMap(position: Position, itemToListHead: Map<ListElement, ListElement>): void;
19/**
20 * Scans the list starting from the given list head element and fixes items' indentation.
21 *
22 * @internal
23 * @param listNodes The iterable of list nodes.
24 * @param writer The model writer.
25 * @returns Whether the model was modified.
26 */
27export declare function fixListIndents(listNodes: Iterable<ListIteratorValue>, writer: Writer): boolean;
28/**
29 * Scans the list starting from the given list head element and fixes items' types.
30 *
31 * @internal
32 * @param listNodes The iterable of list nodes.
33 * @param seenIds The set of already known IDs.
34 * @param writer The model writer.
35 * @returns Whether the model was modified.
36 */
37export declare function fixListItemIds(listNodes: Iterable<ListIteratorValue>, seenIds: Set<string>, writer: Writer): boolean;