1 | import { Node as PmNode } from 'prosemirror-model';
|
2 | import { TableCellContent } from './doc';
|
3 | export declare const tablePrefixSelector = "pm-table";
|
4 | export declare const tableCellSelector: string;
|
5 | export declare const tableHeaderSelector: string;
|
6 | export declare const tableCellContentWrapperSelector: string;
|
7 | export declare const tableCellContentDomSelector: string;
|
8 | export declare const setCellAttrs: (node: PmNode<any>, cell?: HTMLElement | undefined) => {
|
9 | colspan?: number | undefined;
|
10 | rowspan?: number | undefined;
|
11 | style?: string | undefined;
|
12 | 'data-colwidth'?: string | undefined;
|
13 | class?: string | undefined;
|
14 | };
|
15 | export declare const tableBackgroundColorPalette: Map<string, string>;
|
16 | export declare const tableBackgroundBorderColor: string;
|
17 | export declare const tableBackgroundColorNames: Map<string, string>;
|
18 | export declare type Layout = 'default' | 'full-width' | 'wide';
|
19 | export interface TableAttributes {
|
20 | isNumberColumnEnabled?: boolean;
|
21 | layout?: Layout;
|
22 | __autoSize?: boolean;
|
23 | }
|
24 |
|
25 |
|
26 |
|
27 | export interface TableDefinition {
|
28 | type: 'table';
|
29 | attrs?: TableAttributes;
|
30 | |
31 |
|
32 |
|
33 | content: Array<TableRow>;
|
34 | }
|
35 |
|
36 |
|
37 |
|
38 | export interface TableRow {
|
39 | type: 'tableRow';
|
40 | content: Array<TableHeader | TableCell>;
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 | export interface TableCell {
|
46 | type: 'tableCell';
|
47 | attrs?: CellAttributes;
|
48 | content: TableCellContent;
|
49 | }
|
50 |
|
51 |
|
52 |
|
53 | export interface TableHeader {
|
54 | type: 'tableHeader';
|
55 | attrs?: CellAttributes;
|
56 | content: TableCellContent;
|
57 | }
|
58 | export interface CellAttributes {
|
59 | colspan?: number;
|
60 | rowspan?: number;
|
61 | colwidth?: number[];
|
62 | background?: string;
|
63 | }
|
64 | export declare const table: any;
|
65 | export declare const tableToJSON: (node: PmNode<any>) => {
|
66 | attrs: {
|
67 | [key: string]: any;
|
68 | };
|
69 | };
|
70 | export declare const tableRow: {
|
71 | content: string;
|
72 | tableRole: string;
|
73 | parseDOM: {
|
74 | tag: string;
|
75 | }[];
|
76 | toDOM(): (string | number)[];
|
77 | };
|
78 | export declare const tableCell: {
|
79 | content: string;
|
80 | attrs: {
|
81 | colspan: {
|
82 | default: number;
|
83 | };
|
84 | rowspan: {
|
85 | default: number;
|
86 | };
|
87 | colwidth: {
|
88 | default: null;
|
89 | };
|
90 | background: {
|
91 | default: null;
|
92 | };
|
93 | };
|
94 | tableRole: string;
|
95 | marks: string;
|
96 | isolating: boolean;
|
97 | parseDOM: ({
|
98 | tag: string;
|
99 | ignore: boolean;
|
100 | getAttrs?: undefined;
|
101 | } | {
|
102 | tag: string;
|
103 | getAttrs: (dom: HTMLElement) => {
|
104 | colspan: number;
|
105 | rowspan: number;
|
106 | colwidth: number[] | null;
|
107 | background: string | null;
|
108 | };
|
109 | ignore?: undefined;
|
110 | })[];
|
111 | toDOM: (node: PmNode<any>) => (string | number | {
|
112 | colspan?: number | undefined;
|
113 | rowspan?: number | undefined;
|
114 | style?: string | undefined;
|
115 | 'data-colwidth'?: string | undefined;
|
116 | class?: string | undefined;
|
117 | })[];
|
118 | };
|
119 | export declare const toJSONTableCell: (node: PmNode<any>) => {
|
120 | attrs: Record<string, any>;
|
121 | };
|
122 | export declare const tableHeader: {
|
123 | content: string;
|
124 | attrs: {
|
125 | colspan: {
|
126 | default: number;
|
127 | };
|
128 | rowspan: {
|
129 | default: number;
|
130 | };
|
131 | colwidth: {
|
132 | default: null;
|
133 | };
|
134 | background: {
|
135 | default: null;
|
136 | };
|
137 | };
|
138 | tableRole: string;
|
139 | isolating: boolean;
|
140 | marks: string;
|
141 | parseDOM: {
|
142 | tag: string;
|
143 | getAttrs: (dom: HTMLElement) => {
|
144 | colspan: number;
|
145 | rowspan: number;
|
146 | colwidth: number[] | null;
|
147 | background: string | null;
|
148 | };
|
149 | }[];
|
150 | toDOM: (node: PmNode<any>) => (string | number | {
|
151 | colspan?: number | undefined;
|
152 | rowspan?: number | undefined;
|
153 | style?: string | undefined;
|
154 | 'data-colwidth'?: string | undefined;
|
155 | class?: string | undefined;
|
156 | })[];
|
157 | };
|
158 | export declare const toJSONTableHeader: (node: PmNode<any>) => {
|
159 | attrs: Record<string, any>;
|
160 | };
|