UNPKG

1.55 kBTypeScriptView Raw
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/todolist/checktodolistcommand
7 */
8import { Command, type Editor } from 'ckeditor5/src/core.js';
9/**
10 * The check to-do command.
11 *
12 * The command is registered by the {@link module:list/todolist/todolistediting~TodoListEditing} as
13 * the `checkTodoList` editor command.
14 */
15export default class CheckTodoListCommand extends Command {
16 /**
17 * A list of to-do list items selected by the {@link module:engine/model/selection~Selection}.
18 *
19 * @observable
20 * @readonly
21 */
22 value: boolean;
23 /**
24 * @inheritDoc
25 */
26 constructor(editor: Editor);
27 /**
28 * Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.
29 */
30 refresh(): void;
31 /**
32 * Executes the command.
33 *
34 * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply
35 * the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current
36 * value to decide what it should do.
37 */
38 execute(options?: {
39 forceValue?: boolean;
40 }): void;
41 /**
42 * Returns a value for the command.
43 */
44 private _getValue;
45 /**
46 * Gets all to-do list items selected by the {@link module:engine/model/selection~Selection}.
47 */
48 private _getSelectedItems;
49}