wikiparser-node 1.4.2-b → 1.4.2

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.
Files changed (162) hide show
  1. package/config/.schema.json +172 -0
  2. package/config/enwiki.json +814 -1
  3. package/config/llwiki.json +35 -1
  4. package/config/moegirl.json +44 -1
  5. package/config/zhwiki.json +466 -1
  6. package/dist/addon/table.d.ts +6 -0
  7. package/dist/addon/table.js +560 -0
  8. package/dist/base.d.ts +53 -0
  9. package/dist/index.d.ts +32 -0
  10. package/dist/index.js +211 -0
  11. package/dist/internal.d.ts +44 -0
  12. package/dist/lib/element.d.ts +154 -0
  13. package/dist/lib/element.js +643 -0
  14. package/dist/lib/node.d.ts +146 -0
  15. package/dist/lib/node.js +425 -0
  16. package/dist/lib/range.d.ts +104 -0
  17. package/dist/lib/range.js +385 -0
  18. package/dist/lib/ranges.d.ts +26 -0
  19. package/dist/lib/ranges.js +118 -0
  20. package/dist/lib/text.d.ts +62 -0
  21. package/dist/lib/text.js +306 -0
  22. package/dist/lib/title.d.ts +38 -0
  23. package/dist/lib/title.js +172 -0
  24. package/dist/mixin/attributesParent.d.ts +20 -0
  25. package/dist/mixin/attributesParent.js +89 -0
  26. package/dist/mixin/fixed.d.ts +5 -0
  27. package/dist/mixin/fixed.js +28 -0
  28. package/dist/mixin/flagsParent.d.ts +61 -0
  29. package/dist/mixin/flagsParent.js +72 -0
  30. package/dist/mixin/hidden.d.ts +5 -0
  31. package/dist/mixin/hidden.js +24 -0
  32. package/dist/mixin/magicLinkParent.d.ts +34 -0
  33. package/dist/mixin/magicLinkParent.js +43 -0
  34. package/dist/mixin/singleLine.d.ts +5 -0
  35. package/dist/mixin/singleLine.js +25 -0
  36. package/dist/mixin/sol.d.ts +8 -0
  37. package/dist/mixin/sol.js +41 -0
  38. package/dist/mixin/syntax.d.ts +6 -0
  39. package/dist/mixin/syntax.js +54 -0
  40. package/dist/parser/braces.js +131 -0
  41. package/dist/parser/commentAndExt.js +90 -0
  42. package/dist/parser/converter.js +41 -0
  43. package/dist/parser/externalLinks.js +32 -0
  44. package/dist/parser/hrAndDoubleUnderscore.js +41 -0
  45. package/dist/parser/html.js +39 -0
  46. package/dist/parser/links.js +97 -0
  47. package/dist/parser/list.js +68 -0
  48. package/dist/parser/magicLinks.js +43 -0
  49. package/dist/parser/quotes.js +68 -0
  50. package/dist/parser/selector.js +162 -0
  51. package/dist/parser/table.js +124 -0
  52. package/dist/src/arg.d.ts +58 -0
  53. package/dist/src/arg.js +196 -0
  54. package/dist/src/atom.d.ts +12 -0
  55. package/dist/src/atom.js +27 -0
  56. package/dist/src/attribute.d.ts +67 -0
  57. package/dist/src/attribute.js +422 -0
  58. package/dist/src/attributes.d.ts +109 -0
  59. package/dist/src/attributes.js +347 -0
  60. package/dist/src/converter.d.ts +28 -0
  61. package/dist/src/converter.js +85 -0
  62. package/dist/src/converterFlags.d.ts +87 -0
  63. package/dist/src/converterFlags.js +227 -0
  64. package/dist/src/converterRule.d.ts +77 -0
  65. package/dist/src/converterRule.js +210 -0
  66. package/dist/src/extLink.d.ts +38 -0
  67. package/dist/src/extLink.js +137 -0
  68. package/dist/src/gallery.d.ts +54 -0
  69. package/dist/src/gallery.js +127 -0
  70. package/dist/src/heading.d.ts +47 -0
  71. package/dist/src/heading.js +143 -0
  72. package/dist/src/hidden.d.ts +7 -0
  73. package/dist/src/hidden.js +23 -0
  74. package/dist/src/html.d.ts +62 -0
  75. package/dist/src/html.js +286 -0
  76. package/dist/src/imageParameter.d.ts +65 -0
  77. package/dist/src/imageParameter.js +247 -0
  78. package/dist/src/imagemap.d.ts +56 -0
  79. package/dist/src/imagemap.js +156 -0
  80. package/dist/src/imagemapLink.d.ts +28 -0
  81. package/dist/src/imagemapLink.js +44 -0
  82. package/dist/src/index.d.ts +143 -0
  83. package/dist/src/index.js +804 -0
  84. package/dist/src/link/base.d.ts +52 -0
  85. package/dist/src/link/base.js +212 -0
  86. package/dist/src/link/category.d.ts +13 -0
  87. package/dist/src/link/category.js +28 -0
  88. package/dist/src/link/file.d.ts +96 -0
  89. package/dist/src/link/file.js +266 -0
  90. package/dist/src/link/galleryImage.d.ts +31 -0
  91. package/dist/src/link/galleryImage.js +109 -0
  92. package/dist/src/link/index.d.ts +56 -0
  93. package/dist/src/link/index.js +134 -0
  94. package/dist/src/magicLink.d.ts +51 -0
  95. package/dist/src/magicLink.js +149 -0
  96. package/dist/src/nested.d.ts +43 -0
  97. package/dist/src/nested.js +91 -0
  98. package/dist/src/nowiki/base.d.ts +27 -0
  99. package/dist/src/nowiki/base.js +42 -0
  100. package/dist/src/nowiki/comment.d.ts +27 -0
  101. package/dist/src/nowiki/comment.js +77 -0
  102. package/dist/src/nowiki/dd.d.ts +8 -0
  103. package/dist/src/nowiki/dd.js +24 -0
  104. package/dist/src/nowiki/doubleUnderscore.d.ts +18 -0
  105. package/dist/src/nowiki/doubleUnderscore.js +51 -0
  106. package/dist/src/nowiki/hr.d.ts +8 -0
  107. package/dist/src/nowiki/hr.js +14 -0
  108. package/dist/src/nowiki/index.d.ts +16 -0
  109. package/dist/src/nowiki/index.js +20 -0
  110. package/dist/src/nowiki/list.d.ts +19 -0
  111. package/dist/src/nowiki/list.js +48 -0
  112. package/dist/src/nowiki/listBase.d.ts +5 -0
  113. package/dist/src/nowiki/listBase.js +11 -0
  114. package/dist/src/nowiki/noinclude.d.ts +10 -0
  115. package/dist/src/nowiki/noinclude.js +23 -0
  116. package/dist/src/nowiki/quote.d.ts +14 -0
  117. package/dist/src/nowiki/quote.js +68 -0
  118. package/dist/src/onlyinclude.d.ts +16 -0
  119. package/dist/src/onlyinclude.js +57 -0
  120. package/dist/src/paramTag/index.d.ts +37 -0
  121. package/dist/src/paramTag/index.js +68 -0
  122. package/dist/src/paramTag/inputbox.d.ts +8 -0
  123. package/dist/src/paramTag/inputbox.js +22 -0
  124. package/dist/src/parameter.d.ts +67 -0
  125. package/dist/src/parameter.js +213 -0
  126. package/dist/src/pre.d.ts +28 -0
  127. package/dist/src/pre.js +54 -0
  128. package/dist/src/syntax.d.ts +14 -0
  129. package/dist/src/syntax.js +35 -0
  130. package/dist/src/table/base.d.ts +27 -0
  131. package/dist/src/table/base.js +81 -0
  132. package/dist/src/table/index.d.ts +230 -0
  133. package/dist/src/table/index.js +390 -0
  134. package/dist/src/table/td.d.ts +88 -0
  135. package/dist/src/table/td.js +284 -0
  136. package/dist/src/table/tr.d.ts +32 -0
  137. package/dist/src/table/tr.js +57 -0
  138. package/dist/src/table/trBase.d.ts +53 -0
  139. package/dist/src/table/trBase.js +154 -0
  140. package/dist/src/tagPair/ext.d.ts +29 -0
  141. package/dist/src/tagPair/ext.js +153 -0
  142. package/dist/src/tagPair/include.d.ts +37 -0
  143. package/dist/src/tagPair/include.js +71 -0
  144. package/dist/src/tagPair/index.d.ts +27 -0
  145. package/dist/src/tagPair/index.js +79 -0
  146. package/dist/src/transclude.d.ts +167 -0
  147. package/dist/src/transclude.js +715 -0
  148. package/dist/util/constants.js +113 -0
  149. package/dist/util/debug.js +90 -0
  150. package/dist/util/diff.js +82 -0
  151. package/dist/util/lint.js +30 -0
  152. package/dist/util/string.js +53 -0
  153. package/errors/README +1 -0
  154. package/package.json +15 -30
  155. package/printed/README +1 -0
  156. package/bundle/bundle.min.js +0 -36
  157. package/extensions/dist/base.js +0 -64
  158. package/extensions/dist/editor.js +0 -159
  159. package/extensions/dist/highlight.js +0 -59
  160. package/extensions/dist/lint.js +0 -48
  161. package/extensions/editor.css +0 -63
  162. package/extensions/ui.css +0 -141
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImagemapToken = void 0;
4
+ const lint_1 = require("../util/lint");
5
+ const debug_1 = require("../util/debug");
6
+ const constants_1 = require("../util/constants");
7
+ const singleLine_1 = require("../mixin/singleLine");
8
+ const index_1 = require("../index");
9
+ const index_2 = require("./index");
10
+ const noinclude_1 = require("./nowiki/noinclude");
11
+ const galleryImage_1 = require("./link/galleryImage");
12
+ const imagemapLink_1 = require("./imagemapLink");
13
+ /**
14
+ * `<imagemap>`
15
+ * @classdesc `{childNodes: ...NoincludeToken, GalleryImageToken, ...(NoincludeToken|ImagemapLinkToken|AstText)}`
16
+ */
17
+ class ImagemapToken extends index_2.Token {
18
+ type = 'ext-inner';
19
+ /** 图片 */
20
+ get image() {
21
+ return this.childNodes.find((0, debug_1.isToken)('imagemap-image'));
22
+ }
23
+ /* NOT FOR BROWSER */
24
+ /** 链接 */
25
+ get links() {
26
+ return this.childNodes.filter((0, debug_1.isToken)('imagemap-link'));
27
+ }
28
+ /* NOT FOR BROWSER END */
29
+ /** @param inner 标签内部wikitext */
30
+ constructor(inner, config = index_1.default.getConfig(), accum = []) {
31
+ super(undefined, config, accum, {
32
+ GalleryImageToken: ':', ImagemapLinkToken: ':', SingleLineNoincludeToken: ':', AstText: ':',
33
+ });
34
+ if (!inner) {
35
+ return;
36
+ }
37
+ const lines = inner.split('\n'), protocols = new Set(config.protocol.split('|')), SingleLineNoincludeToken = (0, singleLine_1.singleLine)(noinclude_1.NoincludeToken);
38
+ let first = true, error = false;
39
+ for (const line of lines) {
40
+ const trimmed = line.trim();
41
+ if (error || !trimmed || trimmed.startsWith('#')) {
42
+ //
43
+ }
44
+ else if (first) {
45
+ const [file, ...options] = line.split('|'), title = this.normalizeTitle(file, 0, true);
46
+ if (title.valid
47
+ /* NOT FOR BROWSER */
48
+ && !title.interwiki
49
+ /* NOT FOR BROWSER END */
50
+ && title.ns === 6) {
51
+ // @ts-expect-error abstract class
52
+ const token = new galleryImage_1.GalleryImageToken('imagemap', file, options.length > 0 ? options.join('|') : undefined, config, accum);
53
+ super.insertAt(token);
54
+ first = false;
55
+ continue;
56
+ }
57
+ else {
58
+ /* NOT FOR BROWSER */
59
+ index_1.default.error('<imagemap>标签内必须先包含一张合法图片!', line);
60
+ /* NOT FOR BROWSER END */
61
+ error = true;
62
+ }
63
+ }
64
+ else if (line.trim().split(/[\t ]/u)[0] === 'desc') {
65
+ super.insertAt(line);
66
+ continue;
67
+ }
68
+ else if (line.includes('[')) {
69
+ const i = line.indexOf('['), substr = line.slice(i), mtIn = /^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u
70
+ .exec(substr);
71
+ if (mtIn) {
72
+ if (this.normalizeTitle(mtIn[1], 0, true, false, true).valid) {
73
+ // @ts-expect-error abstract class
74
+ super.insertAt(new imagemapLink_1.ImagemapLinkToken(line.slice(0, i), mtIn.slice(1), substr.slice(substr.indexOf(']]') + 2), config, accum));
75
+ continue;
76
+ }
77
+ }
78
+ else if (protocols.has(substr.slice(1, substr.indexOf(':') + 1))
79
+ || protocols.has(substr.slice(1, substr.indexOf('//') + 2))) {
80
+ const mtEx = /^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u
81
+ .exec(substr);
82
+ if (mtEx) {
83
+ // @ts-expect-error abstract class
84
+ super.insertAt(new imagemapLink_1.ImagemapLinkToken(line.slice(0, i), mtEx.slice(1), substr.slice(substr.indexOf(']') + 1), config, accum));
85
+ continue;
86
+ }
87
+ }
88
+ }
89
+ // @ts-expect-error abstract class
90
+ super.insertAt(new SingleLineNoincludeToken(line, config, accum));
91
+ }
92
+ }
93
+ /** @private */
94
+ toString() {
95
+ return super.toString('\n');
96
+ }
97
+ /** @override */
98
+ text() {
99
+ return super.text('\n').replace(/\n{2,}/gu, '\n');
100
+ }
101
+ /** @private */
102
+ getGaps() {
103
+ return 1;
104
+ }
105
+ /** @override */
106
+ lint(start = this.getAbsoluteIndex()) {
107
+ const errors = super.lint(start), rect = { start, ...this.getRootNode().posFromIndex(start) };
108
+ if (this.image) {
109
+ errors.push(...this.childNodes.filter(child => {
110
+ const str = String(child).trim();
111
+ return child.type === 'noinclude' && str && !str.startsWith('#');
112
+ }).map(child => (0, lint_1.generateForChild)(child, rect, 'invalid link in <imagemap>')));
113
+ }
114
+ else {
115
+ errors.push((0, lint_1.generateForSelf)(this, rect, '<imagemap> without an image'));
116
+ }
117
+ return errors;
118
+ }
119
+ /** @override */
120
+ print() {
121
+ return super.print({ sep: '\n' });
122
+ }
123
+ insertAt(token, i) {
124
+ const { image } = this;
125
+ if (!image && (typeof token === 'string' || token.type === 'imagemap-link' || token.type === 'text')) {
126
+ throw new Error('当前缺少一张合法图片!');
127
+ }
128
+ else if (image && typeof token !== 'string' && token.type === 'imagemap-image') {
129
+ throw new RangeError('已有一张合法图片!');
130
+ }
131
+ return super.insertAt(token, i);
132
+ }
133
+ /**
134
+ * @override
135
+ * @param i 移除位置
136
+ * @throws `Error` 禁止移除图片
137
+ */
138
+ removeAt(i) {
139
+ if (this.childNodes[i].type === 'imagemap-image') {
140
+ throw new Error('禁止移除<imagemap>内的图片!');
141
+ }
142
+ return super.removeAt(i);
143
+ }
144
+ /** @override */
145
+ cloneNode() {
146
+ const cloned = this.cloneChildNodes();
147
+ return debug_1.Shadow.run(() => {
148
+ // @ts-expect-error abstract class
149
+ const token = new ImagemapToken(undefined, this.getAttribute('config'));
150
+ token.append(...cloned);
151
+ return token;
152
+ });
153
+ }
154
+ }
155
+ exports.ImagemapToken = ImagemapToken;
156
+ constants_1.classes['ImagemapToken'] = __filename;
@@ -0,0 +1,28 @@
1
+ import Parser from '../index';
2
+ import { Token } from './index';
3
+ import { NoincludeToken } from './nowiki/noinclude';
4
+ import { LinkToken } from './link/index';
5
+ import { ExtLinkToken } from './extLink';
6
+ import type { Title } from '../lib/title';
7
+ import type { AstText, ImagemapToken } from '../internal';
8
+ export declare abstract class ImagemapLinkToken extends Token {
9
+ readonly type = "imagemap-link";
10
+ readonly childNodes: readonly [AstText, LinkToken | ExtLinkToken, NoincludeToken];
11
+ abstract get children(): [LinkToken | ExtLinkToken, NoincludeToken];
12
+ abstract get firstChild(): AstText;
13
+ abstract get firstElementChild(): LinkToken | ExtLinkToken;
14
+ abstract get lastChild(): NoincludeToken;
15
+ abstract get lastElementChild(): NoincludeToken;
16
+ abstract get parentNode(): ImagemapToken | undefined;
17
+ abstract get parentElement(): ImagemapToken | undefined;
18
+ /** 内外链接 */
19
+ get link(): string | Title;
20
+ set link(link: string);
21
+ /**
22
+ * @param pre 链接前的文本
23
+ * @param linkStuff 内外链接
24
+ * @param post 链接后的文本
25
+ */
26
+ constructor(pre: string, linkStuff: readonly [string, string | undefined, string | undefined] | readonly [string, string | undefined], post: string, config?: Parser.Config, accum?: Token[]);
27
+ }
28
+ export {};
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ImagemapLinkToken = void 0;
4
+ const constants_1 = require("../util/constants");
5
+ const fixed_1 = require("../mixin/fixed");
6
+ const singleLine_1 = require("../mixin/singleLine");
7
+ const index_1 = require("../index");
8
+ const index_2 = require("./index");
9
+ const noinclude_1 = require("./nowiki/noinclude");
10
+ const index_3 = require("./link/index");
11
+ const extLink_1 = require("./extLink");
12
+ /**
13
+ * `<imagemap>`内的链接
14
+ * @classdesc `{childNodes: [AstText, LinkToken|ExtLinkToken, NoincludeToken]}`
15
+ */
16
+ class ImagemapLinkToken extends (0, fixed_1.fixedToken)((0, singleLine_1.singleLine)(index_2.Token)) {
17
+ type = 'imagemap-link';
18
+ /* NOT FOR BROWSER */
19
+ /** 内外链接 */
20
+ get link() {
21
+ return this.childNodes[1].link;
22
+ }
23
+ set link(link) {
24
+ this.childNodes[1].link = link;
25
+ }
26
+ /* NOT FOR BROWSER END */
27
+ /**
28
+ * @param pre 链接前的文本
29
+ * @param linkStuff 内外链接
30
+ * @param post 链接后的文本
31
+ */
32
+ constructor(pre, linkStuff, post, config = index_1.default.getConfig(), accum = []) {
33
+ super(undefined, config, accum);
34
+ this.append(pre, linkStuff.length === 2
35
+ // @ts-expect-error abstract class
36
+ ? new index_3.LinkToken(...linkStuff, config, accum)
37
+ // @ts-expect-error abstract class
38
+ : new extLink_1.ExtLinkToken(...linkStuff, config, accum),
39
+ // @ts-expect-error abstract class
40
+ new noinclude_1.NoincludeToken(post, config, accum));
41
+ }
42
+ }
43
+ exports.ImagemapLinkToken = ImagemapLinkToken;
44
+ constants_1.classes['ImagemapLinkToken'] = __filename;
@@ -0,0 +1,143 @@
1
+ import { BuildMethod } from '../util/constants';
2
+ import { AstRange } from '../lib/range';
3
+ import Parser from '../index';
4
+ import { AstElement } from '../lib/element';
5
+ import { AstText } from '../lib/text';
6
+ import type { LintError } from '../base';
7
+ import type { Range } from '../lib/ranges';
8
+ import type { Title } from '../lib/title';
9
+ import type { AstNodes, IncludeToken, HtmlToken, ExtToken, TranscludeToken, CommentToken, FileToken, LinkToken, ExtLinkToken, MagicLinkToken, ImageParameterToken, ImagemapLinkToken } from '../internal';
10
+ import type { CaretPosition } from '../lib/node';
11
+ import type { TokenTypes } from '../util/constants';
12
+ declare type TagToken = IncludeToken | ExtToken | HtmlToken;
13
+ /**
14
+ * 所有节点的基类
15
+ * @classdesc `{childNodes: ...(AstText|Token)}`
16
+ */
17
+ export declare class Token extends AstElement {
18
+ #private;
19
+ type: TokenTypes;
20
+ /** 所有图片,包括图库 */
21
+ get images(): FileToken[];
22
+ /** 所有内链、外链和自由外链 */
23
+ get links(): (LinkToken | ExtLinkToken | MagicLinkToken | ImageParameterToken | ImagemapLinkToken)[];
24
+ /** 所有模板和模块 */
25
+ get embeds(): TranscludeToken[];
26
+ /** @class */
27
+ constructor(wikitext?: string, config?: Parser.Config, accum?: Token[], acceptable?: Acceptable);
28
+ /**
29
+ * @override
30
+ * @param child 待插入的子节点
31
+ * @param i 插入位置
32
+ */
33
+ insertAt(child: string, i?: number): AstText;
34
+ insertAt<T extends AstNodes>(child: T, i?: number): T;
35
+ /**
36
+ * 规范化页面标题
37
+ * @param title 标题(含或不含命名空间前缀)
38
+ * @param defaultNs 命名空间
39
+ * @param halfParsed 仅供内部使用
40
+ * @param decode 是否需要解码
41
+ * @param selfLink 是否允许selfLink
42
+ */
43
+ normalizeTitle(title: string, defaultNs?: number, halfParsed?: boolean, decode?: boolean, selfLink?: boolean): Title;
44
+ /** @override */
45
+ lint(start?: number): LintError[];
46
+ /**
47
+ * @override
48
+ * @param i 移除位置
49
+ */
50
+ removeAt(i: number): AstNodes;
51
+ /**
52
+ * 替换为同类节点
53
+ * @param token 待替换的节点
54
+ * @throws `Error` 不存在父节点
55
+ */
56
+ safeReplaceWith(token: this): void;
57
+ /**
58
+ * 创建HTML注释
59
+ * @param data 注释内容
60
+ */
61
+ createComment(data?: string): CommentToken;
62
+ /**
63
+ * 创建标签
64
+ * @param tagName 标签名
65
+ * @param options 选项
66
+ * @param options.selfClosing 是否自封闭
67
+ * @param options.closing 是否是闭合标签
68
+ * @throws `RangeError` 非法的标签名
69
+ */
70
+ createElement(tagName: string, { selfClosing, closing }?: {
71
+ selfClosing?: boolean;
72
+ closing?: boolean;
73
+ }): TagToken;
74
+ /**
75
+ * 创建纯文本节点
76
+ * @param data 文本内容
77
+ */
78
+ createTextNode(data?: string): AstText;
79
+ /** 创建AstRange对象 */
80
+ createRange(): AstRange;
81
+ /**
82
+ * 找到给定位置
83
+ * @param index 位置
84
+ */
85
+ caretPositionFromIndex(index?: number): CaretPosition | undefined;
86
+ /**
87
+ * 找到给定位置
88
+ * @param x 列数
89
+ * @param y 行数
90
+ */
91
+ caretPositionFromPoint(x: number, y: number): CaretPosition | undefined;
92
+ /**
93
+ * 找到给定位置所在的最外层节点
94
+ * @param index 位置
95
+ */
96
+ elementFromIndex(index?: number): AstNodes | undefined;
97
+ /**
98
+ * 找到给定位置所在的最外层节点
99
+ * @param x 列数
100
+ * @param y 行数
101
+ */
102
+ elementFromPoint(x: number, y: number): AstNodes | undefined;
103
+ /**
104
+ * 找到给定位置所在的所有节点
105
+ * @param index 位置
106
+ */
107
+ elementsFromIndex(index?: number): AstNodes[];
108
+ /**
109
+ * 找到给定位置所在的所有节点
110
+ * @param x 列数
111
+ * @param y 行数
112
+ */
113
+ elementsFromPoint(x: number, y: number): AstNodes[];
114
+ /**
115
+ * 判断标题是否是跨维基链接
116
+ * @param title 标题
117
+ */
118
+ isInterwiki(title: string): RegExpExecArray | null;
119
+ /** 深拷贝节点 */
120
+ cloneNode(): this;
121
+ /** 获取全部章节 */
122
+ sections(): (AstText | Token)[][] | undefined;
123
+ /**
124
+ * 获取指定章节
125
+ * @param n 章节序号
126
+ */
127
+ section(n: number): (AstText | Token)[] | undefined;
128
+ /**
129
+ * 获取指定的外层HTML标签
130
+ * @param tag HTML标签名
131
+ * @throws `RangeError` 非法的标签或空标签
132
+ */
133
+ findEnclosingHtml(tag?: string): AstRange | undefined;
134
+ /** 获取全部分类 */
135
+ getCategories(): [string, string | undefined][];
136
+ /** 重新解析单引号 */
137
+ redoQuotes(): void;
138
+ /** 解析部分魔术字 */
139
+ solveConst(): void;
140
+ /** 合并普通节点的普通子节点 */
141
+ flatten(): void;
142
+ }
143
+ export {};