UNPKG

1.44 kBTypeScriptView Raw
1import { Plugin } from '@ckeditor/ckeditor5-core';
2import { Widget } from '@ckeditor/ckeditor5-widget';
3import TableClipboard from './tableclipboard';
4import TableEditing from './tableediting';
5import TableKeyboard from './tablekeyboard';
6import TableSelection from './tableselection';
7import TableUI from './tableui';
8import TableMouse from './tablemouse';
9
10export default class Table extends Plugin {
11 static readonly requires: [
12 typeof TableEditing,
13 typeof TableUI,
14 typeof TableSelection,
15 typeof TableMouse,
16 typeof TableKeyboard,
17 typeof TableClipboard,
18 typeof Widget,
19 ];
20 static readonly pluginName: 'Table';
21}
22
23export interface TableConfig {
24 contentToolbar?: string[] | undefined;
25 tableCellProperties?:
26 | {
27 borderColors?: TableColorConfig[] | undefined;
28 backgroundColors: TableColorConfig[];
29 }
30 | undefined;
31 tableProperties?:
32 | {
33 borderColors?: TableColorConfig[] | undefined;
34 backgroundColors: TableColorConfig[];
35 }
36 | undefined;
37 tableToolbar?: string[] | undefined;
38}
39
40export type TableColorConfig =
41 | string
42 | {
43 color: string;
44 label: string;
45 hasBorder?: boolean | undefined;
46 };
47
48declare module '@ckeditor/ckeditor5-core/src/plugincollection' {
49 interface Plugins {
50 Table: Table;
51 }
52}