UNPKG

1.02 kBTypeScriptView Raw
1import { Plugin } from '@ckeditor/ckeditor5-core';
2import { Element, Model } from '@ckeditor/ckeditor5-engine';
3import DocumentFragment from '@ckeditor/ckeditor5-engine/src/model/documentfragment';
4import { Item } from '@ckeditor/ckeditor5-engine/src/model/item';
5import TableSelection from './tableselection';
6import TableUtils from './tableutils';
7
8/**
9 * This plugin adds support for copying/cutting/pasting fragments of tables.
10 * It is loaded automatically by the {@link module:table/table~Table} plugin.
11 */
12export default class TableClipboard extends Plugin {
13 static readonly pluginName: 'TableClipboard';
14 static readonly requires: [typeof TableSelection, typeof TableUtils];
15 init(): void;
16
17 /**
18 * Extracts the table for pasting into a table.
19 */
20 getTableIfOnlyTableInContent(content: DocumentFragment | Item, model: Model): Element | null;
21}
22
23declare module '@ckeditor/ckeditor5-core/src/plugincollection' {
24 interface Plugins {
25 TableClipboard: TableClipboard;
26 }
27}