UNPKG

1.27 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 paragraph/paragraphcommand
7 */
8import { Command, type Editor } from '@ckeditor/ckeditor5-core';
9import type { Selection, DocumentSelection } from '@ckeditor/ckeditor5-engine';
10/**
11 * The paragraph command.
12 */
13export default class ParagraphCommand extends Command {
14 constructor(editor: Editor);
15 /**
16 * The value of the command. Indicates whether the selection start is placed in a paragraph.
17 *
18 * @readonly
19 * @observable
20 */
21 value: boolean;
22 /**
23 * @inheritDoc
24 */
25 refresh(): void;
26 /**
27 * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection
28 * will be turned to paragraphs.
29 *
30 * @fires execute
31 * @param options Options for the executed command.
32 * @param options.selection The selection that the command should be applied to. By default,
33 * if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.
34 */
35 execute(options?: {
36 selection?: Selection | DocumentSelection;
37 }): void;
38}