wikiparser-node 1.12.5-b → 1.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/.schema.json +203 -0
- package/config/default.json +30 -29
- package/config/enwiki.json +829 -15
- package/config/llwiki.json +56 -21
- package/config/moegirl.json +65 -21
- package/config/zhwiki.json +494 -28
- package/dist/addon/table.js +494 -0
- package/dist/addon/token.js +392 -0
- package/dist/addon/transclude.js +184 -0
- package/dist/base.d.ts +81 -0
- package/dist/base.js +40 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +275 -0
- package/dist/internal.d.ts +47 -0
- package/dist/lib/element.d.ts +125 -0
- package/dist/lib/element.js +377 -0
- package/dist/lib/node.d.ts +173 -0
- package/dist/lib/node.js +478 -0
- package/dist/lib/range.d.ts +105 -0
- package/dist/lib/range.js +406 -0
- package/dist/lib/ranges.d.ts +28 -0
- package/dist/lib/ranges.js +126 -0
- package/dist/lib/rect.d.ts +18 -0
- package/dist/lib/rect.js +36 -0
- package/dist/lib/text.d.ts +58 -0
- package/dist/lib/text.js +414 -0
- package/dist/lib/title.d.ts +49 -0
- package/dist/lib/title.js +253 -0
- package/dist/mixin/attributesParent.d.ts +49 -0
- package/dist/mixin/attributesParent.js +80 -0
- package/dist/mixin/fixed.d.ts +5 -0
- package/dist/mixin/fixed.js +32 -0
- package/dist/mixin/flagsParent.d.ts +43 -0
- package/dist/mixin/flagsParent.js +64 -0
- package/dist/mixin/hidden.d.ts +7 -0
- package/dist/mixin/hidden.js +39 -0
- package/dist/mixin/magicLinkParent.d.ts +19 -0
- package/dist/mixin/magicLinkParent.js +43 -0
- package/dist/mixin/singleLine.d.ts +5 -0
- package/dist/mixin/singleLine.js +25 -0
- package/dist/mixin/sol.d.ts +6 -0
- package/dist/mixin/sol.js +45 -0
- package/dist/mixin/syntax.d.ts +8 -0
- package/dist/mixin/syntax.js +46 -0
- package/dist/parser/braces.js +152 -0
- package/dist/parser/commentAndExt.js +84 -0
- package/dist/parser/converter.js +41 -0
- package/dist/parser/externalLinks.js +39 -0
- package/dist/parser/hrAndDoubleUnderscore.js +44 -0
- package/dist/parser/html.js +40 -0
- package/dist/parser/links.js +103 -0
- package/dist/parser/list.js +116 -0
- package/dist/parser/magicLinks.js +55 -0
- package/dist/parser/quotes.js +69 -0
- package/dist/parser/redirect.js +28 -0
- package/dist/parser/selector.js +393 -0
- package/dist/parser/table.js +125 -0
- package/dist/src/arg.d.ts +49 -0
- package/dist/src/arg.js +220 -0
- package/dist/src/atom.d.ts +14 -0
- package/dist/src/atom.js +54 -0
- package/dist/src/attribute.d.ts +64 -0
- package/dist/src/attribute.js +482 -0
- package/dist/src/attributes.d.ts +103 -0
- package/dist/src/attributes.js +380 -0
- package/dist/src/converter.d.ts +28 -0
- package/dist/src/converter.js +153 -0
- package/dist/src/converterFlags.d.ts +80 -0
- package/dist/src/converterFlags.js +241 -0
- package/dist/src/converterRule.d.ts +71 -0
- package/dist/src/converterRule.js +218 -0
- package/dist/src/extLink.d.ts +36 -0
- package/dist/src/extLink.js +223 -0
- package/dist/src/gallery.d.ts +51 -0
- package/dist/src/gallery.js +166 -0
- package/dist/src/heading.d.ts +44 -0
- package/dist/src/heading.js +222 -0
- package/dist/src/hidden.d.ts +9 -0
- package/dist/src/hidden.js +82 -0
- package/dist/src/html.d.ts +61 -0
- package/dist/src/html.js +344 -0
- package/dist/src/imageParameter.d.ts +60 -0
- package/dist/src/imageParameter.js +262 -0
- package/dist/src/imagemap.d.ts +47 -0
- package/dist/src/imagemap.js +148 -0
- package/dist/src/imagemapLink.d.ts +35 -0
- package/dist/src/imagemapLink.js +99 -0
- package/dist/src/index.d.ts +136 -0
- package/dist/src/index.js +790 -0
- package/dist/src/link/base.d.ts +52 -0
- package/dist/src/link/base.js +258 -0
- package/dist/src/link/category.d.ts +22 -0
- package/dist/src/link/category.js +36 -0
- package/dist/src/link/file.d.ts +102 -0
- package/dist/src/link/file.js +345 -0
- package/dist/src/link/galleryImage.d.ts +29 -0
- package/dist/src/link/galleryImage.js +133 -0
- package/dist/src/link/index.d.ts +39 -0
- package/dist/src/link/index.js +100 -0
- package/dist/src/link/redirectTarget.d.ts +27 -0
- package/dist/src/link/redirectTarget.js +71 -0
- package/dist/src/magicLink.d.ts +57 -0
- package/dist/src/magicLink.js +261 -0
- package/dist/src/nested.d.ts +40 -0
- package/dist/src/nested.js +108 -0
- package/dist/src/nowiki/base.d.ts +28 -0
- package/dist/src/nowiki/base.js +90 -0
- package/dist/src/nowiki/comment.d.ts +14 -0
- package/dist/src/nowiki/comment.js +123 -0
- package/dist/src/nowiki/dd.d.ts +8 -0
- package/dist/src/nowiki/dd.js +74 -0
- package/dist/src/nowiki/doubleUnderscore.d.ts +15 -0
- package/dist/src/nowiki/doubleUnderscore.js +101 -0
- package/dist/src/nowiki/hr.d.ts +5 -0
- package/dist/src/nowiki/hr.js +72 -0
- package/dist/src/nowiki/index.d.ts +14 -0
- package/dist/src/nowiki/index.js +30 -0
- package/dist/src/nowiki/list.d.ts +5 -0
- package/dist/src/nowiki/list.js +67 -0
- package/dist/src/nowiki/listBase.d.ts +23 -0
- package/dist/src/nowiki/listBase.js +100 -0
- package/dist/src/nowiki/noinclude.d.ts +6 -0
- package/dist/src/nowiki/noinclude.js +77 -0
- package/dist/src/nowiki/quote.d.ts +14 -0
- package/dist/src/nowiki/quote.js +149 -0
- package/dist/src/onlyinclude.d.ts +13 -0
- package/dist/src/onlyinclude.js +60 -0
- package/dist/src/paramTag/index.d.ts +28 -0
- package/dist/src/paramTag/index.js +80 -0
- package/dist/src/paramTag/inputbox.d.ts +8 -0
- package/dist/src/paramTag/inputbox.js +24 -0
- package/dist/src/parameter.d.ts +60 -0
- package/dist/src/parameter.js +267 -0
- package/dist/src/pre.d.ts +28 -0
- package/dist/src/pre.js +62 -0
- package/dist/src/redirect.d.ts +30 -0
- package/dist/src/redirect.js +128 -0
- package/dist/src/syntax.d.ts +15 -0
- package/dist/src/syntax.js +87 -0
- package/dist/src/table/base.d.ts +28 -0
- package/dist/src/table/base.js +81 -0
- package/dist/src/table/index.d.ts +230 -0
- package/dist/src/table/index.js +506 -0
- package/dist/src/table/td.d.ts +72 -0
- package/dist/src/table/td.js +375 -0
- package/dist/src/table/tr.d.ts +30 -0
- package/dist/src/table/tr.js +61 -0
- package/dist/src/table/trBase.d.ts +49 -0
- package/dist/src/table/trBase.js +165 -0
- package/dist/src/tagPair/ext.d.ts +29 -0
- package/dist/src/tagPair/ext.js +229 -0
- package/dist/src/tagPair/include.d.ts +33 -0
- package/dist/src/tagPair/include.js +132 -0
- package/dist/src/tagPair/index.d.ts +23 -0
- package/dist/src/tagPair/index.js +130 -0
- package/dist/src/transclude.d.ts +159 -0
- package/dist/src/transclude.js +598 -0
- package/dist/util/constants.js +26 -0
- package/dist/util/debug.js +95 -0
- package/dist/util/diff.js +83 -0
- package/dist/util/html.js +146 -0
- package/dist/util/lint.js +32 -0
- package/dist/util/string.js +107 -0
- package/errors/README +3 -0
- package/package.json +21 -28
- package/printed/README +3 -0
- package/bundle/bundle.min.js +0 -37
- package/extensions/dist/base.js +0 -163
- package/extensions/dist/codejar.js +0 -52
- package/extensions/dist/editor.js +0 -159
- package/extensions/dist/highlight.js +0 -30
- package/extensions/dist/lint.js +0 -72
- package/extensions/editor.css +0 -59
- package/extensions/ui.css +0 -162
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TableBaseToken = void 0;
|
|
4
|
+
const attributesParent_1 = require("../../mixin/attributesParent");
|
|
5
|
+
const index_1 = require("../../index");
|
|
6
|
+
const index_2 = require("../index");
|
|
7
|
+
const syntax_1 = require("../syntax");
|
|
8
|
+
const attributes_1 = require("../attributes");
|
|
9
|
+
/* NOT FOR BROWSER */
|
|
10
|
+
const debug_1 = require("../../util/debug");
|
|
11
|
+
const constants_1 = require("../../util/constants");
|
|
12
|
+
/**
|
|
13
|
+
* 转义表格语法
|
|
14
|
+
* @param syntax 表格语法节点
|
|
15
|
+
*/
|
|
16
|
+
const escapeTable = (syntax) => {
|
|
17
|
+
const wikitext = syntax.childNodes.map(child => child.type === 'text'
|
|
18
|
+
? child.data.replaceAll('|', '{{!}}')
|
|
19
|
+
: child.toString()).join(''), { childNodes } = index_1.default.parse(wikitext, syntax.getAttribute('include'), 2, syntax.getAttribute('config'));
|
|
20
|
+
syntax.replaceChildren(...childNodes);
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 表格行,含开头的换行,不含结尾的换行
|
|
24
|
+
* @classdesc `{childNodes: [SyntaxToken, AttributesToken, ...Token]}`
|
|
25
|
+
*/
|
|
26
|
+
class TableBaseToken extends (0, attributesParent_1.attributesParent)(1)(index_2.Token) {
|
|
27
|
+
/* NOT FOR BROWSER END */
|
|
28
|
+
/**
|
|
29
|
+
* @param pattern 表格语法正则
|
|
30
|
+
* @param syntax 表格语法
|
|
31
|
+
* @param type 节点类型
|
|
32
|
+
* @param attr 表格属性
|
|
33
|
+
*/
|
|
34
|
+
constructor(pattern, syntax, type, attr, config = index_1.default.getConfig(), accum = [], acceptable = {}) {
|
|
35
|
+
super(undefined, config, accum, acceptable);
|
|
36
|
+
this.append(new syntax_1.SyntaxToken(syntax, pattern, 'table-syntax', config, accum, {
|
|
37
|
+
'Stage-1': ':', '!ExtToken': '', TranscludeToken: ':',
|
|
38
|
+
}),
|
|
39
|
+
// @ts-expect-error abstract class
|
|
40
|
+
new attributes_1.AttributesToken(attr, 'table-attrs', type, config, accum));
|
|
41
|
+
/* NOT FOR BROWSER */
|
|
42
|
+
this.protectChildren(0, 1);
|
|
43
|
+
}
|
|
44
|
+
/* NOT FOR BROWSER */
|
|
45
|
+
cloneNode() {
|
|
46
|
+
const [syntax, attr, ...cloned] = this.cloneChildNodes();
|
|
47
|
+
return debug_1.Shadow.run(() => {
|
|
48
|
+
const C = this.constructor, token = new C(undefined, undefined, this.getAttribute('config'));
|
|
49
|
+
token.firstChild.safeReplaceWith(syntax);
|
|
50
|
+
token.childNodes[1].safeReplaceWith(attr);
|
|
51
|
+
if (token.type === 'td') { // TdToken
|
|
52
|
+
token.childNodes[2].safeReplaceWith(cloned[0]);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
token.append(...cloned);
|
|
56
|
+
}
|
|
57
|
+
return token;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** 转义表格语法 */
|
|
61
|
+
escape() {
|
|
62
|
+
for (const child of this.childNodes) {
|
|
63
|
+
if (child instanceof syntax_1.SyntaxToken) {
|
|
64
|
+
escapeTable(child);
|
|
65
|
+
}
|
|
66
|
+
else if (child instanceof TableBaseToken) {
|
|
67
|
+
child.escape();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** @private */
|
|
72
|
+
setSyntax(syntax, esc) {
|
|
73
|
+
const { firstChild } = this;
|
|
74
|
+
firstChild.replaceChildren(syntax);
|
|
75
|
+
if (esc) {
|
|
76
|
+
escapeTable(firstChild);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.TableBaseToken = TableBaseToken;
|
|
81
|
+
constants_1.classes['TableBaseToken'] = __filename;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { TrBaseToken } from './trBase';
|
|
2
|
+
import { SyntaxToken } from '../syntax';
|
|
3
|
+
import type { Config, LintError, AST } from '../../base';
|
|
4
|
+
import type { SyntaxBase } from '../../mixin/syntax';
|
|
5
|
+
import type { AttributesToken, TdToken, TrToken, Token } from '../../internal';
|
|
6
|
+
import type { TableCoords } from './trBase';
|
|
7
|
+
import type { TdAttrs, TdSubtypes, TdSpanAttrs } from './td';
|
|
8
|
+
export interface TableRenderedCoords {
|
|
9
|
+
readonly row?: undefined;
|
|
10
|
+
readonly column?: undefined;
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
}
|
|
14
|
+
export interface TableToken extends SyntaxBase {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 是否是行尾
|
|
18
|
+
* @param {Token} cell 表格单元格
|
|
19
|
+
*/
|
|
20
|
+
export declare const isRowEnd: ({ type }: Token) => boolean;
|
|
21
|
+
/** @extends {Array<TableCoords[]>} */
|
|
22
|
+
export declare class Layout extends Array<TableCoords[]> {
|
|
23
|
+
/** 打印表格布局 */
|
|
24
|
+
print(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 表格
|
|
28
|
+
* @classdesc `{childNodes: [SyntaxToken, AttributesToken, ?Token, ...TdToken, ...TrToken, ?SyntaxToken]}`
|
|
29
|
+
*/
|
|
30
|
+
export declare abstract class TableToken extends TrBaseToken {
|
|
31
|
+
readonly childNodes: readonly [SyntaxToken, AttributesToken, ...(TdToken | TrToken)[], SyntaxToken] | readonly [SyntaxToken, AttributesToken, ...(TdToken | TrToken)[]];
|
|
32
|
+
abstract get lastChild(): AttributesToken | TdToken | TrToken | SyntaxToken;
|
|
33
|
+
abstract get children(): [SyntaxToken, AttributesToken, ...(TdToken | TrToken)[], SyntaxToken] | [SyntaxToken, AttributesToken, ...(TdToken | TrToken)[]];
|
|
34
|
+
abstract get lastElementChild(): AttributesToken | TdToken | TrToken | SyntaxToken;
|
|
35
|
+
get type(): 'table';
|
|
36
|
+
/** 表格是否闭合 */
|
|
37
|
+
get closed(): boolean;
|
|
38
|
+
set closed(closed: boolean);
|
|
39
|
+
/**
|
|
40
|
+
* @param syntax 表格语法
|
|
41
|
+
* @param attr 表格属性
|
|
42
|
+
*/
|
|
43
|
+
constructor(syntax: string, attr?: string, config?: Config, accum?: Token[]);
|
|
44
|
+
/**
|
|
45
|
+
* 闭合表格语法
|
|
46
|
+
* @param syntax 表格结尾语法
|
|
47
|
+
* @param halfParsed
|
|
48
|
+
*/
|
|
49
|
+
close(syntax?: string, halfParsed?: boolean): void;
|
|
50
|
+
/**
|
|
51
|
+
* 获取表格布局
|
|
52
|
+
* @param stop 中止条件
|
|
53
|
+
* @param stop.row 中止行
|
|
54
|
+
* @param stop.column 中止列
|
|
55
|
+
* @param stop.x 中止行
|
|
56
|
+
* @param stop.y 中止列
|
|
57
|
+
*/
|
|
58
|
+
getLayout(stop?: {
|
|
59
|
+
row?: number;
|
|
60
|
+
column?: number;
|
|
61
|
+
x?: number;
|
|
62
|
+
y?: number;
|
|
63
|
+
}): Layout;
|
|
64
|
+
/** 获取所有行 */
|
|
65
|
+
getAllRows(): (TrToken | this)[];
|
|
66
|
+
/**
|
|
67
|
+
* 获取指定坐标的单元格
|
|
68
|
+
* @param coords 表格坐标
|
|
69
|
+
*/
|
|
70
|
+
getNthCell(coords: TableCoords | TableRenderedCoords): TdToken | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* 获取第n行
|
|
73
|
+
* @param n 行号
|
|
74
|
+
* @param force 是否将表格自身视为第一行
|
|
75
|
+
* @param insert 是否用于判断插入新行的位置
|
|
76
|
+
* @throws `RangeError` 不存在该行
|
|
77
|
+
*/
|
|
78
|
+
getNthRow(n: number, force?: boolean, insert?: false): TrToken | this | undefined;
|
|
79
|
+
getNthRow(n: number, force: boolean, insert: true): TrToken | this | SyntaxToken | undefined;
|
|
80
|
+
/** @override */
|
|
81
|
+
json(): AST;
|
|
82
|
+
/**
|
|
83
|
+
* @override
|
|
84
|
+
* @param token 待插入的子节点
|
|
85
|
+
* @param i 插入位置
|
|
86
|
+
* @throws `SyntaxError` 表格的闭合部分非法
|
|
87
|
+
*/
|
|
88
|
+
insertAt<T extends Token>(token: T, i?: number): T;
|
|
89
|
+
getRowCount(): number;
|
|
90
|
+
/** 获取下一行 */
|
|
91
|
+
getNextRow(): TrToken | undefined;
|
|
92
|
+
/** 打印表格布局 */
|
|
93
|
+
printLayout(): void;
|
|
94
|
+
/**
|
|
95
|
+
* 转换为渲染后的表格坐标
|
|
96
|
+
* @param {TableCoords} coord wikitext中的表格坐标
|
|
97
|
+
*/
|
|
98
|
+
toRenderedCoords(coord: TableCoords): TableRenderedCoords | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* 转换为wikitext中的表格坐标
|
|
101
|
+
* @param {TableRenderedCoords} coord 渲染后的表格坐标
|
|
102
|
+
*/
|
|
103
|
+
toRawCoords(coord: TableRenderedCoords): TableCoords | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* 获取完整行
|
|
106
|
+
* @param y 行号
|
|
107
|
+
*/
|
|
108
|
+
getFullRow(y: number): Map<TdToken, boolean>;
|
|
109
|
+
/**
|
|
110
|
+
* 获取完整列
|
|
111
|
+
* @param x 列号
|
|
112
|
+
*/
|
|
113
|
+
getFullCol(x: number): Map<TdToken, boolean>;
|
|
114
|
+
/**
|
|
115
|
+
* 设置行格式
|
|
116
|
+
* @param y 行号
|
|
117
|
+
* @param attr 表格属性
|
|
118
|
+
* @param multiRow 是否对所有单元格设置,或是仅对行首单元格设置
|
|
119
|
+
*/
|
|
120
|
+
formatTableRow(y: number, attr?: TdAttrs | string, multiRow?: boolean): void;
|
|
121
|
+
/**
|
|
122
|
+
* 设置列格式
|
|
123
|
+
* @param x 列号
|
|
124
|
+
* @param attr 表格属性
|
|
125
|
+
* @param multiCol 是否对所有单元格设置,或是仅对行首单元格设置
|
|
126
|
+
*/
|
|
127
|
+
formatTableCol(x: number, attr?: TdAttrs | string, multiCol?: boolean): void;
|
|
128
|
+
/**
|
|
129
|
+
* 填补表格行
|
|
130
|
+
* @param y 行号
|
|
131
|
+
* @param inner 填充内容
|
|
132
|
+
* @param subtype 单元格类型
|
|
133
|
+
* @param attr 表格属性
|
|
134
|
+
*/
|
|
135
|
+
fillTableRow(y: number, inner: string | Token, subtype?: TdSubtypes, attr?: TdAttrs): void;
|
|
136
|
+
/**
|
|
137
|
+
* 填补表格
|
|
138
|
+
* @param inner 填充内容
|
|
139
|
+
* @param subtype 单元格类型
|
|
140
|
+
* @param attr 表格属性
|
|
141
|
+
*/
|
|
142
|
+
fillTable(inner: string | Token, subtype?: TdSubtypes, attr?: TdAttrs): void;
|
|
143
|
+
insertTableCell(inner: string | Token, coords: TableCoords | TableRenderedCoords, subtype?: TdSubtypes, attr?: TdAttrs): TdToken;
|
|
144
|
+
/**
|
|
145
|
+
* 插入表格行
|
|
146
|
+
* @param y 行号
|
|
147
|
+
* @param attr 表格行属性
|
|
148
|
+
* @param inner 内部wikitext
|
|
149
|
+
* @param subtype 单元格类型
|
|
150
|
+
* @param innerAttr 单元格属性
|
|
151
|
+
*/
|
|
152
|
+
insertTableRow(y: number, attr?: Record<string, string | true>, inner?: string | Token, subtype?: TdSubtypes, innerAttr?: TdAttrs): TrToken;
|
|
153
|
+
/**
|
|
154
|
+
* 插入表格列
|
|
155
|
+
* @param x 列号
|
|
156
|
+
* @param inner 内部wikitext
|
|
157
|
+
* @param subtype 单元格类型
|
|
158
|
+
* @param attr 单元格属性
|
|
159
|
+
* @throws `RangeError` 列号过大
|
|
160
|
+
*/
|
|
161
|
+
insertTableCol(x: number, inner: string | Token, subtype?: TdSubtypes, attr?: TdAttrs): void;
|
|
162
|
+
/**
|
|
163
|
+
* 移除表格行
|
|
164
|
+
* @param y 行号
|
|
165
|
+
*/
|
|
166
|
+
removeTableRow(y: number): TrToken;
|
|
167
|
+
/**
|
|
168
|
+
* 移除表格列
|
|
169
|
+
* @param x 列号
|
|
170
|
+
*/
|
|
171
|
+
removeTableCol(x: number): void;
|
|
172
|
+
/**
|
|
173
|
+
* 合并单元格
|
|
174
|
+
* @param xlim 列范围
|
|
175
|
+
* @param ylim 行范围
|
|
176
|
+
* @throws `RangeError` 待合并区域与外侧区域有重叠
|
|
177
|
+
*/
|
|
178
|
+
mergeCells(xlim: readonly [number, number], ylim: readonly [number, number]): TdToken;
|
|
179
|
+
/**
|
|
180
|
+
* 分裂成多行
|
|
181
|
+
* @param coords 单元格坐标
|
|
182
|
+
*/
|
|
183
|
+
splitIntoRows(coords: TableCoords | TableRenderedCoords): void;
|
|
184
|
+
/**
|
|
185
|
+
* 分裂成多列
|
|
186
|
+
* @param coords 单元格坐标
|
|
187
|
+
*/
|
|
188
|
+
splitIntoCols(coords: TableCoords | TableRenderedCoords): void;
|
|
189
|
+
/**
|
|
190
|
+
* 分裂成单元格
|
|
191
|
+
* @param coords 单元格坐标
|
|
192
|
+
*/
|
|
193
|
+
splitIntoCells(coords: TableCoords | TableRenderedCoords): void;
|
|
194
|
+
/**
|
|
195
|
+
* 复制一行并插入该行之前
|
|
196
|
+
* @param row 行号
|
|
197
|
+
*/
|
|
198
|
+
replicateTableRow(row: number): TrToken;
|
|
199
|
+
/**
|
|
200
|
+
* 复制一列并插入该列之前
|
|
201
|
+
* @param x 列号
|
|
202
|
+
*/
|
|
203
|
+
replicateTableCol(x: number): TdToken[];
|
|
204
|
+
/**
|
|
205
|
+
* 移动表格行
|
|
206
|
+
* @param y 行号
|
|
207
|
+
* @param before 新位置
|
|
208
|
+
* @throws `RangeError` 无法移动
|
|
209
|
+
*/
|
|
210
|
+
moveTableRowBefore(y: number, before: number): TrToken;
|
|
211
|
+
/**
|
|
212
|
+
* 移动表格行
|
|
213
|
+
* @param y 行号
|
|
214
|
+
* @param after 新位置
|
|
215
|
+
* @throws `RangeError` 无法移动
|
|
216
|
+
*/
|
|
217
|
+
moveTableRowAfter(y: number, after: number): TrToken;
|
|
218
|
+
/**
|
|
219
|
+
* 移动表格列
|
|
220
|
+
* @param x 列号
|
|
221
|
+
* @param before 新位置
|
|
222
|
+
*/
|
|
223
|
+
moveTableColBefore(x: number, before: number): void;
|
|
224
|
+
/**
|
|
225
|
+
* 移动表格列
|
|
226
|
+
* @param x 列号
|
|
227
|
+
* @param after 新位置
|
|
228
|
+
*/
|
|
229
|
+
moveTableColAfter(x: number, after: number): void;
|
|
230
|
+
}
|